Homogeneous differential equation with dsolve => Warning: Unable to find explicit solution.

5 vues (au cours des 30 derniers jours)
Hey,
I would like to understand why I get this message "Warning: Unable to find explicit solution" when I try to get the ODE solution.
I'm following the steps in the Help Center - Solve Differential Equation.
I hope you can help me.
clear all; close all; clc;
syms y(x)
Dy = diff(y);
ODE = diff(y,x,2) == ( x^2 + y^2 ) / ( x*y ) ;
cond1 = y(0) == 3;
cond2 = Dy(0) == 0;
conds = [cond1, cond2];
ySol(x) = dsolve(ODE,conds);
ySol = simplify(ySol)
% Command Window
Warning: Unable to find explicit solution.
> In dsolve (line 201)
In ignore (line 12)
ySol(x) =
[ empty sym ]
>>

Réponse acceptée

Star Strider
Star Strider le 3 Mai 2021
The differential equation is nonlinear. There are only a few nonlinear differential equations that have analytical solutions. This is not one of them.
Try this instead —
syms y(x) x Y
Dy = diff(y);
ODE = diff(y,x,2) == ( x^2 + y^2 ) / ( x*y ) ;
cond1 = y(0) == 3;
cond2 = Dy(0) == 0;
[VF,Sbs] = odeToVectorField(ODE)
VF = 
Sbs = 
odefcn = matlabFunction(VF, 'Vars',{x,Y})
odefcn = function_handle with value:
@(x,Y)[Y(2);(Y(1).^2+x.^2)./(x.*Y(1))]
[x,y] = ode45(odefcn, [eps 10], [3 0]);
figure
plot(x,y,'-')
grid
xlabel('x')
ylabel('y')
legend(string(Sbs), 'Location','best')
The ‘tspan’ argument cannot begin at ‘x=0’ because in that situaiton, all except the initial values are NaN.

Plus de réponses (0)

Communautés

Plus de réponses dans  Distance Learning Community

Community Treasure Hunt

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

Start Hunting!

Translated by