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!