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)];

 채택된 답변

Torsten
Torsten 2016년 4월 20일

0 개 추천

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

SuzieQ
SuzieQ 2016년 4월 20일
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.

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

추가 답변 (0개)

카테고리

태그

질문:

2016년 4월 19일

댓글:

2016년 4월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by