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!