OneSimulation docs Website Free books Plans on Gumroad

Docs › Numerical API reference › onesim.numerics.time

B.10 onesim.numerics.time

AdaptiveTimeStep class

AdaptiveTimeStep(*, initial: float, minimum: float, maximum: float, relative_tolerance: float = 0.001, absolute_tolerance: float = 1e-10, safety: float = 0.9, maximum_rejections: int = 32, error_estimator: object | None = None) -> None

Pass as run(time_step=...) to choose the trial step range, error tolerances, safety and rejection limits.

Methods and properties.

next_step(step, normalized_error, *, order)

Compute the controller's proposed step after the supplied error and step history.

BackwardEuler class

BackwardEuler() -> None

Select first-order implicit Euler and supply a compatible nonlinear stage solver when required.

BDF class

BDF(*, order: int = 2, startup: object = <factory>, maximum_step_ratio: float = 2.0) -> None

Select backward differentiation order, startup policy and maximum step ratio. Keep its history for continuation.

ClassicalRungeKutta4 class

ClassicalRungeKutta4() -> None

Select the four-stage explicit fourth-order RK method. The time step must resolve the spatial stability bound.

Methods and properties.

to_mapping()

Return the mapping representation used for configuration and diagnostics.

ForwardEuler class

ForwardEuler() -> None

Select first-order explicit Euler with separately declared step limits.

Methods and properties.

to_mapping()

Return the mapping representation used for configuration and diagnostics.

TimeEventDefinition class

TimeEventDefinition(event_id: str, function: Callable[[float, object], float], direction: int = 0, terminal: bool = False, reset: Callable[[float, object], object] | None = None, expression: str | None = None, observation_sha256: str | None = None, value_tolerance: float = 0.0) -> None

Declare a scalar semantic-state event, optional crossing direction, terminal behavior and reset.

Methods and properties.

to_mapping() -> dict[str, object]

Serialize event semantics without embedding executable Python.

TimeExecutionBinding class

TimeExecutionBinding(method_id: str, order: int, stage_configuration: object, startup_method_id: str | None = None, maximum_step_ratio: float | None = None, supports_stage_projection: bool = False, stage_projection_equation: str | None = None) -> None

Read the bound method, nominal order, stage configuration, startup policy and stage-projection capabilities.

TimeMethod class

TimeMethod(method_id: str) -> None

Select a registered time algorithm by method_id, then supply the stage solver required by its binding.

Methods and properties. order. Read the nominal selected order. implicit. Read whether the time method is implicit.

to_mapping()

Return the mapping representation used for configuration and diagnostics.

TimeStepLimits class

TimeStepLimits(*, maximum_step: float | None = None, stability_safety_factor: float = 0.5, cfl_limit: float | None = None) -> None

Pass through Numerics.step_limits to bound the maximum step, stability safety factor and optional CFL.

Methods and properties.

to_mapping()

Return the mapping representation used for configuration and diagnostics.

bound(stability_step=None, *, courant_rate=None)

Combine independent bounds, scaling the spatial bound exactly once.