Solve a system of Partial Differential Equations using function BVP4C

조회 수: 4 (최근 30일)
Hiep Hoang
Hiep Hoang 2017년 3월 27일
댓글: Torsten 2017년 4월 4일
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)];

채택된 답변

Torsten
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.

추가 답변 (2개)

Bill Greene
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.

Hiep Hoang
Hiep Hoang 2017년 4월 3일
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
Torsten
Torsten 2017년 4월 4일
Use a function for yinit:
https://de.mathworks.com/help/matlab/ref/bvpinit.html
Best wishes
Torsten.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Boundary Value Problems에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by