cottax.ode.contracts module

Driver contracts: the level Integrator, its final Integration (the condition’s initial-value problem integrated; trajectory adds the Times saved at and reports each state’s Trajectory), and CONTRACTS, the default.

class Times[source]

Bases: PerProblem

The times a trajectory is saved at: one array, within the span and monotone in the direction of integration; its length is the trajectory’s.

class Trajectory[source]

Bases: PerUnknown

Reported: each state at every one of the Times, stacked along a leading axis.

class Integrator[V: Place][source]

Bases: DriverContract[V], Generic[V]

Answers an ODE by integrating it.

static accepts(node: object)

An ODE: what an integrator answers.

Return type:

bool

class Integration[V: Place](trajectory: bool)[source]

Bases: Integrator[V], Generic[V]

The final state its answer; trajectory takes the Times and reports each state’s Trajectory at them: one sampling of the solution, the integrator’s to give.

trajectory: bool
property takes: tuple[type[Role], ...]

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 reports: tuple[type[Role], ...]

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

CONTRACTS = (Integration(),)

an implementation answers a problem by the first one it implements.

Type:

The default contracts