# Laplace Transform # # What is a Laplace transform? # Caveat: This worksheet contains graphs, which are stripped out in the # Maple text version. It is strongly recommended that you read it in the # pretty print form by downloading it into Maple. # # The Laplace transform is an integral transform. It changes a function # f(t) into a related function F(s), called the Laplace transform of # f(t). In the process of transforming functions, it also changes # differential equations into algebraic equations. One can then solve # the algebraic equations and take the inverse Laplace transform of the # algebraic answer to get the solution to a homogeneous or # non-homogeneous initial value problem, including even problems with # discontinuous inputs. # # How does one compute the Laplace transform of a function f(t)? # The formal definition of the Laplace transform is > F(s)=Int(exp(-s*t)*f(t),t=0..infinity); infinity / /{ 0 t < 0 \ | |{ | | |{ 1 t < 2 | F(s) = | exp(-s t) |{ |(t) dt | |{ 2 | | |{ t - 4 t t < 5 | | |{ | / \{ 0 otherwise/ 0 # This is an improper integral, and will only converge to a finite # answer if appropriate assumptions are made on the value of s and the # rate at which f(t) grows. The assumptions that are necessary will # become apparent when one tries to evaluate the improper integral by # taking > Limit(Int(exp(-s*t)*f(t),t=0..A),A=infinity); A / /{ 0 t < 0 \ | |{ | | |{ 1 t < 2 | lim | exp(-s t) |{ |(t) dt A -> infinity | |{ 2 | | |{ t - 4 t t < 5 | | |{ | / \{ 0 otherwise/ 0 # One can always try to compute the Laplace transform from the integral # definition. Such an approach may be useful when the function f(t) is # defined in pieces. One can also use the Maple commands # laplace(f(t),t,s) and invlaplace(F(s),s,t) in the inttrans package. # However, the classical approach used by generations of engineers is to # use five properties of the Laplace transform and a short memorized # table of Laplace transforms of special functions (p. 380). # # What are some properties of the Laplace transform? # There is a Maple worksheet of worked problems on the web to enable you # to practice using the properties of the Laplace transform to go in and # out of "s land". This material will be on Monday's exam. # # Since the Laplace transform is defined by an integral, the Laplace # operator is linear. # # To take the Laplace of a sum, we add the Laplace transforms of the # terms. To take the Lapace of a scalar multiple, we Laplace the # function, then multiply afterwards by the constant. # # Two properties relate differentiation and multiplication. # # #1. Differentiation by t corresponds to multiplication by s. # L( y ' (t) ) = s L( y(t) ) - y(0). # # This property is why the Laplace transform of a differential equation # is an algebraic equation involving a multiplication by s. # # #2. Multiplication by t corresponds to differentiation by s. # L ( t y(t) ) = - d/ds L (y(t)) # # If f(t) is in the table, but t f(t) is not, then we can compute the # Laplace of t f(t) by taking the Laplace value in the table and # differentiating by s. # # Other properties relate multiplication by exponentials to translation. # # The graph of > (x-1)^2;# is a parabola, just like > x^2;# , but is has been translated right by one. When we replace s by # s-c, we are translating the graph. # # #3. Multiplication by > exp(c*t);# translates by c in the s domain. # # L ( > exp(c*t);# f(t) ) = L (f(t)) (s-c) # # If f(t) is in the table, but > exp(t)*f(t);# i s not, then we can find the Laplace transform of # f(t) and replace the s by s-c. # #4. Translation by c in the t domain multiplies by > exp(-c*s);# . # L ( Heaviside(t-c) f(t-c) ) = > exp(-c*s);# L( Heaviside(t) f(t) ) # # When we go backwards through the table for a given transform F(s), we # need always write not just f(t), but f(t) Heaviside(t), where # Heaviside(t) is the unit step function function which is zero if t<0 # and one if t>0. # # > plot(Heaviside(t),t=-1..3,scaling=constrained, thickness=3); # (The difference between f(t) and Heaviside(t) is that the two # functions differ to the left of zero. For example, sin(t) wiggles # forever going to the left, while sin(t) Heaviside(t) is clamped at t=0 # and held # at the constant value 0 to its left. Both functions have the same # Laplace transform since the Laplace integral starts at t = 0, so the # integral never sees the fact that they differ before t = 0.) ( Note: # I have shifted the cut off version of sin just a tad to the right so # you can discern its behavior.) # > plot([sin(t),sin(t-1/40)*Heaviside(t-1/40)],t=-1..3,color=[red,blue],t > hickness=3); # # Note that when f(t) Heaviside(t) is shifted right by c, the result is # f(t-c) Heaviside(t-c). (Think: if the boy doesn't pull the mass until # after one second, then the mass will not bob until after one second.) > plot([sin(t)*Heaviside(t),sin(t-1)*Heaviside(t-1)],t=-1..3,color=[red, > blue],scaling=constrained,thickness=3); # In addition, we have the convolution theorem. # # #5. The convolution of two functions is a way of "multiplying" two # functions of t to get another function of t. (The * notation here is # not Maple's multiplication symbol. It is the standard mathematical # symbol for convolving two functions.) # ( f(t) * g(t) ) = > Int(f(t-v)*g(v),v = 0 .. t);# # Theorem: The Laplace transform of the convolution product of functions # of t is the ordinary product of the Laplace transforms. # L ( f(t) * g(t) ) = F(s) G(s) # # Convolution comes up naturally in other situations, such as # probability theory. # # Something Old, Something New, ... # A function defined in pieces can be written in terms of Heaviside # funtions. The trick is to assume that the piecewise function is always # zero to the left of t = 0. (It might as well be, for all that the # Laplace transform knows, since the integral starts at t = 0.) > f:=piecewise(t<0,0,t<2,1,t<5,t^2-4*t,0); { 0 t < 0 { { 1 t < 2 f := { { 2 { t - 4 t t < 5 { { 0 otherwise > plot(f,t=-1..6,scaling=constrained,thickness=3,discont=true); # The trick is (new - old) Heaviside(t - transition) > (1-0)*Heaviside(t-0)+((t^2-4*t)-1)*Heaviside(t-2)+(0-(t^2-4*t))*Heavis > ide(t-5); 2 Heaviside(t) + (t - 4 t - 1) Heaviside(t - 2) 2 + (-t + 4 t) Heaviside(-5 + t) > plot(%,t=-1..6,scaling=constrained, thickness=3,discont=true); # Similarly, we can convert a sum of Heavisides into a piecewise # function. Consider the function # 1*Heaviside(t)+(t^2-4*t-1)*Heaviside(-2+t)+(-t^2+4*t)*Heaviside(-5+t). # The wake up times are t = 0, t = 2, and t = 5. # # To the left of t = 0, all the Heaviside functions are 0, and zero # times anything is zero, so the sum is 0. # # After t = 0 but before t = 2, the first Heaviside wakes up and we get # 1*1 = 1. # # After t = 2 but before t = 5, two of the Heavisides are awake and take # the value 1, so the sum is 1*1 + (t^2-4*t-1)*1 = 1 + (t^2-4*t-1) = # t^2-4*t.. # # After t = 5, all three Heavisides are awake and take the value 1, so # the sum is 1*1 + (t^2-4*t-1)*1 +(-t^2+4*t)*1 = 1 + (t^2-4*t-1) + # (-t^2+4*t) = 0. # # Look closely and you will see a telescoping sum. # # Solving a nonhomogeneous initial value problem using the Laplace # transform: four easy steps. > diffeq:=diff(y(t),t)=2*y(t); > inits:=y(0)=3; d diffeq := -- y(t) = 2 y(t) dt inits := y(0) = 3 # Take the Laplace transform of both sides of the equation. (Note the # use of linearity and the derivative by t rule.)) > with(inttrans): > laplace(diffeq,t,s); s laplace(y(t), t, s) - y(0) = 2 laplace(y(t), t, s) # Substitute in the initial values. > subs(inits,%); s laplace(y(t), t, s) - 3 = 2 laplace(y(t), t, s) # This is an algebraic equation - there are no longer any derivatives. # Solve for laplace(y(t),t,s). This is the Laplace transform of the # solution to the initial value problem > solve(%,laplace(y(t),t,s)); 3 ----- s - 2 # Use the inverse Laplace transform. > sol:=y(t)=invlaplace(%,s,t); sol := y(t) = 3 exp(2 t) # # In search of simple fractions > diffeq:=diff(y(t),t$2)+y(t)=sin(2*t); > inits:=y(0)=2,D(y)(0)=1; / 2 \ |d | diffeq := |--- y(t)| + y(t) = sin(2 t) | 2 | \dt / inits := y(0) = 2, D(y)(0) = 1 > with(inttrans): > laplace(diffeq,t,s); s (s laplace(y(t), t, s) - y(0)) - D(y)(0) + laplace(y(t), t, s) = 2 ------ 2 s + 4 > subs(inits,%); 2 s (s laplace(y(t), t, s) - 2) - 1 + laplace(y(t), t, s) = ------ 2 s + 4 > solve(%,laplace(y(t),t,s)); 3 2 2 s + 8 s + s + 6 ------------------- 4 2 s + 5 s + 4 # We need to find the inverse Laplace transform. This is easy if one has # the invlaplace command. However, if one wants to use the table on page # 380, there is a problem, since all the fractions in the table are # simple. How does one break a complicated fraction like the above into # simple fractions? # # Use the method of partial fractions which we used in Math 152 to # integrate complicated rational funtions. > convert(%,parfrac,s); 5 + 6 s 2 ---------- - ---------- 2 2 3 (s + 1) 3 (s + 4) # Now put each part of the numerator over its own denominator. > expand(%); 5 2 s 2 ---------- + ------ - ---------- 2 2 2 3 (s + 1) s + 1 3 (s + 4) # Look in the table on p. 380 and you will be able to identify the # inverse Laplace entry without using the invlaplace comand. > sol:=y(t)=invlaplace(%,s,t); sol := y(t) = 5/3 sin(t) + 2 cos(t) - 1/3 sin(2 t) # # What is 3.5 factorial? # It says in the table on page 380 that the Laplace transform of > t^n;# is > n!/(s^(n+1));# . The n! is a product of all the integers from 1 up # to n. But what is the Laplace transform of > t^(7/2);# ? > laplace(t^(7/2),t,s); 1/2 105 Pi --------- 9/2 16 s # The power of s is clear, since n = 7/2, so n + 1 = 9/2. But where # did the other part come from? # # The gamma function > Gamma(t) = Int(exp(-u)*u^(t-1),u = 0 .. infinity);# is an improper # intergral that converges for t > 0. When n is an integer, then # GAMMA(n+1) = n!. However, the Gamma function not only makes sense for # positive integers, it also makes sense between the integers, although # it won't give integer answers there. By analogy with the formula in # the table, the numerator should be (7 /2)!, ie., GAMMA(9/2); and it # is! > GAMMA(9/2); 1/2 105 Pi --------- 16 # # Wave Train # Electrical engineers will immediately recognize the graph of # Heaviside(t) - Heaviside(t-1). > plot(Heaviside(t)-Heaviside(t-1),t=0..2,discont=true,scaling=constrain > ed,thickness=3); # This is the well known "square" wave. # # However, we usually see not just one square wave, but a whole "train" # of these pulses. > W:=Sum(Heaviside(t-2*j)-Heaviside(t-(2*j+1)),j=0..5); > plot(W,t=0..10,scaling=constrained,thickness=3); 5 ----- \ W := ) (Heaviside(t - 2 j) - Heaviside(t - 2 j - 1)) / ----- j = 0 # An astute observer would note that this is a square wave, plus a # square wave shifted by 2, plus a square wave shifted by 4, plus a # square wave shifted by 6, plus ... # Since translation of a function of t right by 2 is done by # multiplying by > exp(-2*s);# , one would expect that the Laplace transform of a square # wave train would consist of the Laplace transform of a single square # wave plus the same thing multiplied by > exp(-2*s);# , plus the same thing multiplied by > exp(-4*s);# , plus the same thing multiplied by > exp(-6*s);# , ... > laplace(Heaviside(t)-Heaviside(t-1),t,s); > LS:=simplify(%); exp(-s) 1/s - ------- s -1 + exp(-s) LS := - ------------ s > laplace(W,t,s); > simplify(%); 5 ----- \ ) (laplace(Heaviside(t - 2 j), t, s) / ----- j = 0 - laplace(Heaviside(t - 2 j - 1), t, s)) 5 ----- \ ) (exp(-2 s j) - exp(-s (2 j + 1))) / ----- j = 0 --------------------------------------- s # This is just LS ( 1 + > exp(-2*s);# + > exp(-4*s);# + > exp(-6*s);# + > exp(-8*s);# + > exp(-10*s);# ). The second factor is the start of a geometric series # in powers of > lambda = exp(-2*s);# , and we know that the sum of such an infinite # series is > 1/(1-lambda);# . Therefore, the Laplace transform of the infinite # square wave train is LS ( > 1/(1-exp(2*s));# ).