{VERSION 4 0 "IBM INTEL NT" "4.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 "Ohlfs" 1 14 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 "R3 Fo nt 0" -1 256 1 {CSTYLE "" -1 -1 "Helvetica" 1 14 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 "R3 Font 2" -1 257 1 {CSTYLE "" -1 -1 "Courier" 1 12 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 }{PSTYLE "R3 Font 0" -1 258 1 {CSTYLE "" -1 -1 "He lvetica" 1 14 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 256 "" 0 "" {TEXT -1 144 " Two Co mpartment Pharmacokinetic Model - file: compart2.mws\n\nName:\n\nThe u nits of time are hours and Dose(t) is the drug profile." }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 22 "restart;with(DEtools):" }}}{EXCHG {PARA 256 " " 0 "" {TEXT -1 38 "Heaviside(t) is the unit step function" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 89 "Dose := t -> sum((Heaviside(t-n*6)-\n \+ Heaviside(t-(n*6+1/2)))*2,n=0..10);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 22 "plot(Dose(t),t=0..20);" }}}{EXCHG {PARA 256 " " 0 "" {TEXT -1 44 "Define contants in the compartment equations" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "a := ln(2.0)*2; b := ln(2.0)/5;" }} }{EXCHG {PARA 256 "" 0 "" {TEXT -1 40 "Define the RHS of differential \+ equations" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "f := x -> -a*x + Dose( t);\ng := (x,y) -> a*x -b*y;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "eqn1 := diff(x(t),t)=f(x(t)):\neqn2 := diff(y(t),t)=g(x(t),y(t)) :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "d1 := dsolve(\{eqn1,eq n2,x(0)=0,y(0)=0\},\{x(t),y(t)\},\nmethod=laplace):" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 136 "The assign command sets x(t) = generated sol ution but\nnot as a function of t -- just as the symbol x(t). This\nc auses problems later on." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "assign( d1);" }}{PARA 256 "" 0 "" {TEXT -1 64 "Generate graphs of the concentr ation in each of the compartments" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "plot(\{x(t),y(t)\},t=0..30);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "9" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }