Unable to find symbolic solution

조회 수: 5 (최근 30일)
Fatemeh
Fatemeh 2023년 3월 23일
댓글: John D'Errico 2023년 3월 23일
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
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
ode(x) = 
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
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)
ode(x) = 
% ySol = dsolve(ode , y(80) == 0)
[VF,Subs] = odeToVectorField(ode)
VF = 
Subs = 
odefcn = matlabFunction(VF, 'Vars',{x,Y})
odefcn = function_handle with value:
@(x,Y)[Y(2);(1.0./x.^2.*(x.*Y(2)-Y(1).*5.0+x.*Y(1).^2.*2.0e+1))./1.0e+1]
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개)

카테고리

Help CenterFile Exchange에서 Equation Solving에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by