laplace.mw

Laplace Transforms with Maple

> with(inttrans); # Loads a package of commands.

[addtable, fourier, fouriercos, fouriersin, hankel, hilbert, invfourier, invhilbert, invlaplace, invmellin, laplace, mellin, savetable][addtable, fourier, fouriercos, fouriersin, hankel, hilbert, invfourier, invhilbert, invlaplace, invmellin, laplace, mellin, savetable]

> u3:= x-> Heaviside(x-3);

u3 := proc (x) options operator, arrow; Heaviside(x-3) end proc

> plot(u3(x),x=0..7,y=-1..3,discont=true,thickness=3);

[Plot]

> laplace(u3(t),t,s); # FInd the laplace transform. t is the orgonial variable, s is the new new.

exp(-3*s)/s

> invlaplace(exp(-3*s)/s,s,t); # FInd the inverse Laplace fransform!

Heaviside(t-3)

Next example.

> f:= t -> sin(t)*Heaviside(t) - sin(t)*Heaviside(t-Pi)+ Heaviside(t-4)-Heaviside(t-6);

f := proc (t) options operator, arrow; sin(t)*Heaviside(t)-sin(t)*Heaviside(t-Pi)+Heaviside(t-4)-Heaviside(t-6) end proc

> plot(f(t),t=0..7,y=-1..3,discont=true,thickness=3);

[Plot]

> laplace(f(t),t,s);

(1+exp(-s*Pi))/(s^2+1)+(exp(-4*s)-exp(-6*s))/s

Now we consider an LRC circuit. Recall the diffeq for the charge on the capacitor is LQ''+RQ'+(1/C)Q = E(t). Will ask what will Q(t) be if we use f(t) above as the external applied voltage. We assume Q'(0)=Q(0)=0. Here are the values for L, R and C.

> L:=1;C:=1;R:=10;

L := 1

C := 1

R := 10

Then we solve Lap(LQ''+RQ'+(1/C)Q + Lap(f(t)) for Lap(Q). We get Lap(Q) = Lap(f)/(Ls^2+Rs+1/C). Then Q(t) = Inverse Lap (Lap Q).

> Q:= t->invlaplace(((1+exp(-s*Pi))/(s^2+1)+(exp(-4*s)-exp(-6*s))/s)/(L*s^2+R*s+1/C),s,t);

Q := proc (t) options operator, arrow; invlaplace(((1+exp(-s*Pi))/(s^2+1)+(exp(-4*s)-exp(-6*s))/s)/(L*s^2+R*s+1/C), s, t) end proc

> plot(Q(t),t=0..20,y=0..0.50,color=blue,thickness=3);

[Plot]

> evalf(Q(10));

.2107079534

Let's see what the formula for Q(t) is.

> invlaplace(((1+exp(-s*Pi))/(s^2+1)+(exp(-4*s)-exp(-6*s))/s)/(L*s^2+R*s+1/C),s,t);

-1/10*cos(t)+1/24*(-24-exp(-(5+2*6^(1/2))*(t-6))*(-12+5*6^(1/2))+exp((-5+2*6^(1/2))*(t-6))*(12+5*6^(1/2)))*Heaviside(t-6)+1/24*(24-exp((-5+2*6^(1/2))*(t-4))*(12+5*6^(1/2))+exp((-2*6^(1/2)-5)*(-5*t*(5+...-1/10*cos(t)+1/24*(-24-exp(-(5+2*6^(1/2))*(t-6))*(-12+5*6^(1/2))+exp((-5+2*6^(1/2))*(t-6))*(12+5*6^(1/2)))*Heaviside(t-6)+1/24*(24-exp((-5+2*6^(1/2))*(t-4))*(12+5*6^(1/2))+exp((-2*6^(1/2)-5)*(-5*t*(5+...-1/10*cos(t)+1/24*(-24-exp(-(5+2*6^(1/2))*(t-6))*(-12+5*6^(1/2))+exp((-5+2*6^(1/2))*(t-6))*(12+5*6^(1/2)))*Heaviside(t-6)+1/24*(24-exp((-5+2*6^(1/2))*(t-4))*(12+5*6^(1/2))+exp((-2*6^(1/2)-5)*(-5*t*(5+...-1/10*cos(t)+1/24*(-24-exp(-(5+2*6^(1/2))*(t-6))*(-12+5*6^(1/2))+exp((-5+2*6^(1/2))*(t-6))*(12+5*6^(1/2)))*Heaviside(t-6)+1/24*(24-exp((-5+2*6^(1/2))*(t-4))*(12+5*6^(1/2))+exp((-2*6^(1/2)-5)*(-5*t*(5+...-1/10*cos(t)+1/24*(-24-exp(-(5+2*6^(1/2))*(t-6))*(-12+5*6^(1/2))+exp((-5+2*6^(1/2))*(t-6))*(12+5*6^(1/2)))*Heaviside(t-6)+1/24*(24-exp((-5+2*6^(1/2))*(t-4))*(12+5*6^(1/2))+exp((-2*6^(1/2)-5)*(-5*t*(5+...-1/10*cos(t)+1/24*(-24-exp(-(5+2*6^(1/2))*(t-6))*(-12+5*6^(1/2))+exp((-5+2*6^(1/2))*(t-6))*(12+5*6^(1/2)))*Heaviside(t-6)+1/24*(24-exp((-5+2*6^(1/2))*(t-4))*(12+5*6^(1/2))+exp((-2*6^(1/2)-5)*(-5*t*(5+...

Yuck!

>