ODE Inverse Laplace Transformation Constants Error
Mostrar comentarios más antiguos
Hey guys! I'm trying to use matlab to solve an ODE with the following IC's: y(0) = 2, y'(0) = 0 and the function u(t) = 3*exp(-2*t). The ODE is 3*y''+12*y'+9*y = 9*u'+14*u(t). The code I used in matlab is as follows:
clear; clc; close all;
syms u(t) y(t) s
Dy = diff(y);
u(t) = 3*exp(-2*t)
ode1 = 3*diff(diff(y))+12*diff(y)+9*y == 9*diff(u)+14*u
cond1 = y(0) == 2;
cond2 = Dy(0) == 0;
conds = [cond1 cond2]
ySol1 = dsolve(ode1, conds)
The function that is returned is exp(-3*t)*(exp(2*t)+4*exp(t)-3) when it should be returning (11/2)*exp(-t)+4*exp(-2*t)-(15/2)*exp(-3*t). The constants for the partital fraction decomposition seem to be wrong. What could the issue be with my code? I'm using it to double check my handwork for a dyanmic systems modeling class. Thanks in advance for any help!
2 comentarios
Rik
el 2 de Nov. de 2020
ODE Inverse Laplace Transformation Constants Error
Hey guys! I'm trying to use matlab to solve an ODE with the following IC's: y(0) = 2, y'(0) = 0 and the function u(t) = 3*exp(-2*t). The ODE is 3*y''+12*y'+9*y = 9*u'+14*u(t). The code I used in matlab is as follows:
clear; clc; close all;
syms u(t) y(t) s
Dy = diff(y);
u(t) = 3*exp(-2*t)
ode1 = 3*diff(diff(y))+12*diff(y)+9*y == 9*diff(u)+14*u
cond1 = y(0) == 2;
cond2 = Dy(0) == 0;
conds = [cond1 cond2]
ySol1 = dsolve(ode1, conds)
The function that is returned is exp(-3*t)*(exp(2*t)+4*exp(t)-3) when it should be returning (11/2)*exp(-t)+4*exp(-2*t)-(15/2)*exp(-3*t). The constants for the partital fraction decomposition seem to be wrong. What could the issue be with my code? I'm using it to double check my handwork for a dyanmic systems modeling class. Thanks in advance for any help!
Rena Berman
el 7 de Mayo de 2021
(Answers Dev) Restored edit
Respuestas (1)
Alan Stevens
el 10 de Ag. de 2020
0 votos
The solution you think is correct does not satisfy the condition y`(0) = 0. It gives y`(0) = 9.
MATLAB's solution satisfies both initial conditions.
Categorías
Más información sobre Debugging and Improving Code en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!