Unformatted text preview:

Laplace Transform in MapleMth 256 March 7 2001Bent E. PetersenFilename: 256winter2001_laplace.mws> restart;> with(inttrans): with(plots):In addition to just computing Laplace and inverse Laplace transforms, Maple can apply the Laplace transform directly to a linear differential equation:> ode1:=diff(y(t),t,t)+4*y(t)=cos(t); := ode1 = + ∂∂2t2( )y t 4 ( )y t ( )cos t> Lap1:=laplace(ode1,t,s); := Lap1 = − + s ( ) − s ( )laplace , ,( )y t t s ( )y 0 ( )( )D y 0 4 ( )laplace , ,( )y t t ss + s21We can make the equation look comfortably familiar by introducing ( )Y t for the Laplace transform of the unknown function ( )y t .> Lp1:=subs(laplace(y(t),t,s)=Y(s),Lap1); := Lp1 = − + s ( ) − s ( )Y s ( )y 0 ( )( )D y 0 4 ( )Y ss + s21Now we let Maple do the algebra> solve(Lp1,Y(s)): Y(s):=%; := ( )Y s + + + + ( )y 0 s3s ( )y 0 ( )( )D y 0 s2( )( )D y 0 s + + s45 s24To solve the differential equation we can now take the inverse Laplace transform> soln1:=invlaplace(Y(s),s,t); := soln1 − + + + 13( )cos 2 t ( )y 0 ( )cos 2 t12( )( )D y 0 ( )sin 2 t13( )cos tPage 1Notice the solutions are conveniently paramterized by the initial values ( )y 0 and ( )( )D y 0 .Of course, if we just want to solve the differential equation we can do so directly:> init1:=y(0)=A,D(y)(0)=B; := init1 , = ( )y 0 A = ( )( )D y 0 B> soln1b:=dsolve({ode1,init1},y(t));soln1b ( )y t + 14( )sin t112( )sin 3 t ( )sin 2 t + 112( )cos 3 t14( )cos t ( )cos 2 t12B ( )sin 2 t + + = := − + 13A ( )cos 2 t + > subs(y(0)=A,D(y)(0)=B,soln1)-rhs(soln1b): simplify(%);0In spite of initial appearances the two solutions agree! The nice thing about the Laplace transform of course is that it correctly handles the case where the driving term has discontinuities. Let's look at a simple example.> ode2:=diff(y(t),t,t)-diff(y(t),t)+6*y(t)=Heaviside(t-1)-Heaviside(t-2); := ode2 = − + ∂∂2t2( )y t∂∂t( )y t 6 ( )y t − ( )Heaviside − t 1 ( )Heaviside − t 2> Lap2:=laplace(ode2,t,s);Lap2 := − − + + s ( ) − s ( )laplace , ,( )y t t s ( )y 0 ( )( )D y 0 s ( )laplace , ,( )y t t s ( )y 0 6 ( )laplace , ,( )y t t s = − e( )−sse( )−2 ssBefore we substitute ( )Y s we had best unassign it. Otherwise we will be substituting its previous value rather than just a new symbol for ( )laplace , ,( )y t t s .> unassign('Y(s)');> Lp2:=subs(laplace(y(t),t,s)=Y(s),Lap2); := Lp2 = − − + + s ( ) − s ( )Y s ( )y 0 ( )( )D y 0 s ( )Y s ( )y 0 6 ( )Y s − e( )−sse( )−2 ss> solve(Lp2,Y(s)): Y(s):=%;Page 2:= ( )Y s + − + − s2( )y 0 ( )( )D y 0 s s ( )y 0 e( )−se( )−2 ss ( ) − + s2s 6> soln2:=invlaplace(Y(s),s,t);soln2123( )y 0 e( ) / 1 2 t23sin1223 t ( )y 0 e( ) / 1 2 tcos1223 t− + := 223( )( )D y 0 e( ) / 1 2 t23sin1223 t16( )Heaviside − t 1 + + 1138( )Heaviside − t 1 e( ) − / 1 2 t / 1 223sin1223 ( ) − t 1 + 16( )Heaviside − t 1 e( ) − / 1 2 t / 1 2cos1223 ( ) − t 116( )Heaviside − t 2 − − 1138( )Heaviside − t 2 e( ) − / 1 2 t 123sin1223 ( ) − t 2 − 16( )Heaviside − t 2 e( ) − / 1 2 t 1cos1223 ( ) − t 2 + > exmp2:=subs(y(0)=0,D(y)(0)=0,soln2);exmp216( )Heaviside − t 11138( )Heaviside − t 1 e( ) − / 1 2 t / 1 223sin1223 ( ) − t 1 + := 16( )Heaviside − t 1 e( ) − / 1 2 t / 1 2cos1223 ( ) − t 116( )Heaviside − t 2 − − 1138( )Heaviside − t 2 e( ) − / 1 2 t 123sin1223 ( ) − t 2 − 16( )Heaviside − t 2 e( ) − / 1 2 t 1cos1223 ( ) − t 2 + > plot(exmp2,t=0..3,thickness=3,color=red);Page 3Be sure to check the Maple help facility for more information and examples.Note as mentioned at the beginning Maple can also be used just to compute transforms. Here's a couple of examples:> laplace(exp(at)*sin(omega*t-phi),t,s);−eat− + ( )cos φ ω + s2ω2( )sin φ s + s2ω2> invlaplace((2*s-3)/((s^2+4)^2*(s+1)),s,t);− + − − + 15e( )−t15( )cos 2 t380( )sin 2 t18t ( )cos 2 t14t ( )sin 2 tThat sure beats doing the algebra by hand!> Page


View Full Document

OSU MTH 256 - Laplace Transform in Maple

Download Laplace Transform in Maple
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Laplace Transform in Maple and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Laplace Transform in Maple 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?