cottax.ode

The language a condition node is written in as an ODE: x’ = r, integrated by a contract.

Dependency:

ode_condition (Dt, x’ = r from x0; OdeCondition, its states with their

rates and initial values over a span, + the join; is_ode)

|| /

contracts (Times, the data; Trajectory, the report;

Integrator, the level; Integration, its final, trajectory its flag; CONTRACTS, the default)

Imported by name, not here: contracts, and what the language tells each consumer (consumers/).

class Dt[V: Place](state: V, rate: V, initial: V)[source]

Bases: Frozen, Generic[V]

x’ = r from x(t0) = x0: state changes at the rate held at rate, starting from the value held at initial.

state: V
rate: V
initial: V
relabel(renaming: Renaming[V])[source]
Return type:

Dt[V]

class OdeCondition[V: Place](relations: tuple[Dt[V], ...], span: V)[source]

Bases: ConditionalNode[V], Generic[V]

x’ = r from x0 per relation, over the span: an initial-value problem, so one solution. It determines exactly its states, so it is always a problem: outside its cycle a state is its value at t1; inside, the current state. The initial values and the span are its parameters, held fixed while it is integrated. Supports addition.

relations: tuple[Dt[V], ...]

A state twice, or a state that is a rate or an initial value, is core’s refusal (OwnsTwice, ReadsOwn).

span: V

one for every state.

Type:

Where (t0, t1) is read

property states: tuple[V, ...]
property rates: tuple[V, ...]
property initials: tuple[V, ...]
property parameters: tuple[V, ...]

The initial values, then the span.

property unknowns: tuple[V, ...]

abstract to ABC until a subclass binds the name, and absent on a class that declares it as a field.

Type:

What the level binds in place of the annotation

property conditions: tuple[V, ...]

abstract to ABC until a subclass binds the name, and absent on a class that declares it as a field.

Type:

What the level binds in place of the annotation

property reads: tuple[V, ...]

abstract to ABC until a subclass binds the name, and absent on a class that declares it as a field.

Type:

What the level binds in place of the annotation

property owns: tuple[V, ...]

abstract to ABC until a subclass binds the name, and absent on a class that declares it as a field.

Type:

What the level binds in place of the annotation

determined(unknowns: tuple[V, ...])[source]

Itself, handed exactly its states: what it determines is not edited.

Return type:

OdeCondition[V]

relabel(renaming: Renaming[V])[source]

The same definition with its places renamed.

Return type:

OdeCondition[V]

is_ode(node: object)[source]

An ODE: what an integrator answers.

Return type:

bool

Subpackages

Submodules