BaseAdaptiveStepController
- class cubie.integrators.step_control.adaptive_step_controller.BaseAdaptiveStepController(precision: type[float16] | type[float32] | type[float64] | dtype[float16] | dtype[float32] | dtype[float64], dt: float = None, n_states: int = 1, **kwargs)[source]
Bases:
BaseStepControllerBase class for adaptive step-size controllers; owns
norm.- abstractmethod build_controller(precision: type[float16] | type[float32] | type[float64] | dtype[float16] | dtype[float32] | dtype[float64], clamp: Callable, min_step_shrink: float, max_step_growth: float, dt_min: float, dt_max: float, algorithm_order: int, safety: float, error_norm: Callable) ControllerCache[source]
Create the device function for the specific controller.
- Parameters:
precision – Precision callable used to coerce values.
clamp – Callable that limits step updates.
min_step_shrink – Most the step may shrink per adjustment.
max_step_growth – Most the step may grow per adjustment.
dt_min – Minimum permissible step size.
dt_max – Maximum permissible step size.
algorithm_order – Order of the integration algorithm.
safety – Safety factor used when scaling the step size.
error_norm – Device function
(error, state, state_prev) -> nrm2.
- Returns:
Cache containing the compiled controller device function.
- Return type:
ControllerCache