AdaptiveStepper
Defined in: mod.rs:109
pub struct AdaptiveStepper\<'a, S: [DynamicalSystem](../../traits/dynamicalsystem/)\> { pub dt_min: f64, // ...}Stateful adaptive stepper that encapsulates FSAL k1/dt management.
Created via DormandPrince::stepper. Callers repeatedly call
advance_to(AdaptiveStepper::advance_to) to advance to successive
target times (e.g. output interval boundaries), without needing to
manage k1 reuse or step-size adaptation themselves.
Fields
Section titled “Fields”dt_min
Section titled “dt_min”dt_min: f64
Minimum step size below which integration fails. Can be overridden after construction to match the total integration interval.
Methods
Section titled “Methods”from_checked_state()
Section titled “from_checked_state()”fn from_checked_state(self) -> Self
Skip the event check on the state this stepper starts from.
For a segment that continues where the previous one ended: the caller has asked its predicate about that state already. Checks after accepted steps are unaffected.
advance_to()
Section titled “advance_to()”fn advance_to<F, E, B>(&mut self, t_target: f64, callback: F, event_check: E) -> [Result<AdvanceOutcome<B>, IntegrationError>](https://doc.rust-lang.org/std/result/enum.Result.html) where F: FnMut(f64, &
::State), E: [Fn(f64, &::State) -> ControlFlow<B>](https://doc.rust-lang.org/std/ops/function/trait.Fn.html)
Advance adaptively to t_target.
- For a target that advances,
event_checkruns first on the state the stepper currently holds, before any step. A level-triggered event can already hold there, and reporting it after a step would name a state the predicate itself rejects. Terminating there leaves the stepper where it was and calls no callback, since the callback reports accepted steps and none was taken. A lateradvance_totherefore re-evaluates the state it stopped at: for a predicate that only reads the state that is the same answer, but one carrying its own counters sees the endpoint twice. A target the stepper has already reached takes no step, so it asks nothing and reportsReached. - Each accepted step calls
callback(t, &state). - If
event_checkreturnsBreak(reason), returnsEvent { reason }. - On success returns
Reachedwith internal state updated tot_target.
state()
Section titled “state()”fn state(&self) -> &
::State
Current state.
fn t(&self) -> f64
Current time.
fn dt(&self) -> f64
Current adaptive step size.
into_state()
Section titled “into_state()”fn into_state(self) ->
::State
Consume the stepper and return the final state.