# MATH 2250 # PROJECT 3: LAPLACE TRANSFORMS # MARCH 1999 # # Use a web browser such as netscape to get a copy of this project # from the 2250 Maple homepage # http://www.math.utah.edu/~korevaar/2250spring99.html and save it to # your home directory or personal computer, as usual. Then open it from # your Maple window as a ``Maple text'' file. You also need your # textbook at hand, in order to refer to specific pages and problems. # So far we've used Maple mostly as a numerical and visualization # tool, but it is also useful for symbolic work which you might not # associate with calculators. In this project we'll highlight its # Laplace transform capabilities. First we have to load the appropriate # library of supplementary commands: > with(inttrans): #this is a package of integral transform > #subroutines, including Laplace and Fourier transforms. > #to see the list of commands use a semicolon instead of > #a colon to end the ``with'' statement # If you've spent time trying to learn the various ways of finding # Laplace and inverse Laplace transforms, you'll appreciate the fact # that Maple does these things with ease. The commands are ``laplace'' # and ``invlaplace'' respectively. If you want more information about # these commands, use the ``topic search'' option under the ``help'' # button at the upper right of your menu bar. Of course, there is # value in knowing how to do Laplace and inverse Laplace transforms by # hand, but it's nice to know a machine can do them too. > laplace(t*exp(2*t),t,s); #compute the laplace transform > #the function t*exp(2*t), where ``t'' is the function > #variable, and ``s'' is the transform variable 1 -------- 2 (s - 2) > invlaplace(1/(s-2)^2,s,t); #compute the inverse laplace > #transform of the function 1/(s-2)^2, where s is the > #variable and t is the variable for the inverse laplace > #function. t exp(2 t) # Maple doesn't mind complication: > laplace(t^3*sin(3*t)*exp(-2*t),t,s); # Here's an inverse transform problem you might have used partial # fractions for, if you were doing it by hand: > invlaplace(s^3/((s^2 + 100)^2),s,t); -5 t sin(10 t) + cos(10 t) # You could even check your partial fractions work by having Maple do # the partial fractions step: > convert(s^3/((s^2 + 100)^2),parfrac,s); #convert s^3/((s^2 + 1)^2) > #into partial fractions, with respect to the variable ``s'' s s -100 ----------- + -------- 2 2 2 (s + 100) s + 100 # From the expression above you could quickly use a table to verify the # inverse transform which Maple computed in the previous line. # Maple is not quite God. For example, let's try #28 on page 417, # that is, find the Laplace transform of t*cos(k*t): > laplace(t*cos(k*t),t,s); cos(2 arctan(k/s)) ------------------ 2 2 s + k # If you're good with your trig identities you can verify that this does # equal what exercise 28 claims it equals, namely (s^2-k^2)/(s^2+k^2)^2. # Or you can use various commands to try to have Maple do the trig # identity work. There are a number of commands for manipulating # expressions (see ``Help'' for more info.) Here's some to try: > expand(%,trig); #expand the previous expression, using > #trig identities > normal(%); #put previous expression into ``normal'' form # That should give you the answer in the form the book claimed. # # Problem 1) Have Maple find the Laplace transforms for # 1a) page 406 #5 # 1b) page 424 #3 # # Problem 2) Have maple find the inverse Laplace transforms for # 2a) page 424 #22 # 2b) page 435 #40 # 2c) page 444 #10 Note: The unit step function with jump at t=a, # u(t-a) on page 403 of the text is denoted by Heaviside(t-a) in Maple, # after the engineer Oliver Heaviside who popularized it (see page 406). # Engineers sometimes also write it as ^1 (in studying strength of # materials, for example). # # You can use Maple to go through the Laplace Transform technique of # solving initial value problems. For example, consider Example 2 on # page 410: > restart:with(inttrans):with(plots): > deqtn:=diff(x(t),t$2) + 4*x(t)=sin(3*t); > #notice how to do second derivatives, > #the first deriv would be diff(x(t),t) > laplace(deqtn,t,s);#Take Laplace transform of > #both sides of the equation > subs(laplace(x(t),t,s)=X(s),%);#We're used to > #calling the Laplace transfrom X(s), > #so make that substitution into above equation > subs({x(0)=0,D(x)(0)=0},%);#plug the initial > #conditions into the previous equation > solve(%,X(s)); #solve for X(s) > convert(%,parfrac,s); #do partial fractions > invlaplace(%,s,t); > simplify(%); 3/10 sin(2 t) - 1/5 sin(3 t) # And there's the book's answer, done the Laplace transform way. If you # want to skip all the intermediate steps you can use DEtools: > with(DEtools): > dsolve({deqtn,x(0)=0,D(x)(0)=0},x(t),method=laplace); x(t) = 3/10 sin(2 t) - 1/5 sin(3 t) # 3a) Do page 425 # 39 using Maple. Show intermediate steps like we # did in the first part of the example above (i.e. don't just use # dsolve). If you want to keep using the same notation as in the # example you might want to restart. # 3b) Do page 425 #40 using Maple. Again, show the intermediate steps. # Then make the plot on page 425, using the Maple plotting package. To # deduce that the amplitude function A(t)=t*exp(-t/5) has its maximum at # t=5 seconds, you may do the Calculus by hand or you can use Maple. In # either case insert a textual explanation. # # Let's return to the study of resonance in the forced oscillator. # We know from chapter 3 that the undamped spring exhibits resonance # when the forcing function has angular frequence w equal to the natural # frequence w0=sqrt(k/m). In chapter 3 we only used forcing functions # of the form F0*cos(wt-c). Does the same resonance principle hold # relating the period of the forcing function to the natural period of # the spring, when the forcing function is not necessarily of the # special trigonometric form we studied in chapter 3? The answer (no) # to this question is quite interesting, and is explained most # effectively using the ideas of Fourier series, in chapter 9 of the # text. However, we can get a good feeling for the answer using Laplace # transform techniques. We'll use four periodic ``engineering # functions'' to make our study. # There are various ways to get the ``engineering functions'' such # as the square wave, triangle wave, sawtooth wave, and impulse wave. # Your Computing Projects book uses a numerically efficient method for # the first threee, in its project 31, pages 200-206. We will construct # them slightly differently, in the hope that the Laplace transforms can # be computed symbolically by Maple. We will pick a period, and then # make functions which are valid for twenty periods. (So then our # solutions also will be valid for twenty periods. That should be a # long enough time interval for us to understand the solution behavior.) > restart:with(inttrans):with(plots):with(DEtools): > deqtn:=diff(x(t),t$2) + x(t)=f(t); > #undamped forced oscillator with natural period > #2*Pi (natural angular frequency one). We > #use Engineering function f's, below > T:=2*Pi; #We will use T for the period, starting > #with natural period of the oscillator. You > #will vary it later. > squarewave:=t->1+2*sum((-1)^n*Heaviside(t-n*T/2),n=1..40); > sawtooth:=t->2*t/T-1 - 2*sum(Heaviside(t-n*T),n=1..20); > triwave:=t-> 2*t/T + > (4/T)*sum((-1)^n*(t-n*T/2)*Heaviside(t-n*T/2),n=1..40); > impulse:=t->sum(Dirac(t-n*T),n=1..20); > #see if you can figure out why these definitions work. > #Dirac is the name of the delta function, so Dirac(t-n*T) > #is a unit impulse at t=n*T > plot(squarewave(t),t=0..25*T); > plot(sawtooth(t),t=0..25*T); > plot(triwave(t),t=0..25*T); > plot(impulse(t),t=0..25*T); > #check that we made the waves right. Notice > #we only get 20 good periods # Your last plot will look empty, but that's because you can't # distinguish the graph of a ``function'' which is zero except at a # finite number of points and infinite at the others, from a picture of # the x-axis. But there's really something there, as evidenced by the # integration computation > int(impulse(t),t=(0.5*T)..4.5*T); > #four unit impulses in this interval, so integral > #should be 4! 4. # Now let's study resonance phenomena which occur with non-trig forcing # functions. Except for the impulse function we can use DEplot to see # the graphs of the solutions to the various forced oscillators. For # example, here's how to get a graph of the solution for the squarewave # forcing term: > f:=t->squarewave(t); > T:=2*Pi; #set f and the period > DEplot(deqtn,x(t),t=0..20*T,[[x(0)=0,D(x)(0)=0]],stepsize=.1, > linecolor=black); > #plot 20 periods of the solution, with zero initial data So it's clear we get resonance in this case, which we ``expected'' because the driving period was the same as the natural period. # Because DEplot uses numerical techniques (like Runge-Kutta) it is # no good for impulse forces. What we can do, however, is use # ``dsolve'' with the Laplace method, and then mouse the solution into # the plot command, as follows. After mousing in the solution function, # you need to put in the t-range, t=0..20*T in our case. > T:=2*Pi; #same period > f:=t->impulse(t); #impulse forcer > T := 2 Pi f := impulse > dsolve({deqtn,x(0)=0,D(x)(0)=0},x(t),method=laplace); x(t) = Heaviside(t - 2 Pi) sin(t) + Heaviside(t - 4 Pi) sin(t) + Heaviside(t - 6 Pi) sin(t) + Heaviside(t - 8 Pi) sin(t) + Heaviside(t - 10 Pi) sin(t) + Heaviside(t - 12 Pi) sin(t) + Heaviside(t - 14 Pi) sin(t) + Heaviside(t - 16 Pi) sin(t) + Heaviside(t - 18 Pi) sin(t) + Heaviside(t - 20 Pi) sin(t) + Heaviside(t - 22 Pi) sin(t) + Heaviside(t - 24 Pi) sin(t) + Heaviside(t - 26 Pi) sin(t) + Heaviside(t - 28 Pi) sin(t) + Heaviside(t - 30 Pi) sin(t) + Heaviside(t - 32 Pi) sin(t) + Heaviside(t - 34 Pi) sin(t) + Heaviside(t - 36 Pi) sin(t) + Heaviside(t - 38 Pi) sin(t) + Heaviside(t - 40 Pi) sin(t) > plot(Heaviside(t-2*Pi)*sin(t)+Heaviside(t-4*Pi)*sin(t)+Heaviside(t-6*P > i)*sin(t)+Heaviside(t-8*Pi)*sin(t)+Heaviside(t-10*Pi)*sin(t)+Heaviside > (t-12*Pi)*sin(t)+Heaviside(t-14*Pi)*sin(t)+Heaviside(t-16*Pi)*sin(t)+H > eaviside(t-18*Pi)*sin(t)+Heaviside(t-20*Pi)*sin(t)+Heaviside(t-22*Pi)* > sin(t)+Heaviside(t-24*Pi)*sin(t)+Heaviside(t-26*Pi)*sin(t)+Heaviside(t > -28*Pi)*sin(t)+Heaviside(t-30*Pi)*sin(t)+Heaviside(t-32*Pi)*sin(t)+Hea > viside(t-34*Pi)*sin(t)+Heaviside(t-36*Pi)*sin(t)+Heaviside(t-38*Pi)*si > n(t)+Heaviside(t-40*Pi)*sin(t),t=0..20*T,color=black); # Resonance again. In fact the solution formula shows that you add an # extra sin(t) every 2*Pi time units. # Notice, you can change the forcing function f or the period T and # then just re-run the DEplot or dsolve and plot commands, so now you # are set up to experiment. # 4a) Verify that ``sawtooth'' and ``triwave'' also induce resonance # with period T=2*Pi. (Show your work.) # 4b) Find which two of our four Engineering functions induce resonance # when the driving period is T=4*Pi. This could not happen with chapter # 3 forcing functions, since the natural period of the system is 2*Pi! # Do a thought experiment with the impulse function, where the # model is of a child on a swing being pushed by periodic impulses. You # clearly expect resonance if the period of the impulses is exactly the # natural period. If you apply an impulse exactly every second swing, # or every third swing, you still expect resonance! So you see, it is # possible to get resonance when the period of the forcing function is # ANY INTEGER MULTIPLE of the NATURAL PERIOD. In fact, these are the # only possible resonant periods for any periodic forcing function; this # fact seems intuitive for impulse functions if you think about pushing # the swing, since if your impulse period is not an integer multiple of # the natural one you expect your pushing effects to cancel out in the # long run. In some sense every periodic function is approximated by a # sum of many periodic impulse functions, so the general fact is # plausible. The precise explanation, however, relies on the Chapter 9 # concepts of Fourier series. Note too that a given type of f may not # cause resonance at every integer multiple of the natural period. In # fact we already know that the trig function forcing terms only cause # resonance at the natural frequency. This inducing of resonance at # FREQUENCIES which are INTEGER FRACTIONS of the NATURAL FREQUENCIES is # of concern in engineering. It relates to ``overtones'' in music as # well. # 4c) Make a table for our four Engineering functions, indicating # whether resonance is produced at periods 2*Pi, 4*Pi, 6*Pi, 8*Pi, # 10*Pi. Keep and label exactly one of your favorite plots with each # engineering function. Delete the rest. # 4d) Pick any period between 0.5*Pi and 9.5*Pi which is at least # 0.1*Pi away from the periods you studied in 4c), and verify that you # do NOT get resonance, for each of the four engineering functions. # Show all four plots. # Final note: In the copy of the project which you hand in, delete # material which is not important for your answers, in order to save # paper, and shrink your plots to a reasonable size. Be sure to provide # complete exposition of your work.