Help in using bvp4c second order ODE.

I am trying to solve this equation: 9,81-2,5*y^2+1,75* θ2y^2/θx2=0,15 (bc: y(0)=0,y(1)=0) The problem is that y is squared. I managed to find a solution for y^2 but not y. I tried to use the equation: θ2y^2/θx2=2*(y'*y'+y*y'') but I got an error:
Error using bvp4c Unable to solve the collocation equations -- a singular Jacobian encountered.
Any ideas on how to obtain a solution for y?
Thanks.
function bvp4 xlow=0; xhigh=1; solinit=bvpinit(linspace(xlow,xhigh,1000),[0 0]); sol = bvp4c(@bvp4ode,@bvp4bc,solinit); xint=linspace(xlow,xhigh); Sxint=deval(sol,xint); plot(xint,Sxint(1,:))
function dydx = bvp4ode(x,y) dydx = [y(2); (0.15-9.81+2.5*y(1))/1.75 ];
function res = bvp4bc(ya,yb) res = [ya(1); yb(1)];

 Accepted Answer

Torsten
Torsten on 20 Apr 2016
If the above code works (for y^2), why not just taking the square root of the solution to get y ?
Best wishes
Torsten.

2 Comments

Yes this could work, but where exactly in the bvp4c code should I declare that I want a solution for y? Thanks.
Nowhere.
Use
xint=linspace(xlow,xhigh);
Sxint=deval(sol,xint);
Sxint=sqrt(Sxint);
plot(xint,Sxint(1,:))
Best wishes
Torsten.

Sign in to comment.

More Answers (0)

Tags

Asked:

on 19 Apr 2016

Commented:

on 21 Apr 2016

Community Treasure Hunt

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

Start Hunting!