pharmpy.statements module¶
- class pharmpy.statements.Assignment(symbol, expression)[source]¶
Bases:
object
Representation of variable assignment, similar to
sympy.codegen.Assignment
- Variables
symbol (sympy.Symbol) – Symbol of statement
expression – Expression of statement
- property free_symbols¶
- order_terms(rvs, trans)[source]¶
Order terms such that random variables are placed last. Currently only supports additions.
- property rhs_symbols¶
- class pharmpy.statements.Compartment(name, index, lag_time=0)[source]¶
Bases:
object
- property amount¶
- property free_symbols¶
- property lag_time¶
- class pharmpy.statements.CompartmentalSystem[source]¶
Bases:
pharmpy.statements.ODESystem
System of ODEs descibed as a compartmental system
- property amounts¶
- property compartmental_matrix¶
- find_central()[source]¶
Find the central compartment
The central compartment is defined to be the compartment that has an outward flow to the output compartment. Only one central compartment is supported.
- find_depot(statements)[source]¶
Find the depot compartment
The depot compartment is defined to be the compartment that only has out flow to the central compartment, but no flow from the central compartment.
- find_dosing()[source]¶
Find the dosing compartment
A dosing compartment is a compartment that receives an input dose. Only one dose compartment is supported.
- find_output()[source]¶
Find the output compartment
An output compartment is defined to be a compartment that does not have any outward flow. A model has to have one and only one output compartment.
- find_transit_compartments(statements)[source]¶
Find all transit compartments
Transit compartments are a chain of compartments with the same out rate starting from the dose compartment. Because one single transit compartment cannot be distinguished from one depot compartment such compartment will be defined to be a depot and not a transit compartment.
- property free_symbols¶
- property names¶
A list of the names of all compartments
- property rhs_symbols¶
- t = t¶
- property zero_order_inputs¶
A vector of all zero order inputs to each compartment
- class pharmpy.statements.ExplicitODESystem(odes, ics)[source]¶
Bases:
pharmpy.statements.ODESystem
System of ODEs described explicitly
- property free_symbols¶
- property rhs_symbols¶
- class pharmpy.statements.Infusion(amount, rate=None, duration=None)[source]¶
Bases:
object
- property free_symbols¶
- class pharmpy.statements.ModelStatements(statements=None)[source]¶
Bases:
collections.abc.MutableSequence
A list of sympy statements describing the model
- add_before_odes(statement)[source]¶
Add a statement just before the ODE system or at the end of the model
- find_assignment(variable, is_symbol=True, last=True)[source]¶
Returns full last statement or all assignments that contains the symbol or variable of interest of an assignment
- property free_symbols¶
Get a set of all free symbols
- full_expression_after_odes(expression)[source]¶
Expand an expression into its full definition
After ODE system
- full_expression_from_odes(expression)[source]¶
Expand an expression into its full definition
Before ODE system
- property ode_system¶
Returns the ODE system of the model or None if the model doesn’t have an ODE system
- class pharmpy.statements.ODESystem[source]¶
Bases:
object
Base class and placeholder for ODE systems of different forms
- Variables
solver (str) – Solver to use when numerically solving the ode system Currently supports NONMEM ADVANs
- property free_symbols¶
- property rhs_symbols¶