wrong differential equation solution
Afficher commentaires plus anciens
Hello guys, I have been struggling with a differential equation. I solved it manually, and then double-checked my answer both manually and with Wolfram Alpha, and the answer was right. However, matlab seems to give another answer. The two answers are supposed to be the same, just written in different forms. However, after I copied the Wolfram Alpha answer to matlab, I found out that they are actually not equal.Did I do anything wrong? Thank you.
2 commentaires
madhan ravi
le 31 Juil 2020
Share the actual code as text instead of pictures.
Graciano Ding
le 31 Juil 2020
Modifié(e) : Graciano Ding
le 31 Juil 2020
Réponse acceptée
Plus de réponses (1)
madhan ravi
le 31 Juil 2020
a1 = matlabFunction(simplify(sol));
a = matlabFunction((1/80)*(36*exp(-t)-35*cos(t)-cos(3*t)+125*sin(t)-3*sin(3*t)));
t = linspace(0, 2*pi);
all(abs(a1(t) - a(t)) < 1e-2) % to check if they yield the same results
1 commentaire
Graciano Ding
le 1 Août 2020
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!