pub struct IntegratorConfig {
pub abs_tol: f64,
pub rel_tol: f64,
pub initial_step: Option<f64>,
pub min_step: Option<f64>,
pub max_step: Option<f64>,
pub step_safety_factor: Option<f64>,
pub min_step_scale_factor: Option<f64>,
pub max_step_scale_factor: Option<f64>,
pub max_step_attempts: usize,
pub fixed_step_size: Option<f64>,
}Expand description
Configuration options for numerical integrators.
§Example
use brahe::integrators::IntegratorConfig;
// Create config with tight tolerances for high-precision integration
let config = IntegratorConfig {
abs_tol: 1e-12,
rel_tol: 1e-9,
max_step: Some(100.0),
..Default::default()
};Fields§
§abs_tol: f64Absolute error tolerance for adaptive stepping
rel_tol: f64Relative error tolerance for adaptive stepping
initial_step: Option<f64>Initial step size (if None, integrator determines automatically)
min_step: Option<f64>Minimum allowed step size (if None, no minimum enforced)
max_step: Option<f64>Maximum allowed step size (if None, no maximum enforced)
step_safety_factor: Option<f64>Safety factor for adaptive step size control (typically 0.8-0.9) If None, no safety factor applied (uses raw error-based scaling)
min_step_scale_factor: Option<f64>Minimum step size scaling factor (prevents too-aggressive decreases) If None, no minimum limit on step reduction
max_step_scale_factor: Option<f64>Maximum step size scaling factor (prevents too-aggressive increases) If None, no maximum limit on step growth
max_step_attempts: usizeMaximum attempts to find acceptable step size
fixed_step_size: Option<f64>Fixed step size for fixed-step integrators When set, fixed-step integrators will use this value if no dt is provided to step()
Implementations§
Source§impl IntegratorConfig
impl IntegratorConfig
Sourcepub fn fixed_step(step_size: f64) -> Self
pub fn fixed_step(step_size: f64) -> Self
Create a new configuration for fixed-step integration.
Sets the fixed step size that will be used by fixed-step integrators when no
explicit dt is provided to the step() method. The step size can still be
overridden on a per-step basis by providing a dt value.
§Arguments
step_size: The step size to use for fixed-step integration (seconds)
§Returns
IntegratorConfig with fixed_step_size set
§Example
use brahe::integrators::IntegratorConfig;
// Create config with 1.0 second step size
let config = IntegratorConfig::fixed_step(1.0);
assert_eq!(config.fixed_step_size, Some(1.0));Trait Implementations§
Source§impl Clone for IntegratorConfig
impl Clone for IntegratorConfig
Source§fn clone(&self) -> IntegratorConfig
fn clone(&self) -> IntegratorConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IntegratorConfig
impl Debug for IntegratorConfig
Source§impl Default for IntegratorConfig
impl Default for IntegratorConfig
Source§fn default() -> Self
fn default() -> Self
Default configuration matching typical defaults
- abs_tol: 1e-6
- rel_tol: 1e-3
- initial_step: None (auto-determined)
- min_step: Some(1e-12)
- max_step: Some(900.0) (15 minutes)
- step_safety_factor: Some(0.9)
- min_step_scale_factor: Some(0.2)
- max_step_scale_factor: Some(10.0)
- max_step_attempts: 10
- fixed_step_size: None
Source§impl<'de> Deserialize<'de> for IntegratorConfig
impl<'de> Deserialize<'de> for IntegratorConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for IntegratorConfig
impl PartialEq for IntegratorConfig
Source§impl Serialize for IntegratorConfig
impl Serialize for IntegratorConfig
impl StructuralPartialEq for IntegratorConfig
Auto Trait Implementations§
impl Freeze for IntegratorConfig
impl RefUnwindSafe for IntegratorConfig
impl Send for IntegratorConfig
impl Sync for IntegratorConfig
impl Unpin for IntegratorConfig
impl UnsafeUnpin for IntegratorConfig
impl UnwindSafe for IntegratorConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromDhall for Twhere
T: DeserializeOwned,
impl<T> FromDhall for Twhere
T: DeserializeOwned,
fn from_dhall(v: &Value) -> Result<T, Error>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.