ch4_5.mw


Session 4.5 Using Laplace Transforms on a Differential Equation

> restart;

> with(inttrans):

> de:=D(D(y))(t)-y(t);

Define the differntial equation

de := `@@`(D, 2)(y)(t)-y(t)

> Fs:=laplace(de=sin(a*t), t, s);

Transform the equality with Laplace Transform

Fs := s^2*laplace(y(t), t, s)-D(y)(0)-s*y(0)-laplace(y(t), t, s) = a/(s^2+a^2)

> ys:=solve(Fs,laplace(y(t),t,s));

Solve the function with the laplace transform as the variable.

ys := (D(y)(0)*s^2+D(y)(0)*a^2+s^3*y(0)+s*y(0)*a^2+a)/(s^4+s^2*a^2-s^2-a^2)

> y(0):=1;D(y)(0):=0;

y(0) := 1

D(y)(0) := 0

> yt:=invlaplace(ys,s,t);

Invert the solution

yt := (a*sinh(t)-sin(a*t))/(a^2+1)+cosh(t)

Thus, all that is required is a little simplification...

> yt:=unapply(yt,t);

yt := proc (t) options operator, arrow; (a*sinh(t)-sin(a*t))/(a^2+1)+cosh(t) end proc

> simplify(yt(0));

1

> simplify(D(yt)(0));

0

> a:=0.5;

a := .5

> plot(yt(t),t=0...2);

[Plot]

>