How to solve laplace transform for ODE with initial value condition
조회 수: 21 (최근 30일)
이전 댓글 표시
i have tried to solve this problem
with this code :
syms t y(t) Y(s) Dy0 a b y0
Dy1 = diff(y,t,1);
eqn = laplace(t*Dy1+ y == cos(t))
eqn = subs(eqn, {laplace(y(t), t, s), subs(diff(y(t), t), t, 0), y(0)},{Y(s), 0, 2})
eqn = isolate(eqn, Y)
but it did not work, i may used the code in improperr way but i am pretty sure that the prob. has an answer not as matlap programm responde that the equation has no solution..
any help i will apretiate
댓글 수: 0
답변 (1개)
Sulaymon Eshkabilov
2021년 11월 15일
Here is the corrected code:
syms t s y(t) Y(s)
Dy = diff(y,t);
EQN = t*Dy+y== cos(t);
LT = laplace(EQN, t, s);
LT = subs(LT, {laplace(y(t), t, s), y(0)},{Y(0), 2})
Y = solve(LT, Y)
disp('Solution is: ')
SOL = ilaplace(Y)
pretty(SOL)
% It does not have an analytical solution:
syms t y(t)
Dy = diff(y,t);
EQN = t*Dy+y== cos(t);
SOL = dsolve(EQN, y(0)==2)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!