Unable to find symbolic solution
6 ビュー (過去 30 日間)
古いコメントを表示
I'm getting this error when I'm running my code. "Unable to find symbolic solution". Can you please help me?
clear; syms y(x)
Dy = diff(y);
D2y = diff(y,2);
ode = y+((0.05*Dy)/y)-((0.5*D2y*x)/y)-(0.2/x)-(0.05/x) == 0;
ySol = dsolve(ode , y(80) == 0);
1 件のコメント
John D'Errico
2023 年 3 月 23 日
syms y(x)
Dy = diff(y);
D2y = diff(y,2);
ode = y+((0.05*Dy)/y)-((0.5*D2y*x)/y)-(0.2/x)-(0.05/x) == 0
Why do you think a solution exists in the first place? Anyway, you have supplied only one boundfary condition, and this is a second order ODE, so you could not even find a numerical solution.
採用された回答
Star Strider
2023 年 3 月 23 日
The system is nonlinear, so it quite likely does not have an analytic solutioon.
Try something like this—
syms y(x) x Y
Dy = diff(y);
D2y = diff(y,2);
ode = y+((0.05*Dy)/y)-((0.5*D2y*x)/y)-(0.2/x)-(0.05/x)
% ySol = dsolve(ode , y(80) == 0)
[VF,Subs] = odeToVectorField(ode)
odefcn = matlabFunction(VF, 'Vars',{x,Y})
tspan = [80 0]; % Begin Solution At 80 And Go Backwards
ic = [0 eps]; % Supply Appropriate Initial Conditions, Specifically For 'Dy'
[x,y] = ode45(odefcn, tspan, ic);
figure
plot(x, y)
grid
legend(string(Subs), 'Location','best')
.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!