create_ODE_system

cubie.odesystems.create_ODE_system(dxdt: str | Iterable[str] | Callable, precision: type[float16] | type[float32] | type[float64] | dtype[float16] | dtype[float32] | dtype[float64] = <class 'numpy.float32'>, states: dict[str, float] | ~typing.Iterable[str] | None=None, observables: Iterable[str] | None = None, parameters: dict[str, float] | ~typing.Iterable[str] | None=None, constants: dict[str, float] | ~typing.Iterable[str] | None=None, drivers: Iterable[str] | dict[str, ~typing.Any] | None=None, user_functions: dict[str, ~typing.Callable] | None=None, user_function_derivatives: dict[str, ~typing.Callable] | None=None, name: str | None = None, strict: bool = False, state_priority: dict[str, float] | None=None, irreducible: Iterable[str] | None = None, simplify_options: dict[str, ~typing.Any] | None=None, operation_ordering: str = 'liveness_auto') SymbolicODE[source]

Create a SymbolicODE from SymPy definitions.

Parameters:
  • dxdt – System equations defined as a single string, an iterable of equation strings in lhs = rhs form, or a Python callable. When a callable is provided its signature must be f(t, y, ...) where t is time, y is the state vector, and additional arguments map to parameters or constants. State access patterns supported: y[0] (positional), y["name"] (string), y.name (attribute). The return value must be a list, tuple, or dict of derivative expressions.

  • states – State labels either as an iterable or as a mapping to default initial values.

  • observables – Observable variable labels to expose from the generated system.

  • parameters – Parameter labels either as an iterable or as a mapping to default values.

  • constants – Constant labels either as an iterable or as a mapping to default values.

  • drivers – External driver variable labels required at runtime. Accepts either an iterable of driver symbol names or a dictionary mapping driver names to default values or driver-array samples and configuration entries.

  • user_functions – Custom callables referenced within dxdt expressions.

  • user_function_derivatives – Mapping of user-function names to callables evaluating their analytic derivatives, used when generating Jacobian-based solver helpers.

  • name – Identifier used for generated files. Defaults to the hash of the system definition.

  • precision – Target floating-point precision used when compiling the system.

  • strict – When True require every symbol to be explicitly categorised.

  • state_priority – Per-unknown state-selection priorities (higher values are preferred as solver states).

  • irreducible – Unknowns that must not be eliminated.

  • simplify_options – Extra keyword arguments forwarded to structural_simplify().

  • operation_ordering – Generated-operation ordering policy. "liveness_auto" applies thresholded liveness-based selection; "kahn" preserves stable breadth-first ordering, and "greedy" and "dfs" select fixed alternatives. Defaults to CUBIE_OPERATION_ORDERING (liveness_auto when unset).

Returns:

Fully constructed symbolic system ready for compilation.

Return type:

SymbolicODE