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
2020 年 11 月 2 日
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
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Equation Solving についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!