I require a solution for the set od ODE's using MATLAB function 'bvp4c'

The code that I've written is as follows:
function bvp_code_matlab_3
options = bvpset('stats','off', 'RelTol', 1e-6);
solinit = bvpinit(linspace(0,1,4),[0.5,1,0,0,0,0,0]);
sol = bvp4c (@OdeBVP, @OdeBC, solinit, options);
plot (sol.x, sol.y(1,:));
end
% Define ODE
function f = OdeBVP(x,y)
f=[y(2);
y(3);
y(4);
5*(3*y(3)+(1.44-2*y(1))*y(3)-2*(10/5)*y(5)*y(6));
y(6);
5*(2*y(5)+1.44*y(6)+2*y(5)*y(2)-2*y(1)*y(6));
];
end
% Define Boundary conditions
function res = OdeBC (ya,yb)
res = [
ya(5)-1.0;
yb(5)-0.4;
ya(1);
ya(2);
yb(1)-0.5;
yb(2);
]
end
Can someone please tell me where I've gone wrong in the code?

 채택된 답변

madhan ravi
madhan ravi 2018년 12월 7일
편집: madhan ravi 2018년 12월 7일
The reason for the error was you gave 7 intitial conditions whereas only 6 are required
solinit = bvpinit(linspace(0,1,4),[0.5,1,0,0,0,0]); %just change this line
The graph I get
Screen Shot 2018-12-07 at 1.01.14 PM.png

댓글 수: 3

Thank you Sir!
However, if I wanted to write the code for varying values of R and s, how would the code change?
And how do I plot a graph for -g'(0) vs R1 for the above equations?
Thanks.
Thank You Sir!
I'm still not able to figure out the code for obtaining the following graph. Could you please help me out by telling me the chnages required to be made in the code in order to get the graph shown in the PNG file that I've attached.
Thanks.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

태그

질문:

2018년 12월 7일

댓글:

2018년 12월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by