AdaptivePIController

class cubie.integrators.AdaptivePIController(precision: type[float16] | type[float32] | type[float64] | dtype[float16] | dtype[float32] | dtype[float64], dt: float = None, n_states: int = 1, **kwargs)[source]

Bases: BaseAdaptiveStepController

Proportional–integral step-size controller.

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 PI 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 PI controller.

Return type:

Callable

property integral_gain: float

Return the integral gain.

property proportional_gain: float

Return the proportional gain.