cubie.integrators.IntegratorRunSettings
Runtime configuration settings for numerical integration algorithms.
This module provides the IntegratorRunSettings class which manages timing, tolerance, and output configuration parameters for ODE integration runs. It includes validation logic to ensure consistent and achievable parameter combinations for fixed-step algorithms.
Classes
|
Container for runtime/timing settings that are commonly grouped together. |
- class cubie.integrators.IntegratorRunSettings.IntegratorRunSettings(dt_min: float = 1e-06, dt_max: float = 1.0, dt_save: float = 0.1, dt_summarise: float = 0.1, atol: float = 1e-06, rtol: float = 1e-06, output_types: list[str] = NOTHING)[source]
Bases:
object
Container for runtime/timing settings that are commonly grouped together.
This class manages the configuration parameters for numerical integration runs, including step sizes, tolerances, and output types. It provides validation to ensure that timing parameters are consistent and achievable for fixed-step integration algorithms.
- Parameters:
dt_min (float, default=1e-6) – Minimum time step size for integration.
dt_max (float, default=1.0) – Maximum time step size for integration.
dt_save (float, default=0.1) – Time interval between saved output samples.
dt_summarise (float, default=0.1) – Time interval between summary calculations.
atol (float, default=1e-6) – Absolute tolerance for integration error control.
rtol (float, default=1e-6) – Relative tolerance for integration error control.
output_types (list of str, default=empty list) – List of output types to generate during integration.
Notes
The class automatically validates timing relationships and discretizes step sizes to ensure they are compatible with fixed-step algorithms. Warnings are issued if requested parameters cannot be achieved exactly.
See also
LoopStepConfig
Low-level step configuration class
- _discretize_steps()[source]
Discretize the step sizes for saving and summarising.
Adjusts dt_save and dt_summarise to be integer multiples of the minimum step size (dt_min) and issues warnings if the requested values are not achievable in a fixed-step algorithm.
- _validate_timing()[source]
Check for impossible or inconsistent timing settings.
Validates timing relationships such as ensuring dt_max >= dt_min, dt_save >= dt_min, and dt_summarise >= dt_save. Raises errors for impossibilities and warnings if parameters are ignored.
- Raises:
ValueError – If timing parameters have impossible relationships (e.g., dt_max < dt_min).
- Warns:
UserWarning – If dt_max > dt_save, making dt_max redundant.
- dt_save_samples()[source]
Calculate the number of samples per save interval.
- Returns:
Number of integration steps between each saved output sample.
- Return type:
- property loop_step_config
Return the step-size configuration for the integration loop.
- Returns:
Configuration object containing all timing parameters for the loop.
- Return type: