second order differential Equation
Afficher commentaires plus anciens
Hello everyone
i have been trying to solve laplace transforms for second order differential equation: y''(t) - 6 * y'(t) + 9 * y(t) = 3 * sinh(t), y(0)=1, y'(0)=1 by Matlab to check with my hard calculation's answer which is y(t) = ((3/8) * e^t) - ((3/32) * e^-t) + ((23/32) * e^3t) - ((13/8) * t * e^3t). However it gave a warming in line 121 and i didnt really understand how to fix it properly. If anyone has idea, please let me know.
Thank you

Réponses (1)
Star Strider
le 7 Oct 2020
The symbolic Math Toolbox no longer uses strings. That threq the warning.
For the rest:
% % y''(t) - 6 * y'(t) + 9 * y(t) = 3 * sinh(t), y(0)=1
syms s t y(t) Y(s) Dy0
eqn = diff(y,2) -6*diff(y) + 9*y == 3*sinh(t); % Time-Domain Equation
Eqn = laplace(eqn) % ‘s’-Domain Equation
Eqn = subs(Eqn,{laplace(y(t), t, s), y(0), subs(diff(y(t), t), t, 0)}, {Y(s), 1, Dy0}) % Substitute To Create Readable Expression
Eqn = simplify(Eqn, 'Steps', 250) % Simplify
Ys = isolate(Eqn, Y) % ‘Solve’ For ‘Y(s)’
produces:
Ys =
Y(s) == -(Dy0 + s - Dy0*s^2 + 6*s^2 - s^3 - 9)/(s^4 - 6*s^3 + 8*s^2 + 6*s - 9)
that in LaTeX is:

.
Catégories
En savoir plus sur Symbolic Math Toolbox 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!