{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 }{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 "Title " -1 18 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 1 1 1 1 } 3 1 0 0 12 12 1 0 1 0 2 2 19 1 }{PSTYLE "Author" 0 19 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 8 8 0 0 0 0 0 0 -1 0 } } {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT -1 33 "System of ODEs -Chemical \+ Kinetics" }}{PARA 19 "" 0 "" {TEXT -1 17 "file:kinetics.mws" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 14 "with(DEtools):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 30 "Define the system of equations" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 75 "odes := diff(x(t),t)=-k1*x(t)+kr1*y(t),diff(y(t),t )=-(kr1+k2)*y(t)+k1*x(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "k1 := 2.0; kr1 := 4; k2 := 1.0;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 68 "Generate a direction field along with a specific solution traje ctory" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 124 "DEplot([odes],\n[ x(t),y(t)],t=0..3.8,[ [x(0)=0.5,y(0)=2]],x=-3..3,y=-3..3,arrows=SLIM, \ntitle=`Linear System`,linecolor=blue);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 30 "Construct the general solution" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "dsolve(\{odes\},[x(t),y(t)]):" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 24 "ics := x(0)=0.5, y(0)=0;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 44 "Solve initial value problem using above ICS." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "soln := dsolve(\{odes,ics\}, [x(t),y(t)]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 51 "Set up a procedu re to solve the system numerically." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "dsolve(\{odes,ics\},\{x(t),y(t)\},type=numeric,output =listprocedure);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 62 "Define the so lution as functions X(t) and Y(t) - a Maple trick" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 38 "X := subs(%,x(t)); Y := subs(%%,y(t));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 70 "Xplot := plot( X,0..2,color= blue): Yplot := plot( Y,0..2,color=black):" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 30 "plots[display](\{Xplot,Yplot\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "a := unapply(rhs(soln[2]),t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 "plot(ln(a(t)),t=0..2,labels=[\"t\", \"log conc(x)\"],color=black);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "0 1 0" 17 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }