# Andersen thermostat

The Andersen thermostat was the first thermostat proposed for molecular dynamics, thus permitting one to use the canonical ensemble (NVT) in simulations. The Andersen thermostat (Ref. [1], section IV) couples the system to a heat bath via stochastic forces that modify the kinetic energy of the atoms or molecules. The time between collisions, or the number of collisions in some (short) time interval is decided randomly, with the following Poisson distribution (Eq. 4.1):

${\displaystyle P(t)=\nu e^{-\nu t}.}$

where ${\displaystyle \nu }$ is the stochastic collision frequency. Between collisions the system evolves at constant energy, i.e. business as usual. Upon a 'collision event' the new momentum of the lucky atom (or molecule) is chosen at random from a Boltzmann distribution at temperature ${\displaystyle T}$. In principle ${\displaystyle \nu }$ can adopt any value. However, there does exist an optimum choice (Eq. 4.9):

${\displaystyle \nu ={\frac {2a\kappa V^{1/3}}{3k_{B}N}}={\frac {2a\kappa }{3k_{B}\rho ^{1/3}N^{2/3}}}}$

where ${\displaystyle a}$ is a dimensionless constant, ${\displaystyle \kappa }$ is the thermal conductivity, ${\displaystyle V}$ is the volume, ${\displaystyle k_{B}}$ is the Boltzmann constant, and ${\displaystyle \rho }$ is the number density of particles; ${\displaystyle \rho :=N/V}$.

Note: the Andersen thermostat should only be used for time-independent properties. Dynamic properties, such as the diffusion, should not be calculated if the system is thermostated using the Andersen algorithm [2].