# softmatter:Velocity-corrected Verlet Algorithm

(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)

## Algorithm

The velocity-corrected Verlet algorithm yields the higher order of accuracy of velocity at time t as compared to the Velocity Verlet Algorithm by using positions and velocities in a larger window. The algorithm is derived as follow 1 :

Positions are updated in the same way as Velocity Verlet Algorithm:

$\mathbf{r}(t + \Delta t) = \mathbf{r}(t) + \mathbf{v}(t) \Delta t + \frac{\mathbf{f}(t)}{2m} (\Delta t)^2 \qquad \qquad \qquad \qquad \qquad \qquad \qquad [1]$


where $m, \mathbf{r}(t), \mathbf{v}(t)$ and $\mathbf{f}(t)$ are the mass, position and velocity of the particle and the force acting on it at time t.

To correct velocities, first write down Taylor expansions for particle positions at time (t + 2Δt), (t + Δt), (t − Δt) and (t − 2Δt):

$\mathbf{r}(t + 2 \Delta t) = \mathbf{r}(t) + 2\mathbf{v}(t) \Delta t + \mathbf{v}'(t) \frac{(2\Delta t)^2}{2!} + \mathbf{v}''(t) \frac{ (2\Delta t)^3}{3!} + O(\Delta t^4) \quad \quad [2]$

$\mathbf{r}(t + \Delta t) = \mathbf{r}(t) + \mathbf{v}(t) \Delta t + \mathbf{v}'(t) \frac{(\Delta t)^2}{2!} + \mathbf{v}''(t) \frac{ (\Delta t)^3}{3!} + O(\Delta t^4) \quad \quad \quad [3]$

$\mathbf{r}(t - \Delta t) = \mathbf{r}(t) - \mathbf{v}(t) \Delta t + \mathbf{v}'(t) \frac{(\Delta t)^2}{2!} - \mathbf{v}''(t) \frac{ (\Delta t)^3}{3!} + O(\Delta t^4) \quad \quad \quad [4]$

$\mathbf{r}(t - 2 \Delta t) = \mathbf{r}(t) - 2\mathbf{v}(t) \Delta t + \mathbf{v}'(t) \frac{(2\Delta t)^2}{2!} - \mathbf{v}''(t) \frac{ (2\Delta t)^3}{3!} + O(\Delta t^4) \quad \quad [5]$

By subtracting [4] from [3], [5] from [2] and combining them to eliminate the third order terms, we can get the velocity at time t:

$12\mathbf{v}(t) \Delta t = 8[\mathbf{r}(t + \Delta t) - \mathbf{r}(t - \Delta t)] - [\mathbf{r}(t + 2 \Delta t) - \mathbf{r}(t - 2 \Delta t)] + O(\Delta t^4) \quad \quad [6]$


or in an equivalent form

$\mathbf{v}(t) = \frac{\mathbf{v}(t + \Delta t / 2) + \mathbf{v}(t - \Delta t / 2)}{2} + \frac{\Delta t}{12}[\mathbf{v}'(t - \Delta t) - \mathbf{v}'(t + \Delta t)] + O(\Delta t^4) \quad \quad [7]$


where the half time step velocities are defined as

$\mathbf{v}(t - \Delta t / 2) = \frac{\mathbf{r}(t) - \mathbf{r}(t - \Delta t)}{\Delta t}$

$\mathbf{v}(t + \Delta t / 2) = \frac{\mathbf{r}(t + \Delta t) - \mathbf{r}(t)}{\Delta t}$

Velocities at time t are corrected only after new positions and forces are computed. From equation [6] and [7], we can see that velocities are in the fourth order of accuracy, higher than those in Verlet Algorithm and Velocity Verlet Algorithm.

Although this algorithm yields higher order of accuracy in velocities than previous Verlet algorithms, its implementation is more complicated since additional velocities and positions at previous time steps t − Δt should be stored every time step.