Function mechanics_euler

pub fn mechanics_euler<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, 0>, C: Mechanics<Pos, Vel, For, Float> + Position<Pos> + Velocity<Vel>, Pos: Xapy<Float> + Clone, Vel: Xapy<Float> + Clone, Float: Float + Copy,
Available on crate feature chili only.
Expand description

Classical euler solver for the Mechanics trait.

The euler solver is the most simple solver and not stable for many problems. Thus its usage is discouraged. For another general-purpose solver look at mechanics_adams_bashforth_2.

The update step follows the simple equations \begin{align} x(t_{i+1}) &= x(t_i) + \Delta t \frac{d x}{d t}(t_i)\\ v(t_{i+1}) &= v(t_i) + \Delta t \frac{d v}{d t}(t_i) \end{align} where $\Delta t$ is the step size and $dx/dt$ and $dv/dt$ are calculated by the calculate_increment method.