StormerVerlet
Defined in: verlet.rs:15
pub struct StormerVerletStörmer-Verlet (velocity Verlet) symplectic integrator.
A 2nd-order symplectic method for separable Hamiltonian systems (where acceleration depends only on position, not velocity). Exactly preserves phase-space volume and has excellent long-term energy conservation properties.
Only works with 2nd-order ODE states (State<DIM, 2>).
Methods
Section titled “Methods”step()
Section titled “step()”fn step<const DIM: usize, S>(&self, system: &S, t: f64, state: &State<DIM, 2>, dt: f64) -> State<DIM, 2> where S: [DynamicalSystem<State = State<DIM, 2>>](../../traits/dynamicalsystem/)
Perform a single Störmer-Verlet (velocity Verlet) step.
Kick-drift-kick form:
- v_{1/2} = v_n + (dt/2) * a(t_n, q_n)
- q_{n+1} = q_n + dt * v_{1/2}
- v_{n+1} = v_{1/2} + (dt/2) * a(t_{n+1}, q_{n+1})
integrate()
Section titled “integrate()”fn integrate<const DIM: usize, S, F>(&self, system: &S, initial: State<DIM, 2>, t0: f64, t_end: f64, dt: f64, callback: F) -> State<DIM, 2> where S: [DynamicalSystem<State = State<DIM, 2>>](../../traits/dynamicalsystem/), F: [FnMut(f64, &State<DIM, 2>)](https://doc.rust-lang.org/std/ops/function/trait.FnMut.html)
Integrate from t0 to t_end with fixed step size dt.
integrate_with_events()
Section titled “integrate_with_events()”fn integrate_with_events<const DIM: usize, S, F, E, B>(&self, system: &S, initial: State<DIM, 2>, t0: f64, t_end: f64, dt: f64, callback: F, event_check: E) -> [IntegrationOutcome<State<DIM, 2>, B>](../../enums/integrationoutcome/) where S: [DynamicalSystem<State = State<DIM, 2>>](../../traits/dynamicalsystem/), F: [FnMut(f64, &State<DIM, 2>)](https://doc.rust-lang.org/std/ops/function/trait.FnMut.html), E: [Fn(f64, &State<DIM, 2>) -> ControlFlow<B>](https://doc.rust-lang.org/std/ops/function/trait.Fn.html)
Integrate with event detection and NaN/Inf checking.