cubie.integrators.algorithms.LoopStepConfig
Loop step configuration for integrator timing and tolerances.
This module provides the LoopStepConfig class, which serves as a convenience class for grouping and passing around loop step timing information, including step sizes, tolerances, and summary intervals.
Classes
|
Step timing and exit conditions for an integrator loop. |
- class cubie.integrators.algorithms.LoopStepConfig.LoopStepConfig(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)[source]
Bases:
object
Step timing and exit conditions for an integrator loop.
This class serves as a convenience container for grouping and passing around loop step information, including minimum and maximum step sizes, output intervals, and tolerance settings for 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.
Notes
This class provides convenient grouping of timing parameters and conversion utilities for fixed-step algorithms. The fixed_steps property converts time-based requests to integer numbers of steps.
See also
IntegratorLoopSettings
Higher-level loop configuration
IntegratorRunSettings
Runtime configuration settings
- property fixed_steps
Convert time-based requests to integer numbers of steps for fixed-step loops.
This helper function converts time-based timing requests to integer numbers of steps at the minimum step size (dt_min). It performs sanity checks and may adjust values for fixed-step algorithm compatibility.
- Returns:
A tuple containing: - save_every_samples (int): Number of internal loop steps between saves - summarise_every_samples (int): Number of output samples between summary calculations - step_size (float): Internal time step size used in the loop (dt_min by default)
- Return type:
Notes
For fixed-step algorithms, dt_min is used as the internal step size. The number of steps between saves and summaries are computed as integer divisions, which may result in slight adjustments to the requested timing.