Skip to content

Commit

Permalink
two compartment model
Browse files Browse the repository at this point in the history
  • Loading branch information
metelkin committed Sep 22, 2024
1 parent ff28b0c commit 3e4bd58
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions cases/0016/index0.heta
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
Create two compertement pharmacokinetic (PK) model with bolus injection.
*/
// index.heta
t {units: hour};

// compartments
''' Central compartment volume '''
Vd @Compartment {units: litre} .= 5.5;
''' Peripheral compartment volume '''
V2 @Compartment {units: litre} .= 1;

// species
''' Drug concentration in the central compartment '''
C1 @Species {compartment: Vd, units: gram/litre} .= 0;
''' Drug amount in the peripheral compartment '''
A2 @Species {compartment: V2, units: gram, isAmount: true} .= 0;

// reactions
''' Drug elimination from the central compartment (first-order law) '''
r1 @Reaction {actors: => C1, units: gram/hour} := CL * C1;
''' Drug transfer from the central to the peripheral compartment and back (first-order law) '''
r2 @Reaction {actors: C1 <=> A2, units: gram/hour} := k12 * C1 * Vd - k21 * A2;

// parameters
''' Drug clearance '''
CL @Const {units: litre/hour} = 1e-1;
''' Intravenous drug dose '''
Dose @Const {units: gram} = 1e-3;
''' Transfer rate from the central to the peripheral compartment '''
k12 @Const {units: 1/hour} = 1e-1;
''' Transfer rate from the peripheral to the central compartment '''
k21 @Const {units: 1/hour} = 1e-1;

// Injection event
sw1 @TimeSwitcher { start: 0 };
C1 [sw1]= Dose / Vd;

0 comments on commit 3e4bd58

Please sign in to comment.