Boltzmann distribution

This module initialises particle velocities from a Boltzmann distribution.

The velocity distribution per degree of freedom is a Gaussian with mean \mu_{v} = 0 and width \sigma_{v} = \sqrt{\frac{kT}{m}},

f\left(v\right) = \sqrt{\frac{m}{2\pi kT}} \exp\left(\frac{-mv^2}{2 kT}\right)

To account for the finite size of the system, the velocities are shifted,

\vec{v}_\text{shifted} \equiv \vec{v} - \vec{V}_\text{cm}

to yield a centre of mass velocity of zero, and scaled,

\vec{v}_\text{scaled} \equiv \vec{v}_\text{shifted}\;
\sqrt{\frac{\frac{1}{2} kT f N}{E_\text{kin}
- \frac{1}{2} M\left(\vec{V}_\text{cm}\right)^2}}

to yield the temperature T for a system with f positional degrees of freedom, using centre of mass velocity and kinetic energy,

\vec{V}_\text{cm} &= \frac{\vec{P}_\text{cm}}{M}
= \frac{\sum_{n = 1}^N m_n \vec{v}_n}{\sum_{n = 1}^N m_n} \\

E_\text{kin} &= \frac{1}{2} \sum_{n = 1}^N m_n v_n^2

class halmd.mdsim.velocities.boltzmann(args)

Construct boltzmann module.

  • args (table) – keyword arguments
  • args.particle – instance of halmd.mdsim.particle
  • args.temperature (number) – temperature of distribution

Initialise particle velocities from Boltzmann distribution.


Temperature of the distribution in reduced units. The value can be changed by assignment.