For each individual, you can set up a dosing regimen. In this example, we do bolus dosing.
Use the evtools plugin
The dynamic dosing stuff goes in the [ event ] block
Call evt::bolus() to create the basic dose
Call evt::ii() to set the dosing interval
Call evt::ss() to advance the system to pharmacokinetic steady state
Call evt::addl() to schedule additional doses
Then push() the object back to mrgsolve
[ plugin ] evtools
[ set ] outvars = "CP"
[ param ]
CL = 1
V = 32
KA = 2
DOSE = 100
INTERVAL = 24
TOTAL = 7
[ pkmodel ] advan = 2
[ event ]
if ( NEWIND > 1 ) return ;
evt:: ev dose = evt:: bolus( DOSE, 1 );
evt:: ss( dose, 1 );
evt:: ii( dose, INTERVAL);
evt:: addl( dose, TOTAL- 1 );
self. push( dose);
[ error ] capture CP = A2/ V;
We put in 7 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-2.solv" )
. Building evtools-2_solv ... done.
out <- mrgsim (mod, end = 360 , delta = 0.25 )
plot (out)