amici.ode_model.State

class amici.ode_model.State(identifier, name, init, dt)[source]

A State variable defines an entity that evolves with time according to the provided time derivative, abbreviated by x.

Variables
  • _conservation_law – algebraic formula that allows computation of this state according to a conservation law

  • _dt – algebraic formula that defines the temporal derivative of this state

__init__(identifier, name, init, dt)[source]

Create a new State instance. Extends ModelQuantity.__init__() by dt

Parameters

Methods Summary

__init__(identifier, name, init, dt)

Create a new State instance.

get_dt()

Gets the time derivative

get_dx_rdata_dx_solver(state_id)

Returns the expression that allows computation of dx_rdata_dx_solver for this state, accounting for conservation laws.

get_free_symbols()

Gets the set of free symbols in time derivative and initial conditions

get_id()

ModelQuantity identifier

get_name()

ModelQuantity name

get_val()

ModelQuantity value

get_x_rdata()

Returns the expression that allows computation of x_rdata for this state, accounting for conservation laws.

has_conservation_law()

Checks whether this state has a conservation law assigned.

set_conservation_law(law)

Sets the conservation law of a state.

set_dt(dt)

Sets the time derivative

set_val(val)

Set ModelQuantity value

Methods

__init__(identifier, name, init, dt)[source]

Create a new State instance. Extends ModelQuantity.__init__() by dt

Parameters
get_dt()[source]

Gets the time derivative

Return type

sympy.core.expr.Expr

Returns

time derivative

get_dx_rdata_dx_solver(state_id)[source]

Returns the expression that allows computation of dx_rdata_dx_solver for this state, accounting for conservation laws.

Returns

dx_rdata_dx_solver expression

get_free_symbols()[source]

Gets the set of free symbols in time derivative and initial conditions

Return type

typing.Set[sympy.core.basic.Basic]

Returns

free symbols

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_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 this state, accounting for conservation laws.

Returns

x_rdata expression

has_conservation_law()[source]

Checks whether this state has a conservation law assigned.

Returns

True if assigned, False otherwise

set_conservation_law(law)[source]

Sets the conservation law of a state.

If a conservation law is set, the respective state will be replaced by an algebraic formula according to the respective conservation law.

Parameters

law (amici.ode_model.ConservationLaw) – linear sum of states that if added to this state remain constant over time

Return type

None

set_dt(dt)[source]

Sets the time derivative

Parameters

dt (sympy.core.expr.Expr) – time derivative

Return type

None

set_val(val)

Set ModelQuantity value

Returns

value of the ModelQuantity