RKF45 Integrator¶
Runge-Kutta-Fehlberg 4(5) adaptive integrator with embedded error estimation.
RKF45Integrator ¶
RKF45Integrator(dimension: int, dynamics_fn: callable, jacobian: Union[DAnalyticJacobian, DNumericalJacobian] = None, sensitivity: Any = None, control_fn: Any = None, config: IntegratorConfig = None)
Runge-Kutta-Fehlberg 4(5) adaptive integrator.
Embedded 5th/4th order method with automatic step size control. The integrator uses error estimation from the embedded solution to adapt the timestep for efficiency and accuracy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dimension | int | State vector dimension | required |
dynamics_fn | callable | Dynamics function with signature (t: float, state: ndarray) -> ndarray | required |
jacobian | DAnalyticJacobian or DNumericalJacobian | Jacobian provider for variational matrix propagation | None |
config | IntegratorConfig | Integration configuration | None |
Example
Initialize instance.
step method descriptor ¶
step(t: float, state: ndarray, dt: float) -> AdaptiveStepResult
Perform one adaptive integration step.
Tolerances are read from the integrator's configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t | float | Current time | required |
state | ndarray | State vector at time t | required |
dt | float | Requested timestep | required |
Returns:
| Name | Type | Description |
|---|---|---|
AdaptiveStepResult | AdaptiveStepResult | Result containing new state, actual dt used, error estimate, and suggested next dt |
step_with_sensmat method descriptor ¶
Advance state and sensitivity matrix with adaptive step control.
Propagates the sensitivity matrix S that maps parameter uncertainties to state uncertainties. The sensitivity evolves according to dS/dt = A*S + B.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t | float | Current time | required |
state | ndarray | State vector at time t | required |
sens | ndarray | Sensitivity matrix at time t (state_dim x param_dim) | required |
params | ndarray | Parameter vector | required |
dt | float | Requested timestep | required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple | Tuple | (new_state, new_sensitivity, dt_used, error_estimate, dt_next) |
Example
step_with_varmat method descriptor ¶
Perform one adaptive integration step with variational matrix.
Tolerances are read from the integrator's configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t | float | Current time | required |
state | ndarray | State vector at time t | required |
phi | ndarray | State transition matrix (dimension x dimension) | required |
dt | float | Requested timestep | required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple | Tuple | (new_state, new_phi, dt_used, error_estimate, dt_next) |
step_with_varmat_sensmat method descriptor ¶
step_with_varmat_sensmat(t: float, state: ndarray, phi: ndarray, sens: ndarray, params: ndarray, dt: float) -> Tuple
Advance state, variational matrix (STM), and sensitivity matrix with adaptive step control.
Propagates both matrices simultaneously for complete uncertainty quantification: - STM (Phi): Maps initial state uncertainties to current state uncertainties - Sensitivity (S): Maps parameter uncertainties to state uncertainties
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t | float | Current time | required |
state | ndarray | State vector at time t | required |
phi | ndarray | State transition matrix at time t (state_dim x state_dim) | required |
sens | ndarray | Sensitivity matrix at time t (state_dim x param_dim) | required |
params | ndarray | Parameter vector | required |
dt | float | Requested timestep | required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple | Tuple | (new_state, new_phi, new_sensitivity, dt_used, error_estimate, dt_next) |
Example
See Also¶
- Adaptive-Step Integrators - Guide to adaptive integration
- Configuration - Tuning tolerances and step size control
- DP54 Integrator - More efficient alternative
- Integrators Module - Overview of all integrators