pub struct Integrator<const N: usize> { /* private fields */ }Expand description
A stateful integrator for an N-component system.
Implementations§
Source§impl<const N: usize> Integrator<N>
impl<const N: usize> Integrator<N>
Sourcepub fn with_step_limit(self, steps: u64) -> Self
pub fn with_step_limit(self, steps: u64) -> Self
Limits the steps, accepted and rejected, over the integrator’s life
(DEFAULT_STEP_LIMIT otherwise).
Sourcepub fn set_step_limit(&mut self, steps: u64)
pub fn set_step_limit(&mut self, steps: u64)
Changes the step limit, for example to continue after IntegrationError::StepLimit.
Sourcepub fn reset(&mut self, t_s: f64, y: [f64; N]) -> Result<(), SettingsError>
pub fn reset(&mut self, t_s: f64, y: [f64; N]) -> Result<(), SettingsError>
Moves the integrator to a new time and state, as after an impulse or a projection such as renormalizing a quaternion. The step-size estimate carries over.
§Errors
SettingsError::NotFinite for a non-finite time or state; the integrator is unchanged.
Sourcepub fn next_step_s(&self) -> Option<f64>
pub fn next_step_s(&self) -> Option<f64>
The step the adaptive method will try next, once it has taken one.
Sourcepub fn fired_events(&self) -> &[usize]
pub fn fired_events(&self) -> &[usize]
The events that fired at the current time, ascending, after Advance::Events; empty
otherwise.
Sourcepub fn advance<S>(
&mut self,
system: &mut S,
t_stop_s: f64,
) -> Result<Advance, IntegrationError<S::Error>>
pub fn advance<S>( &mut self, system: &mut S, t_stop_s: f64, ) -> Result<Advance, IntegrationError<S::Error>>
Integrates toward t_stop_s (which may be infinite), stopping at the first events.
- The last step is shortened, or stretched by up to 1%, to end exactly at
t_stop_s. A stop within the rounding oftcounts as reached without a step. - Events are checked at the end of every accepted step. The earliest crossing is located on
the step’s dense output; the integrator stops there with the dense output’s state, just
past the crossing (within
EVENT_TIME_RESOLUTION_S), and reports every event that is past its zero at that state. - A call that starts on an event it returned doesn’t return it again: the event’s function is already past zero there, and a crossing must start strictly on the near side.
OdeSystem::accept_stepsees every accepted step and may stop the integration.- The derivative is evaluated afresh at the start of each call, so a caller can change the system (a phase) between calls.
§Errors
IntegrationError: a failed derivative, a non-finite solution or event, a step that
can’t be made small enough, the step limit, or a stop time in the past. The integrator is
left at its last accepted step.
Trait Implementations§
Source§impl<const N: usize> Clone for Integrator<N>
impl<const N: usize> Clone for Integrator<N>
Source§fn clone(&self) -> Integrator<N>
fn clone(&self) -> Integrator<N>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more