GustafssonController
- class cubie.integrators.GustafssonController(precision: type[float16] | type[float32] | type[float64] | dtype[float16] | dtype[float32] | dtype[float64], dt: float = None, n_states: int = 1, **kwargs)[source]
Bases:
BaseAdaptiveStepControllerAdaptive controller using Gustafsson acceleration.
- 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 Gustafsson controller.
- Parameters:
precision – Precision callable used to coerce scalars on device.
clamp – Callable that clamps proposed step sizes.
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 returning the mean squared scaled error.
- Returns:
CUDA device function implementing the Gustafsson controller.
- Return type:
Callable