{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 257 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times " 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 } {PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {PARA 256 "" 0 "" {TEXT -1 56 "Module 41: Laplace Transforms a nd the Diffusion Equation" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 63 " This worksheet is repaired with Maple 9.5 in \+ July 2, 2002." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 113 " What is possible with the diffusion equation using \+ Laplace Transforms that we did not encounter previously? " }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 61 "Now, we have the e quation for x in the infinite interval [0, " }{XPPEDIT 18 0 "infinity; " "6#%)infinityG" }{TEXT -1 25 " ). Here is the equation:" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 11 " " } {XPPEDIT 18 0 "diff(u(t,x),t) = k*diff(u(t,x),`$`(x,2));" "6#/-%%diffG 6$-%\"uG6$%\"tG%\"xGF**&%\"kG\"\"\"-F%6$-F(6$F*F+-%\"$G6$F+\"\"#F." } {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 24 "with boundary conditions" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 25 " u(t,0) = 10 and u(t, " }{XPPEDIT 18 0 "infinity;" "6#%)infinityG" }{TEXT -1 14 ") is bounded. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 37 "The initial condi tion is u(0,x) = 0." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 40 "The number k is the thermal diffusivity." }}{PARA 0 "" 0 "" {TEXT -1 97 "\nWe use the integral transform package and take k t o be 1/5. The integral transform that we will " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 25 " L( f(t) )(s) = \+ " }{XPPEDIT 18 0 "int(exp(-s*t)*f(t),t = 0 .. infinity);" "6#-%$intG6$ *&-%$expG6#,$*&%\"sG\"\"\"%\"tGF-!\"\"F--%\"fG6#F.F-/F.;\"\"!%)infinit yG" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "will have as a part of the assumption that s > 0. Also, w e take x to be real." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "restart: with(inttrans): k:=1/5;\nq:=t->1 0;\nassume(s>0);\nassume(x>0);\n" }}}{PARA 0 "" 0 "" {TEXT -1 42 "Here is the partial differential equation." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "PDE:=diff(u(t,x),t) = k*diff(u(t,x),x,x);" }}}{PARA 0 "" 0 "" {TEXT -1 109 "We begin with the use of Laplace transforms by computing the transform of this partial differential equation." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "lPDE:=laplace(PDE,t,s);" }}} {PARA 0 "" 0 "" {TEXT -1 114 "Taking the Laplace Transform changes the PDE into an ODE. We use the initial condition of the PDE to make the \+ ODE." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "ODE:=subs(\{u(0,x)=0 ,laplace(u(t,x),t,s)=v(x)\},lPDE);" }}}{PARA 0 "" 0 "" {TEXT -1 66 "Th e initial condition of the PDE becomes the initial value of ODE." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "Q:=unapply(laplace(q(t),t,s) ,s);" }}}{PARA 0 "" 0 "" {TEXT -1 22 "Now, we solve the ODE." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "sol:=dsolve(\{ODE,v(0)=Q(s), D(v)(0)=C\},v(x));" }}}{PARA 0 "" 0 "" {TEXT -1 129 "We need these in \+ terms of the exponential function and simplified so that we can use th e boundedness property. I simplify next.. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 21 "Alternate appearance." }}{PARA 0 "" 0 "" {TEXT -1 90 "If the solution v(x) is not in terms of exponential functions, you might use this command." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "sol:=expand(convert(sol,exp));" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 222 "Separate out the coefficients of the un bounded parts. These unbounded parts should be zero. When I ran this p roblem on this day I find these parts are 5/s +sqrt(5/s)C/10. It is no t so hard to choose C so that this is zero." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "coeff(rhs(sol),exp (sqrt(5)*sqrt(s)*x));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "CC :=solve(5/s+sqrt(5/s)/10*C=0,C);" }}}{PARA 0 "" 0 "" {TEXT -1 83 "In t he computation for this day and this time, the constant above is desig nated C." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "vsx:=subs(C=CC, rhs(sol));" }}}{PARA 0 "" 0 "" {TEXT -1 88 "This v(s, x) is the Laplac e Transform of our solution. We compute the inverse transform." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "UU:=invlaplace(vsx,s,t);" }} }{PARA 0 "" 0 "" {TEXT -1 40 "We make this expression into a function. " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "u:=unapply(UU,(t,x));" } }}{PARA 0 "" 0 "" {TEXT -1 32 "Here is a graph of the function." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "plot3d(u(t,x),x=0..2,t=0..10 ,axes=NORMAL,orientation=[-110,55]);" }}}{PARA 0 "" 0 "" {TEXT -1 82 " An animation should show the heat moving down the rod as time progress es. Because " }{XPPEDIT 18 0 "sqrt(t);" "6#-%%sqrtG6#%\"tG" }{TEXT -1 68 " is in the denominator for u, do step away from the origin a littl e." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "with(plots):\nanimate( u(t,x),x=1..10,t=0.1..10);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 22 "Information about erfc" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "?erfc" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "plot(erfc(x),x=0..3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 89 "We ask: what happens if k is larger or smaller. What happens if q(t) is changing in time?" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 70 "Here is an answer to the last question. We work t he following problem." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 21 "Here is the equation:" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 11 " " }{XPPEDIT 18 0 "diff(u(t ,x),t) = k*diff(u(t,x),`$`(x,2));" "6#/-%%diffG6$-%\"uG6$%\"tG%\"xGF** &%\"kG\"\"\"-F%6$-F(6$F*F+-%\"$G6$F+\"\"#F." }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 24 "with boundary con ditions" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 13 " u(t,0) = " }{XPPEDIT 18 0 "1/sqrt(t);" "6#*&\"\"\"F$-%%sqrtG6# %\"tG!\"\"" }{TEXT -1 12 " and u(t, " }{XPPEDIT 18 0 "infinity;" "6# %)infinityG" }{TEXT -1 14 ") is bounded. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 39 "The initial condition is u(0,x) = 0. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 35 " We first ask what we should expect." }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 74 "restart: with(inttrans): k:=1;\nq:=t->1/sqrt(t);\nassume(s>0);\n assume(x>0);\n" }}}{PARA 0 "" 0 "" {TEXT -1 42 "Here is the partial di fferential equation." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "PDE: =diff(u(t,x),t) = k*diff(u(t,x),x,x);" }}}{PARA 0 "" 0 "" {TEXT -1 109 "We begin with the use of Laplace transforms by computing the tran sform of this partial differential equation." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "lPDE:=laplace(PDE,t,s);" }}}{PARA 0 "" 0 "" {TEXT -1 114 "Taking the Laplace Transform changes the PDE into an ODE. We u se the initial condition of the PDE to make the ODE." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "ODE:=subs(\{u(0,x)=0,laplace(u(t,x),t,s)= v(x)\},lPDE);" }}}{PARA 0 "" 0 "" {TEXT -1 66 "The initial condition o f the PDE becomes the initial value of ODE." }}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 38 "Q:=unapply(laplace(q(t),t,s),s):\nQ(s);" }}}{PARA 0 "" 0 "" {TEXT -1 22 "Now, we solve the ODE." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "sol:=dsolve(\{ODE,v(0)=Q(s),D(v)(0)=C\},v(x));" }}}{PARA 0 "" 0 "" {TEXT -1 99 "Separate out the coefficients of the u nbounded parts. These should be zero. We find these parts are" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 9 " \+ " }{XPPEDIT 18 0 "c/(2*sqrt(s))+sqrt(Pi/s)/2;" "6#,&*&%\"cG\"\"\"*&\" \"#F&-%%sqrtG6#%\"sGF&!\"\"F&*&-F*6#*&%#PiGF&F,F-F&F(F-F&" }{TEXT -1 5 " = 0." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 51 "It is not so hard to choose C so that this is zero." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "CC:=solve(sqrt(Pi/s)/2+C/(2*sqrt(s) )=0,C);" }}}{PARA 0 "" 0 "" {TEXT -1 84 "In the computation for this d ay and this time, the constant above is designated _C2." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "vsx:=simplify(subs(C=CC,rhs(sol))); " }}}{PARA 0 "" 0 "" {TEXT -1 88 "This v(s, x) is the Laplace Transfor m of our solution. We compute the inverse transform." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "UU:=invlaplace(vsx,s,t);" }}}{PARA 0 "" 0 "" {TEXT -1 40 "We make this expression into a function." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "u:=unapply(UU,(t,x));" }}}{PARA 0 " " 0 "" {TEXT -1 19 "Here is the graph. " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "plot3d(u(t,x),x=0..2,t=0..10,axes=NORMAL,orientation= [-110,55]);" }}}{PARA 0 "" 0 "" {TEXT -1 39 "Here is a verification of the solution." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "u(t,0);" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "simplify(diff(u(t,x),t) - k *diff(u(t,x),x,x));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 256 12 "Assignment: " }{TEXT -1 130 " Rework the first problem with k = 1/10 and compare the time t for u(t, 1) to be 5 with the time for u(t, 1) to be 5 with k = 1/5." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 257 11 "Assignment:" }{TEXT -1 69 " Rework the diffusion problem with u(t, 0) = Dirac(t) and u(0, x) = 0" }}{PARA 0 "" 0 "" {TEXT -1 2 " " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 31 "S olution for second assignment." }}{PARA 0 "" 0 "" {TEXT -1 46 "Here is the solution to the second assignment." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "u:=(t,x)->x*exp(-x^2/(4*t))/(2*sqrt(Pi)*t^(3/2));" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "diff(u(t,x),t) - diff(u(t,x ),x,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " u(t,0);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 67 "plot3d(u(t,x),x=0..4*Pi,t=0. .10,axes=NORMAL,orientation=[-110,55]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "with(plots):\nanimate(u(t,x),x=1..10,t=0.1..10);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 17 "Alternate Problem" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 77 "Here is a solution for the problem with w ith u(0, x) = sin(x) and u(t, 0) = 0" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "u:=(t,x)->sin(x)*exp(-t/5) ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "diff(u(t,x),t) - 1/5*d iff(u(t,x),x,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "u(0,x); u(t,0);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 67 "plot3d(u(t,x),x =0..4*Pi,t=0..10,axes=NORMAL,orientation=[-110,55]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "with(plots):\nanimate(u(t,x),x=1..10,t=0. 1..10);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{MARK "0 0" 56 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }