Hello. I'm trying to plot a differntial equation using MATLAB. When I run my program, I'm getting different graph.
I've attached the differential equation and my MATLAB coding below.
Can anyone tell me how to use the boundary conditions correctly?
function abcdex4init=bvpinit(linspace(0.00001,100,21),[0,0]);sol=bvp4c(@ex4ode,@ex4bc,ex4init)plot(sol.x,sol.y(1,:),'blue');endfunction f=ex4ode(r,y)a=0.001391304348;b=19.31459475;f=[y(2) -(2/r)*y(2)-a*(1-exp(b*y(1))) ];endfunction res=ex4bc(ya,yb)res=[ ya(1)+1 yb(2) ]end
This is the graph which I got.
But this is the exact graph.
Best Answer