One-compartment model using $DES

To demonstrate how to $DES for general ODE models, we use it to reproduce the ADVAN2 model (example "CONTROL7" in NONMEM release)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
  ;#...
  $SUBROUTINES ADVAN6 TOL=5
  $MODEL COMP=(DEPOT,INITIALOFF,DEFDOSE) COMP=(CENTRAL,DEFOBS,NOOFF)
  $PK
  ;# THETA(1)=MEAN ABSORPTION RATE CONSTANT (1/HR)
  ;# THETA(2)=MEAN ELIMINATION RATE CONSTANT (1/HR)
  ;# THETA(3)=SLOPE OF CLEARANCE VS WEIGHT RELATIONSHIP (LITERS/HR/KG)
  ;# SCALING PARAMETER=VOLUME/WT SINCE DOSE IS WEIGHT-ADJUSTED
  CALLFL=1
  KA=THETA(1)+ETA(1)
  KE=THETA(2)+ETA(2)
  CL=THETA(3)*WT+ETA(3)
  S2=CL/KE/WT
  $THETA (.1,3,5) (.008,.08,.5) (.004,.04,.9)
  $OMEGA BLOCK(3) 6 .005 .0002 .3 .006 .4
  $DES
  DADT(1)=-KA*A(1)
  DADT(2)= KA*A(1)-KE*A(2)
  $ERROR
  Y=F+EPS(1)
  $SIGMA .4
  ;#...

Here we use $MODEL to designate compartment 1 "DEPOT", as the dose compartment (DEFDOSE), and compartment 2 "CENTRL", as the observation compartment (DEFOBS). The $DES block describes the derivatives DADT on the LHS using drug amount A on the RHS. Note that $DES must be used along with $MODEL to specify the nature of the compartments. Note that from the ODE perspective, despite the one-compartment model nomeclasure, $MODEL specifes two compartments. One can in fact explicitly specify the number of compartments using

1
$MODEL NCOMPARTMENTS=2

Because the model requires numerical solution (using ADVAN6), one must also specify tolerance using TOL.