Laplace Transforms with Maple
| > | with(inttrans); # Loads a package of commands. |
![]()
| > | u3:= x-> Heaviside(x-3); |
| > | plot(u3(x),x=0..7,y=-1..3,discont=true,thickness=3); |
![[Plot]](images/laplace_4.gif)
| > | laplace(u3(t),t,s); # FInd the laplace transform. t is the orgonial variable, s is the new new. |
| > | invlaplace(exp(-3*s)/s,s,t); # FInd the inverse Laplace fransform! |
Next example.
| > | f:= t -> sin(t)*Heaviside(t) - sin(t)*Heaviside(t-Pi)+ Heaviside(t-4)-Heaviside(t-6); |
| > | plot(f(t),t=0..7,y=-1..3,discont=true,thickness=3); |
![[Plot]](images/laplace_8.gif)
| > | laplace(f(t),t,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; |
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); |
| > | plot(Q(t),t=0..20,y=0..0.50,color=blue,thickness=3); |
![[Plot]](images/laplace_14.gif)
| > | evalf(Q(10)); |
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); |
![]()


![]()
![]()
Yuck!
| > |