Effect macro


The macro effect defines an effect compartment. The effect compartment is linked to a parent compartment. The drug exchange between the effect compartment and the parent compartment does not affect the mass balance of the parent compartment. The parent compartment must be defined before the effect compartment is defined.


Arguments for the macro effect are:

  • cmt: Label of the linked base compartment. Its default value is 1.
  • ke0: Transfer rate from the linked base compartment. Mandatory.
  • concentration: Name of the variable defined as the concentration within the effect compartment. Mandatory.


; Define an effect compartment linked to the base compartment 1, 
; with a transfer rate ke0 to the effect compartment, 
; with Ce as concentration's name
effect(cmt=1, ke0, concentration=Ce)

Example with Mlxplore:

In the following example, a compartment is defined in the PK: bloc. An iv absorption process along with a linear elimination process is added to the main compartment. An effect is added with a transfer rate ke0. The model is implemented in the file effect.mlxplore.mlxtran available in the Mlxplore demos. The code is detailed below:

input = {V, k, ke0}

compartment(cmt=1, amount=Ac, concentration=Cc, volume=V)
elimination(cmt=1, k)
effect(cmt=1, ke0, concentration=Ce)

admin = {time=5, amount=1, target=Ac, rate=.5}

V = 10
ke0  = .5
k = 1

grid = 0:.05:20
list = {Ce,Cc}

p = {y={Ce, Cc}, ylabel='Concentrations', xlabel='Time'}

The concentration in the base compartment and in the effect compartment are proposed in the following figure where the concentration in the main (base) compartment is in orange, and the one in the effect compartment is in blue.


Rules and Best Practices:

  • We encourage the user to use all the fields in the macro to guarantee non confusion between fields.
  • A base compartment must be defined first.
  • Format restriction (non compliance will raise an exception)
    • The value after cmt= is necessarily an integer.
    • The value after ke0= can be either a double or replaced by an input parameter. Calculations are not supported.
    • The value after concentration= is necessarily a string.