6  DIY regimen

For each individual, you can set up a dosing regimen. In this example, we do bolus dosing.

model/evtools-1.solv
[ plugin ] evtools

[ set ] outvars = "CP"

[ param ] 

CL = 1
V = 32
KA = 2

DOSE = 100
INTERVAL = 24
TOTAL = 10

[ pkmodel ] advan = 2

[ event ] 

if(NEWIND > 1) return; 

evt::ev dose = evt::bolus(DOSE, 1); 
evt::ii(dose, INTERVAL); 
evt::addl(dose, TOTAL-1); 
self.push(dose); 

[ error ]  capture CP = A2/V;

We put in 10 total doses with a 24 hour dosing interval; so we need to make sure the simulation end time covers the doses we scheduled. But we don’t pass in a dosing data set; this is executed in the model itself.

mod <- mread("model/evtools-1.solv")
. Building evtools-1_solv ... done.
out <- mrgsim(mod, end = 360, delta = 0.25)

plot(out)