Homogeneous differential equation with dsolve => Warning: Unable to find explicit solution.
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Gabriel Martins
le 3 Mai 2021
Réponse apportée : Star Strider
le 3 Mai 2021
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 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 ]
>>
0 commentaires
Réponse acceptée
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)
odefcn = matlabFunction(VF, 'Vars',{x,Y})
[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.
0 commentaires
Plus de réponses (0)
Communautés
Plus de réponses dans Distance Learning Community
Voir également
Catégories
En savoir plus sur Equation Solving dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!