# softmatter:Velocity autocorrelation function

The velocity autocorrrelation function, VACF or Cvv, is a autocorelation function relating to the dynamics of a system. The VACF shows how closely the velocity of a particle at a time t is correlated with the velocity at a reference time.

It is calculated as follows:

$C_{vv}(t) = \frac{1}{N}\sum_{i=1}^{N}\frac{\left \langle \mathbf{v}_i(t)\cdot \mathbf{v}_i(0) \right \rangle}{\left \langle \mathbf{v}_i(0) \cdot \mathbf{v}_i(0) \right \rangle}$

where N is the number of particles in the system, and vi(0) is the starting (reference) time.

The diffusion coefficient can be calculated from the VACF by integrating the area under the curve, and multiplying by the temperature, as detailed by the Green-Kubo relation:

$D = T \lim_{t \to \infty} \int_{0}^t dt' C_{vv}(t')$

For more information and examples refer to the calculating the diffusion coefficient page.