Integrator
このコンテンツはまだ日本語訳がありません。
Defined in: integrator.rs:11
pub trait IntegratorCommon interface for fixed-step numerical integrators.
Implementors provide step(Integrator::step), which advances the state
by a single time step. Default implementations of integrate(Integrator::integrate)
and integrate_with_events(Integrator::integrate_with_events) build on step
to provide multi-step integration with optional event detection.
Required Methods
Section titled “Required Methods”step()
Section titled “step()”fn step<S: DynamicalSystem>(&self, system: &S, t: f64, state: &
::State, dt: f64) ->::State
Perform a single integration step, advancing the state from t by dt.
Provided Methods
Section titled “Provided Methods”integrate()
Section titled “integrate()”fn integrate<S, F>(&self, system: &S, initial:
::State, t0: f64, t_end: f64, dt: f64, callback: F) ->::State where S: DynamicalSystem, F: FnMut(f64, &::State)
Integrate a dynamical system from t0 to t_end using fixed step size dt.
Calls callback(t, &state) after each step, allowing the caller to
record intermediate states (e.g., for energy monitoring or trajectory output).
Returns the final state at t_end.
integrate_with_events()
Section titled “integrate_with_events()”fn integrate_with_events<S, F, E, B>(&self, system: &S, initial:
::State, t0: f64, t_end: f64, dt: f64, callback: F, event_check: E) -> IntegrationOutcome<::State, B>where S: DynamicalSystem, F: FnMut(f64, &::State), E: [Fn(f64, &::State) -> ControlFlow<B>](https://doc.rust-lang.org/std/ops/function/trait.Fn.html)
Integrate a dynamical system with event detection and NaN/Inf checking.
After each step:
- Checks for NaN/Inf in state → returns
IntegrationOutcome::Error - Calls
callback(t, &state) - Calls
event_check(t, &state)→ ifBreak(reason), returnsTerminated