non-linear 2nd ODE
이전 댓글 표시
how can I solve this equation?
yp = diff(y,r);
yp2 = diff(y,r,2);
eqn = ( yp2 + yp/r-SH*y^2 == 0 );
답변 (1개)
Star Strider
2020년 2월 1일
Analytically, it likely does not have a solution since it is nonlinear and most nonlinear differential equations do not have analytic solutions.
You can get some solutions for it numerically, however it quicklly goes to infinity:
syms r SH y(r) y0 y10 Y
yp = diff(y,r);
yp2 = diff(y,r,2);
eqn = ( yp2 + yp/r-SH*y^2 == 0 );
[VF,Subs] = odeToVectorField(eqn);
yfcn = matlabFunction(VF, 'Vars',{r,Y,SH})
SH = 1; % Change To Appropriate Value
rspan = linspace(0.0001, 11, 75);
ic = [1 1]*0.1;
[r,y] = ode45(@(r,y)yfcn(r,y,SH), rspan, ic);
figure
plot(r, y)
grid
legend(string(Subs))
This works, however it will not work for all sets of initial consitions, or all values of ‘r’. Experiment with the initial conditions to see what works.
카테고리
도움말 센터 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!