{VERSION 3 0 "IBM INTEL NT" "3.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "" -1 256 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE " " -1 262 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 266 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 6 6 0 0 0 0 0 0 -1 0 }} {SECT 0 {PARA 3 "" 0 "" {TEXT -1 42 "Absorption Models: Repetitive Or al Dosing" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 26 "Generating the Drug \+ Doses." }}{PARA 0 "" 0 "" {TEXT 257 371 "Enter the dose numbers below \+ for n, consecutively, starting with n = 1. Each set of solution funct ions for each dose needs data from the previous ones, and so they must be done consecutively, in order. If something gets messed up, you ma y need to start over from n = 1. Also, enter your name in the 'myName ' field, so that you can easily identify your printed output. " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 266 74 "CHANGE the dose number he re (add 1 to generate the next consecutive dose)." }}{EXCHG {PARA 0 " " 0 "" {TEXT -1 0 "" }{MPLTEXT 1 0 1297 "n:=1:\nmyName:=`John Pais`:\n Digits:=5:\ntbegin:=6*(n-1):\ntmiddle:=tbegin+0.5:\ntend:=tbegin+6:\nn txt:=convert(n,string):\nDose:=(n,t)->2*(Heaviside(t-(n-1)*6)-Heavisid e(t-((n-1)*6+0.5))):\ndose1plot:=plot(Dose(n,t),t=(n-1)*6-0.0001..(n-1 )*6+6,y=0..2.01,\n color=magenta,\n \+ #labels=[`t hrs`,`100 mg/hr `],\n \+ titlefont=[HELVETICA,DEFAULT,14], \+ \+ tit le=` Drug Dose `.ntxt):\nk[1]:=2*ln(2):\nk[2]:=ln(2)/5:\nxc onnect[0]:=0:\nif n = 1 then\nxcon:=xconnect[0]: \na[1]:=exp(k[1]*tbeg in)*(xcon - 2/k[1]):\na[2]:=-(2/k[1])+(2/k[1])*exp(k[1]/2):\nelif n > \+ 1 then\nxcon:=xconnect[n-1]:\na[1]:=exp(k[1]*tbegin)*(xcon - 2/k[1]): \na[2]:=exp(k[1]*tmiddle)*(a[1]*exp(-k[1]*tmiddle) + 2/k[1]):\nfi:\nb[ 1]:=(2/k[1]):\nx[1]:=t->a[1]*exp(-k[1]*t)+b[1]:\nx[2]:=t->a[2]*exp(-k[ 1]*t):\n'a[1]'=evalf(a[1]),'b[1]'=evalf(b[1]),'a[2]'=evalf(a[2]):\nxco nnect[n]:=x[2](6*(n-1)+6):\nplotx1:=plot(x[1](t),t=tbegin..tmiddle,y=0 ..2,color=red):\nplotx2:=plot(x[2](t),t=tmiddle..tend,y=0..2,color=red ):\ndrugplot:=plots[display]([plotx1,plotx2],\n \+ labels=[`t (hrs)`,`(dg) `]):\ndrugplot:" }{TEXT -1 1 "\n" } {MPLTEXT 1 0 1574 "e[1]:=(2/k[2]):\nc[1]:=k[1]*a[1]/(k[2]-k[1]):\nc[2] :=k[1]*a[2]/(k[2]-k[1]):\nyconnect[0]:=0:\nif n = 1 then \nycon:=yconn ect[0]:\nd[1]:=exp(k[2]*tbegin)*(ycon-c[1]*exp(-k[1]*tbegin)-2/k[2]): \+ \nd[2]:=c[1]*exp((k[2]-k[1])/2)+d[1]+(2/k[2])*exp(k[2]/2)-c[2]*exp((k[ 2]-k[1])/2):\nelif n > 1 then\nycon:=yconnect[n-1]:\nd[1]:=exp(k[2]*tb egin)*(ycon-c[1]*exp(-k[1]*tbegin)-2/k[2]): \nd[2]:=exp(k[2]*tmiddle)* (c[1]*exp(-k[1]*tmiddle)+d[1]*exp(-k[2]*tmiddle)+(2/k[2])-c[2]*exp(-k[ 1]*tmiddle)):\nfi:\ny[1]:=t->c[1]*exp(-k[1]*t)+d[1]*exp(-k[2]*t)+e[1]: \ny[2]:=t->c[2]*exp(-k[1]*t)+d[2]*exp(-k[2]*t):\n'c[1]'=evalf(c[1]),'d [1]'=evalf(d[1]),'e[1]'=evalf(e[1]):\n'c[2]'=evalf(c[2]),'d[2]'=evalf( d[2]):\nyconnect[n]:=y[2](6*(n-1)+6):\nploty1:=plot(y[1](t),t=tbegin.. tmiddle,y=0..2,color=blue):\nploty2:=plot(y[2](t),t=tmiddle..tend,y=0. .2,color=blue):\ndrugplot:=plots[display]([dose1plot,ploty1,ploty2],\n labels=[`t (hrs)`,`(dg) `]):\ndrugplot:\nmyN ame,`Dose`.ntxt.` Model`;\n'x[1](t)'=evalf(x[1](t));\n'x[2](t)'=evalf( x[2](t));\n'x[1]'(tbegin)=evalf(x[1](tbegin)),\n'x[1]'(tmiddle)=evalf( x[1](tmiddle)),\n'x[2]'(tmiddle)=evalf(x[2](tmiddle)),\n'x[2]'(tend)=e valf(x[2](tend)):\nxconnect.ntxt=evalf(xconnect[n]);``;\n'y[1](t)'=eva lf(y[1](t));\n'y[2](t)'=evalf(y[2](t));\n'y[1]'(tbegin)=evalf(y[1](tbe gin)),\n'y[1]'(tmiddle)=evalf(y[1](tmiddle)),\n'y[2]'(tmiddle)=evalf(y [2](tmiddle)),\n'y[2]'(tend)=evalf(y[2](tend)):\nyconnect.ntxt=evalf(y connect[n]);\ndrugplot:=plots[display]([dose1plot,plotx1,plotx2,ploty1 ,ploty2],\n labels=[`t hours`,`decigrams`]): \+ " }}}{PARA 0 "" 0 "" {TEXT 259 55 "The formulas \+ for the current dose are displayed above. " }}{PARA 0 "" 0 "" {TEXT 260 43 "Next, create the plot for the current dose." }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }{MPLTEXT 1 0 9 "drugplot;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 258 48 "Compute ymin for the current dose, using \+ y1(t). " }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }{MPLTEXT 1 0 240 "t:= 't':\nmyName,`Dose`.ntxt.` ymin`;\n'y[1](t)'=evalf(y[1](t));\n'D(y[1]) (t)'=evalf(D(y[1])(t));\n'D(y[1])(t)=0';\ntmin:=fsolve(D(y[1])(t)=0,t) :\n'tmin'=tmin*'hrs';\nymin:=evalf(y[1](tmin)):\n'ymin'='y[1](tmin)'; \n'ymin'=ymin*'dg';\n``=ymin*100*'mg';" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 261 48 "Compute ymax for the current dose, using y2(t). " }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }{MPLTEXT 1 0 241 "t:='t':\nmyNam e,`Dose`.ntxt.` ymax`;\n'y[2](t)'=evalf(y[2](t));\n'D(y[2])(t)'=evalf( D(y[2])(t));\n'D(y[2])(t)=0';\ntmax:=fsolve(D(y[2])(t)=0,t):\n'tmax'=t max*'hrs';\nymax:=evalf(y[2](tmax)):\n'ymax'='y[2](tmax)';\n'ymax'=yma x*'dg';\n``=ymax*100*'mg';\n" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 262 58 "Compute yave for the current dose, using y1(t) and y2(t). " }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 256 1 " " }{MPLTEXT 1 0 413 "yavep1:=int(evalf(1/6*y[1](t)),t=tbegin..tmiddle):\nyavep2:=int(e valf(1/6*y[2](t)),t=tmiddle..tend):\nyave:=yavep1+yavep2:\nmyName,`Dos e`.ntxt.` yave`;\n`yave `=1/6*Int('y(t)',t=tbegin..tend);\n``=1/6*Int( 'y[1](t)',t=tbegin..tmiddle)+1/6*Int('y[2](t)',t=tmiddle..tend);\n``=1 /6*Int(evalf(y[1](t)),t=tbegin..tmiddle)*` +`;\n1/6*Int(evalf(y[2](t) ),t=tmiddle..tend);\n``=yavep1+yavep2*` `;\n``=yave*'dg';\n``=(yave)*1 00*'mg';" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 263 41 "Summarize yo ur data for the current dose." }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }{MPLTEXT 1 0 136 "myName,`Dose`.ntxt.` Summary`;\n'tmin'=tmin*'hrs'; \n'ymin'=ymin*100*'mg';\n'tmax'=tmax*'hrs';\n'ymax'=ymax*100*'mg';\n'y ave'=(yave)*100*'mg';" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 264 60 "Create your y(t) vs x(t) 2D cycle plot for the current dose." }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }{MPLTEXT 1 0 497 "plot1:=plot([( x[1](t),y[1](t)),t=tbegin..tmiddle],color=green):\nplot2:=plot(\{[(x[2 ](t),y[2](t)),t=tmiddle..tend]\},color=navy):\ncycleplot:=plots[displa y]([plot1,plot2],\n labels=[`x(t)`,`y(t) `],\n \+ view=[0..0.8,0..2.0],\n titlefont=[HELVETICA ,DEFAULT,14],\n title=` 2D Cycle Plot: Drug Dose `.ntx t):\nmyName,`Dose`.ntxt.` Cycle Plot`;\n`green curve: the points [`*'x [1]','y[1]'*`]`;\n`navy curve: the points [`*'x[2]','y[2]'*`]`;\ncycle plot;" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 265 64 "Now, return to \+ the top and add 1 to n to generate the next dose." }}{EXCHG {PARA 0 " " 0 "" {TEXT -1 0 "" }{MPLTEXT 1 0 0 "" }}}}}{MARK "1" 0 }{VIEWOPTS 1 1 0 1 1 1803 }