Solve a system of Partial Differential Equations using function BVP4C
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hiep Hoang
am 27 Mär. 2017
Kommentiert: Torsten
am 4 Apr. 2017
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 Kommentare
Akzeptierte Antwort
Torsten
am 28 Mär. 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.
0 Kommentare
Weitere Antworten (2)
Bill Greene
am 28 Mär. 2017
It looks to me like you have 9 dependent variables and only 7 equations and boundary conditions. Clearly, that can't be solved.
0 Kommentare
Hiep Hoang
am 3 Apr. 2017
1 Kommentar
Torsten
am 4 Apr. 2017
Use a function for yinit:
https://de.mathworks.com/help/matlab/ref/bvpinit.html
Best wishes
Torsten.
Siehe auch
Kategorien
Mehr zu Boundary Value Problems finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!