Solve a system of Partial Differential Equations using function BVP4C

3 views (last 30 days)
Hello every one. I have a Boundary Value Problem to solve. When I press "run", an error appears: "Warning: Explicit solution could not be found. > In solve at 160". How can I fix my errors. Thank you in advance!
Below is my Boundary Value Problem and the code:
BVP problem:
S'''+3SS''-2*S'*S'+Y-109.963*F=0
Y''+3*5.076*S*Y'+0.0000007738*F'*Y'+0.00000255*Y'*Y'=0
F''+3*5.076*42770*S*F'+2.914*Y''=0
Boundary Conditions:
x=0 then S=S'=0, Y=1, F=1
x=infinitive then S'=Y=F=0
My code:
Editor window 1:
clear all; close all; clc;
init=bvpinit(linspace(0,4,100),[0 0 0 0 0 0 0 0 0])
sol=bvp4c(@rhs_bvp,@bc_bvp,init);
x=linspace(0,4,1000);
BS=deval(sol,x);
plot(x,BS);
Editor window 2:
function rhs=rhs_bvp(x,y)
rhs=[y(2);y(3);-3*y(1)*y(3)+2*y(2)*y(2)-y(5)+109.963*y(8);y(6);-3*5.076*y(1)*y(6)-0.0000007738*y(9)*y(6)-0.000002255*y(6)*y(6);y(9);-3*5.076*42770*y(1)*y(9)+2.914*3*5.076*y(1)*y(6)+2.914*0.0000007738*y(9)*y(6)+2.914*0.000002255*y(6)*y(6)];
Editor window 3:
function bc=bc_bvp(yl,yr)
bc=[yl(1);yl(2);yl(5)-1;yl(8)-1;yr(2);yr(5);yr(8)];

Accepted Answer

Torsten
Torsten on 28 Mar 2017
rhs=[y(2);y(3);-3*y(1)*y(3)+2*y(2)*y(2)-y(4)+109.963*y(6);y(5);-3*5.076*y(1)*y(5)-0.0000007738*y(5)*y(7)-0.000002255*y(5)*y(5);y(7);-3*5.076*42770*y(1)*y(7)-2.914*(-3*5.076*y(1)*y(5)-0.0000007738*y(5)*y(7)-0.000002255*y(5)*y(5))];
bc=[yl(1);yl(2);yl(4)-1;yl(6)-1;yr(2);yr(4);yr(6)];
Best wishes
Torsten.

More Answers (2)

Bill Greene
Bill Greene on 28 Mar 2017
It looks to me like you have 9 dependent variables and only 7 equations and boundary conditions. Clearly, that can't be solved.

Hiep Hoang
Hiep Hoang on 3 Apr 2017
Thank Bill Greene and Torsten for your comments. I already got some results, but results are not so good. The residual is quite large as compared to tolerance.
I think the problem is the initial guess. The number of mesh points is 1000. I specify the initial guess as following:
init=bvpinit(linspace(0,10,1000),[0 0 1 1 -0.33 1 -1])
It means that at each of 1000 points, y(1)=0, y(2)=0, y(3)=1, y(4)=1, y(5)=-0.33, y (6)=1, y(7)=-1. But how can I specify the initial guess at only one point x=0, I think it can improve the results.
  1 Comment
Torsten
Torsten on 4 Apr 2017
Use a function for yinit:
https://de.mathworks.com/help/matlab/ref/bvpinit.html
Best wishes
Torsten.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!