amici.ode_model.ConservationLaw

class amici.ode_model.ConservationLaw(identifier, name, value, coefficients, state_id)[source]

A conservation law defines the absolute the total amount of a (weighted) sum of states

__init__(identifier, name, value, coefficients, state_id)[source]

Create a new ConservationLaw instance.

Parameters

Methods Summary

__init__(identifier, name, value, ...)

Create a new ConservationLaw instance.

get_id()

ModelQuantity identifier

get_name()

ModelQuantity name

get_ncoeff(state_id)

Computes the normalized coefficient a_i/a_j where i is the index of the provided state_id and j is the index of the state that is replaced by this conservation law.

get_val()

ModelQuantity value

get_x_rdata()

Returns the expression that allows computation of x_rdata for the state that this conservation law replaces.

set_val(val)

Set ModelQuantity value

Methods

__init__(identifier, name, value, coefficients, state_id)[source]

Create a new ConservationLaw instance.

Parameters
get_id()

ModelQuantity identifier

Return type

sympy.core.symbol.Symbol

Returns

identifier of the ModelQuantity

get_name()

ModelQuantity name

Return type

str

Returns

name of the ModelQuantity

get_ncoeff(state_id)[source]

Computes the normalized coefficient a_i/a_j where i is the index of the provided state_id and j is the index of the state that is replaced by this conservation law. This can be used to compute both dtotal_cl/dx_rdata (=ncoeff) and dx_rdata/dx_solver (=-ncoeff).

Parameters

state_id – identifier of the state

Return type

typing.Union[sympy.core.expr.Expr, int, float]

Returns

normalized coefficent of the state

get_val()

ModelQuantity value

Return type

sympy.core.expr.Expr

Returns

value of the ModelQuantity

get_x_rdata()[source]

Returns the expression that allows computation of x_rdata for the state that this conservation law replaces.

Returns

x_rdata expression

set_val(val)

Set ModelQuantity value

Returns

value of the ModelQuantity