# Integrators

A dynamics simulation integrates the differential equations of motion.
We have,
\begin{align}
    \frac{dv}{dt} &= a \\
    \frac{dx}{dt} &= v
\end{align}
where $x$ is position, $v$ is velocity and $a$ is acceleration.
There is extensive research on integrators and their properties for dynamic
systems. Here, we focus on two commond ones: the simple Euler integrator and
the slightly more advanced Leapfrog integrator. The integrators are implemented
in separate classes and can be extended, e.g. with Runge-Kutta methods.

## Euler

The Euler integrator is a simple first-order method.

\begin{align}
    x_{t+1} &= x_t + v_t \Delta t \\
    v_{t+1} &= v_t + a_t \Delta t 
\end{align}


## Leapfrog

Reference {cite}`birdsall2004plasma`.
The main integrator used here is the Leapfrog integrator. It has only a very 
small computational overhead compared to the Euler method.

\begin{align}
    x_{t+1} &= x_t + v_t \Delta t + \frac{1}{2} a_t \Delta t^2 \\
    v_{t+1} &= v_t + \frac{1}{2}(a_t + a_{t+1}) \Delta t 
\end{align}

91bb556ed3ed7498af3858c6550aa56e1ad51d14
ipynb
Jupyter Notebook
guide/integrators.ipynb
svenkreiss/socialforce
c1dde8cc25979d68f67ede1bb77ce09a0406af0e
MIT
2018-09-10T13:34:57.000Z
2022-03-30T00:03:16.000Z
guide/integrators.ipynb
svenkreiss/socialforce
c1dde8cc25979d68f67ede1bb77ce09a0406af0e
MIT
2018-10-15T14:49:52.000Z
2022-01-20T00:50:49.000Z
guide/integrators.ipynb
svenkreiss/socialforce
c1dde8cc25979d68f67ede1bb77ce09a0406af0e
MIT
2018-10-07T16:14:08.000Z
2022-03-30T00:03:19.000Z
Qwen/Qwen-72B
1. YES
2. YES