I require a solution for the set od ODE's using MATLAB function 'bvp4c'
Show older comments
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?
Accepted Answer
More Answers (0)
Categories
Find more on General Applications in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!