dsolve function returning empty sum

2 vues (au cours des 30 derniers jours)
Raghuraman S
Raghuraman S le 10 Mar 2019
Commenté : Raghuraman S le 10 Mar 2019
Following is the code to solve ode 2nd order ODE d^2y/dt^2+y=0; y(0)=1; y'(0)=0;
I find that the following code works
dsolve('D2y+y=0','y(0)=1','Dy(0)=0')
and it does not work when following code is executed(very equivalent of above code), returns empty sum
syms y(t)
eqn= diff(y,t,2)+ y ==0;
dsolve(eqn,'y(0)=1','Dy(0)=0')
Any idea, sure I did not understand something.
  2 commentaires
madhan ravi
madhan ravi le 10 Mar 2019
which version of matlab are you using?
Raghuraman S
Raghuraman S le 10 Mar 2019
Hi 2018b

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 10 Mar 2019
syms y(t)
dy = diff(y,t);
eqn = diff(y, t, 2) + y == 0;
dsolve(eqn, y(0)==1, dy(0)==0)
  1 commentaire
Raghuraman S
Raghuraman S le 10 Mar 2019
Thank you , it works.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by