add_effect_compartment#

pharmpy.modeling.add_effect_compartment(model, expr)[source]#

Add an effect compartment.

Implemented PD models are:

  • Linear:

    E=B(1+slopeC)
  • Emax:

    E=B(1+EmaxCEC50+C)
  • Step effect:

    E={Bif C0B(1+Emax)else
  • Sigmoidal:

    E={B(1+EmaxCnEC50n+Cn) if C>0Belse
  • Log-linear:

    E=slopelog(C+C0)

B is the baseline effect

Parameters:
  • model (Model) – Pharmpy model

  • expr ({‘linear’, ‘emax’, ‘sigmoid’, ‘step’, ‘loglin’}) – Name of the PD effect function.

Returns:

Model – Pharmpy model object

Examples

>>> from pharmpy.modeling import *
>>> model = load_example_model("pheno")
>>> model = add_effect_compartment(model, "linear")
>>> model.statements.ode_system.find_compartment("EFFECT")
Compartment(EFFECT, amount=A_EFFECT(t), input=KE0*A_CENTRAL(t)/VC)