Simplifying solution of a differential equation
Ältere Kommentare anzeigen
The most simplified version of ySol(t), the solution to the differential equation below, is 1.5*sin(2t+0.7297), but the output of the following code is in terms of exponential functions. Can someone explain how the output can be further simplified?
syms y(t) m k
Dy = diff(y,t); Dy2 = diff(y,t,2);
ode = m*Dy2 + k*y == 0;
cond = [y(0) == 1,Dy(0) == sqrt(5)];
ySol(t) = dsolve(ode,cond)
ySol(t) = simplify(ySol(t),'steps',500)
pretty(ySol(t))
4 Kommentare
Walter Roberson
am 14 Jan. 2021
Bearbeitet: Walter Roberson
am 14 Jan. 2021
Undefined variables k, m
Aleem Andrew
am 14 Jan. 2021
Walter Roberson
am 14 Jan. 2021
When m and k are symbolic, you get symbolic expressions for the coefficients, not numeric ones like you show as your desired output.
Aleem Andrew
am 14 Jan. 2021
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


