{VERSION 2 3 "IBM INTEL NT" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "" -1 256 "" 1 14 74 0 254 0 0 1 0 0 0 0 0 0 0 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Helvetica" 0 14 0 0 0 0 2 2 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Font 0" -1 256 1 {CSTYLE "" -1 -1 "Helvetica" 0 12 0 0 0 0 2 2 2 0 0 0 0 0 0 } 0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Font 2" -1 257 1 {CSTYLE "" -1 -1 "Ohlfs" 0 12 0 0 0 0 2 2 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT -1 34 " \+ " }{TEXT 256 45 " Advanced Tricks and Application with Syste ms" }}{PARA 0 "" 0 "" {TEXT -1 78 " \+ file: laplace_ode2.mws" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 210 "Here are some advanced tricks \+ for using Laplace\ntransforms. Frist some definitions. Since we will \+ always be\nusing s and t for the variables we will set up some shortha nd calls...\nthe details are not important." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "restart;with(inttrans);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "L := proc(X) laplace(X,t,s) end:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 38 "invL := proc(X) invlaplace(X,s,t) end:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "alias(u=Heaviside,Y(s)=L(y(t ))):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "pfd := proc(X) fron tend(convert,[X,parfrac,s]) end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 38 "We now test out our new definitions..." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "L(u(t-3)*y(t-3));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "L(u(t-3)*(t-3)^2*sin(t-3)+exp(4*(t-4))*u(t-4));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 70 "eqn1 := (D@@2)(y)(t)+y(t)=u( t-3)*(t-3)^2*sin(t-3)+exp(4*(t-4))*u(t-4);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 8 "L(eqn1);" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 41 "W e now insert the IC for y(0) and D(y)(0)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "subs(y(0)=3,D(y)(0)=7,\");" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "solve(\",Y(s));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "pfd(\");" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 94 "We \+ should be able to invert this on sight,\nbut just in case you can't Ma ple can do it for you:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "invL(\"); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 28 "Now let's plot the result... " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "plot(\",t=0..6);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 244 "Now let's use Laplace transforms to solv e systems of ODE's.\nWe assume that the unknown functions will be\nx(t ),y(t) and z(t). We need some more aliases to keep things clean.\nYou can start from this point without executing the previous commands." } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "restart;with(inttrans):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "L := proc(XX) laplace(XX,t,s ) end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "invL := proc(XX) \+ invlaplace(XX,s,t) end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 70 " alias(delta=Dirac,u=Heaviside,X(s)=L(x(t)),Y(s)=L(y(t)),Z(s)=L(z(t))): " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 53 "pfd := proc(XX) fronten d(convert,[XX,parfrac,s]) end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 47 "Now let's set up a system that we want to solve" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 74 "odesys1 := \{D(x)(t)=x(t)+y(t),D(y)(t)=x(t)+y(t),D(z) (t)=y(t)+z(t)+exp(t)\};" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 37 "and \+ take the Laplace transform of it" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "L(odesys1);" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 77 "Let's set so me Initial Conditions to remove the unknowns x(0), y(0) and z(0):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "subs(x(0)=1,y(0)=3,z(0)=-2,\");" }} }{EXCHG {PARA 256 "" 0 "" {TEXT -1 41 "and then solve for the Laplace \+ transforms" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "laplace_sol := solve( \",\{X(s),Y(s),Z(s)\});" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 147 "It \+ is a little hard to apply pfd to only the rhs, so we need this\ncompli cated command to do it\nand keep the general form of laplace_sol the s ame..." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 90 "laplace_sol := \{seq(lhs( laplace_sol[i])=pfd(rhs(laplace_sol[i])),i=1..nops(laplace_sol))\};" } }}{EXCHG {PARA 256 "" 0 "" {TEXT -1 127 "You should be able to read of f the answer from the above,\nbut in case it is too difficult, you can always use\nthe invL command:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "i nvL(laplace_sol);" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 52 "Now let's \+ do a problem with the Dirac Delta function" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "ode2 := (D@@2)(x)(t) +9*x(t)=3*Dirac(t-Pi);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "L(\");" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 25 "subs(x(0)=1,D(x)(0)=0,\");" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "solve(\",\{X(s)\});" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 8 "invL(\");" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "plot(rhs(\"[1]),t=0..6);" }}}{EXCHG {PARA 256 "" 0 " " {TEXT -1 66 "Note that the inverse Laplace transform of 1 is the Dir ac function" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "invL(1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "invL(exp(-5*s)*s^2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 77 "Here delta(2,t-5) is the second derivative of the impulse funct ion delta(t-5)" }}}}{MARK "0 1 0" 78 }{VIEWOPTS 1 1 0 1 1 1803 }