I am trying to solve the following ODE in MATLAB, but I do not attain a reasonable answer. It would be highly appreciated if you let me know of the bugs in my code below the ODE.
The ODE is: (d/dx)(y^3 dy/dx)+(2/3)(x dy/dx)-(1/3)y=0;
The BC's are: (y^3)(dy/dx)=-1, for x=0; and y(inf)=0;
What I have done is to use transforms as below
Then, dY(1)/dx=Y(2) and dY(2)/dx=((1/3)(1/Y(1)^2))-((2/3)(xY(2)/Y(1)^3)) (to have this equation I just ignored the high order small value of (dy/dx)^2 which is an assumption I took; If there is better solution I would be happy to replace).
According to above descriptions, I used following code in MATLAB:
solinit = bvpinit(xmesh,[1 0]);
sol = bvp4c(@lode,@bcs,solinit);
function dYdx = lode(x,Y)
dYdx(1) = Y(2);
dYdx(2) = (1/3)*((1/(Y(1)^2))-(2*x*Y(2)/(Y(1)^3)));
function res = bcs(ya,yb)
res = [ ((ya(1)^3)*ya(2))+1;
But, I encountered with error of "a singular Jacobian".
I am looking forward to hearing your advices.