Function mechanics_adams_bashforth_2
pub fn mechanics_adams_bashforth_2<C, A, Pos, Vel, For, Float>(
cell: &mut C,
aux_storage: &mut A,
dt: Float,
rng: &mut ChaCha8Rng,
) -> Result<(), SimulationError>where
A: UpdateMechanics<Pos, Vel, For, 1>,
C: Mechanics<Pos, Vel, For, Float> + Position<Pos> + Velocity<Vel>,
Pos: Xapy<Float> + Clone,
Vel: Xapy<Float> + Clone,
Float: Float + FromPrimitive,
Available on crate feature
chili
only.Expand description
Two-step Adams-Bashforth method.
See also the Wikipedia article. We track previous increments of the update steps and use these in order to update the next time steps.
The equations for updating are given by \begin{equation} y(t_{i+2}) = y(t_{i+1}) + \Delta t\left(\frac{3}{12}\frac{dy}{dt}(t_{i+1}) - \frac{1}{2}\frac{dy}{dt}(t_{i})\right) \end{equation}
for both the position and velocity. In the beginning of the simulation, when not enough previous increment values are known, we resort to the euler solver.