Integral in odefun bvp4c

I am working on the solution of the following 4th order ode:
y'''' + y'' * integral( y' ^ 2 ) = 10
b.c.: y(0) =0; y'(1)=0; y''(1)=0; y'''(1)=0;
How can I write my last equation in @myode?
Thanks in advance for your help.
% ---------------------------------------------------------------------
function fun
clc;
clear;
close all;
%y(4)+y(2)*integral(y(1)^2,0,L)=10
solinit = bvpinit(linspace(0,1,10),[0;0;0;0]);
sol=bvp4c(@myode,@mybc,solinit);
figure;
plot(sol.x,sol.y);
% ---------------------------------------------------------------------
function dydx = myode(x,y)
dydx = [y(2)
y(3)
y(4)
% 10-y(3)*integral(y(2)^2,0,1)
];
% ------------------------------------------------------------
function bc = mybc(ya,yb)
bc = [ya(1)
ya(2)
yb(2)
yb(3)];

Answers (1)

Michael Gareis
Michael Gareis on 9 Nov 2020

0 votes

I would try preparing your equation first by dividing by y'':
y''''/y'' + integral( y' ^ 2 ) = 10/y''
then derive it (consider quotient rule!), to eliminate the integral:
(y'''''*y'''-y'''*y'''')/y''^2+y'^2 = -10y'''/y''^2
and multiplying by y''^2:
y'''''*y'''-y'''*y'''' + y'^2 = -10y'''
Which is a 5th order equation. Reduced to a 1st order equation you should get this set of 5 equations:
dydx = [y(2);
y(3);
y(4);
y(5),
(-10y(4)-y(2)^2-y(4)*y(5))/y(4)];
You now need to set a 5th BC and extend your initial guess by one column to solve your problem.

2 Comments

Pierluigi Auriti
Pierluigi Auriti on 9 Nov 2020
Edited: Pierluigi Auriti on 10 Nov 2020
I only have a doubt: when I multiply by y''^2 my result is:
y'''''*y''-y'''*y'''' + y'^2 *y''^2 = -10y''' right?
I really appreciate your help. Thank you!
Yes sorry, should be y'''''*y''-y'''*y'''' + y'^2*y''^2 = -10y'''
Since y itself doesn' show up in your equation, you can further simplify it by defining for example g=y'. And work with derivatives of g instead, eventually reducing the order by 1.

Sign in to comment.

Asked:

on 9 Nov 2020

Commented:

on 11 Nov 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!