Integrator Configuration¶
Configuration classes and types for controlling integrator behavior.
IntegratorConfig ¶
IntegratorConfig(abs_tol: float = 1e-06, rel_tol: float = 0.001, initial_step: float = None, min_step: float = Ellipsis, max_step: float = Ellipsis, step_safety_factor: float = Ellipsis, min_step_scale_factor: float = Ellipsis, max_step_scale_factor: float = Ellipsis, max_step_attempts: int = 10, fixed_step_size: float = None)
Configuration for numerical integrators.
Controls error tolerances, step size limits, and other integration parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
abs_tol | float | Absolute error tolerance. Defaults to 1e-6. | 1e-06 |
rel_tol | float | Relative error tolerance. Defaults to 1e-3. | 0.001 |
initial_step | float | Initial step size. Defaults to None (auto). | None |
min_step | float | Minimum step size. Defaults to 1e-12. | Ellipsis |
max_step | float | Maximum step size. Defaults to 900.0. | Ellipsis |
step_safety_factor | float | Safety factor for step control. Defaults to 0.9. | Ellipsis |
min_step_scale_factor | float | Minimum step scaling. Defaults to 0.2. | Ellipsis |
max_step_scale_factor | float | Maximum step scaling. Defaults to 10.0. | Ellipsis |
max_step_attempts | int | Maximum step attempts. Defaults to 10. | 10 |
fixed_step_size | float | Fixed step size for fixed-step integrators. Defaults to None. | None |
Example
Initialize instance.
adaptive builtin ¶
adaptive(abs_tol: float, rel_tol: float) -> IntegratorConfig
Create a configuration for adaptive-step integration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
abs_tol | float | Absolute error tolerance | required |
rel_tol | float | Relative error tolerance | required |
Returns:
| Name | Type | Description |
|---|---|---|
IntegratorConfig | IntegratorConfig | Configuration for adaptive-step integration |
fixed_step builtin ¶
fixed_step(step_size: float) -> IntegratorConfig
Create a configuration for fixed-step integration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
step_size | float | Fixed timestep in seconds | required |
Returns:
| Name | Type | Description |
|---|---|---|
IntegratorConfig | IntegratorConfig | Configuration for fixed-step integration |
AdaptiveStepResult ¶
Result from an adaptive integration step.
Contains the new state, actual timestep used, error estimate, and suggested next step.
Example
Initialize instance.
dt_next property ¶
dt_next: float
Get the suggested next timestep.
Returns:
| Name | Type | Description |
|---|---|---|
float | float | Suggested timestep for next iteration |
dt_used property ¶
dt_used: float
Get the actual timestep used.
Returns:
| Name | Type | Description |
|---|---|---|
float | float | Timestep actually used (may be smaller than requested) |
See Also¶
- Configuration Guide - Detailed guide to tuning parameters
- Adaptive Stepping - Theory behind adaptive step control
- Integrators Module - Integrators module overview