MATLAB: How to showe laplace answer

laplaceMATLAB

clear;clc;
syms s t Y y(t);
DE=diff(y(t),t,2)+4*diff(y(t),t)+3*y(t)
LL=laplace(DE)
LL = 4*s*laplace(y(t), t, s) – D(y)(0) – 4*y(0) – s*y(0) + s^2*laplace(y(t), t, s) + 3*laplace(y(t), t, s)

Best Answer

Try this:
syms s t Y(s) y(t) Dy(t)
DE=diff(y(t),t,2)+4*diff(y(t),t)+3*y(t);
LL=laplace(DE);
LL = subs(LL, {laplace(y(t), t, s), subs(diff(y(t), t), t, 0)},{Y(s),Dy(0)})
producing:
LL =
3*Y(s) - 4*y(0) - Dy(0) - s*y(0) + 4*s*Y(s) + s^2*Y(s)
.