{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 "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 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT -1 144 " Two Co mpartment Pharmacokinetic Model - file: compart3.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 30 "Dirac(t) is the delta function" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 61 "Dose := t -> sum(\n Dirac(t-(n/2)) *2,n=0..3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "convert(Dose (t),piecewise);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "plot(Dos e(t),t=0..20,discont=true);" }}}{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,eqn2,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 solution but\nn ot as a function of t -- just as the symbol x(t). This\ncauses proble ms later on." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "assign(d1);" }} {PARA 256 "" 0 "" {TEXT -1 64 "Generate graphs of the concentration 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 "10" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }