Solve a system of Partial Differential Equations using function BVP4C
4 次查看(过去 30 天)
显示 更早的评论
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)];
0 个评论
采纳的回答
Torsten
2017-3-28
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.
0 个评论
更多回答(2 个)
Bill Greene
2017-3-28
It looks to me like you have 9 dependent variables and only 7 equations and boundary conditions. Clearly, that can't be solved.
0 个评论
Hiep Hoang
2017-4-3
1 个评论
Torsten
2017-4-4
Use a function for yinit:
https://de.mathworks.com/help/matlab/ref/bvpinit.html
Best wishes
Torsten.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Boundary Value Problems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!