add_peripheral_compartment#

pharmpy.modeling.add_peripheral_compartment(model, name=None)[source]#

Add a peripheral distribution compartment to model

The rate of flow from the central to the peripheral compartment will be parameterized as QPn / VC where VC is the volume of the central compartment. The rate of flow from the peripheral to the central compartment will be parameterized as QPn / VPn where VPn is the volumne of the added peripheral compartment.

If name is set, the peripheral compartment will be added to the compartment with the specified name instead.

Initial estimates:

n

1

\(\mathsf{CL} = \mathsf{CL'}\), \(\mathsf{VC} = \mathsf{VC'}\), \(\mathsf{QP1} = \mathsf{CL'}\) and \(\mathsf{VP1} = \mathsf{VC'} \cdot 0.05\)

2

\(\mathsf{QP1} = \mathsf{QP1' * 0.1}\), \(\mathsf{VP1} = \mathsf{VP1'}\), \(\mathsf{QP2} = \mathsf{QP1' * 0.9}\) and \(\mathsf{VP2} = \mathsf{VP1'}\)

Parameters:
  • model (Model) – Pharmpy model

  • name (str) – Name of compartment to add peripheral to.

Returns:

Model – Pharmpy model object

Examples

>>> from pharmpy.modeling import *
>>> model = load_example_model("pheno")
>>> model = add_peripheral_compartment(model)
>>> model.statements.ode_system
Bolus(AMT, admid=1) → CENTRAL
┌───────────┐
│PERIPHERAL1│
└───────────┘
  ↑      │
 Q/V1   Q/V2
  │      ↓
┌───────────┐
│  CENTRAL  │──CL/V1→
└───────────┘

See also

set_peripheral_compartment, remove_peripheral_compartment