{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 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 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 243 "In this simulation, we so lve the chemical mixing problem, with the chemical entering the reacto r from the left end, and the mixture exitinf from the right end. The e quation of the equilibrium solution is u''(x)=0, u'(0)=-2, and u'(1)+u (1)=0. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "with(PDEtools);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 39 "First we solve the equilibrium equ ation" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "eq1:=diff(u(x),x,x)=0; gen eral_solution:=dsolve(\{eq1\},u(x));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "dsolve(\{eq1,D(u)(0)=-2,D(u)(1)+u(1)=0\},\{u(x)\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 169 "Next we solve the diffusion eq uation with the initial condition u=0 by numerical method. When the ti me is large, the solution will approach the equilibirum solved above. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "diffusion:=diff(u(t,x),t)=2*dif f(u(t,x),x,x);" }}}{EXCHG }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "I BC:=\{u(0,x)=0, D[2](u)(t,0)=-2, D[2](u)(t,1)+u(t,1)=0\};" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "pds:=pdsolve(diffusion, IBC, numeri c, spacestep=1/40);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "pds: -animate(t=2,frames=100);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "IBC1:=\{u(0,x)=10*sin(Pi*x), D[2](u)(t,0)=-2, D[2](u)(t,1)+u(t,1)= 0\};" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "pds1:=pdsolve(diffu sion, IBC1, numeric, spacestep=1/40);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "pds1:-animate(t=0.2,frames=100);" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "12" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }