ODE Inverse Laplace Transformation Constants Error

2 次查看(过去 30 天)
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 个评论
Rik
Rik 2020-11-2
Question originally posted by Ri Eld (restored from Google cache):
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!

请先登录,再进行评论。

回答(1 个)

Alan Stevens
Alan Stevens 2020-8-10
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.

类别

Help CenterFile Exchange 中查找有关 Equation Solving 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by