Statistical Mechanics – Why is the Canonical Ensemble Used for Molecular Dynamics Simulations?

computational physicscondensed-mattermolecular dynamicsphysical-chemistrystatistical mechanics

Molecular dynamics (MD) simulation is a common approach to the (classical) many-body problem. It relies on integration of Newton's equations of motion to simulate the trajectories of many (e.g., ~1,000-100,000) particles.

In my limited exposure to the MD literature, a recurring theme that I think I see (at least on the chemical physics end of things) is that MD simulations are often performed in the canonical ($NVT$) ensemble. Why does this seem to be the case?


Here are the common thermodynamic ensembles:

  • Microcanonical ensemble ($NVE$)

    • The system is isolated.
    • The total energy $E$ is fixed.
    • Every accessible microstate has equal probability. That is, if $\Omega$ is the number of accessible microstates, the probability that a system is in a particular microstate is $\frac{1}{\Omega}$.
    • Please correct me if I am wrong, but I think that the microcanonical ensemble satisfies ergodicity — time averages can be replaced with ensemble averages.
  • Canonical ensemble ($NVT$)

    • The system is not isolated. The system can exchange energy with a heat bath. The total energy of the system + bath is fixed. The average or equilibrium energy of the system is constant.
    • The absolute temperature $T$ is well-defined. (Is $T$ fixed? I think so.) $T$ is given by the temperature of the heat bath.
    • The probability of finding the system in some microstate $i$ with energy $E_i$ is given by the Boltzmann distribution: $$p_i = \frac{e^{-\frac{E_i}{k_B T}}}{\sum_i e^{-\frac{E_i}{k_B T}}}$$
  • Isothermal-isobaric ensemble ($NPT$)

    • The absolute temperature $T$ and the pressure $P$ are fixed.

Looking at this non-exhaustive list of choices, it seems that we can eliminate the $NVE$ ensemble from consideration because "real world" chemistry involves energy exchange with the environment.

MD simulations typically do not model chemical reactions, but still, I would say that most chemistry in the "real world" occurs at nearly constant pressure (e.g., atmospheric pressure). So the $NPT$ ensemble seems like a reasonable candidate.

What about the $NVT$ ensemble? Constant temperature perhaps seems reasonable for equilibrium, "real world" chemistry, but I am not so sure about constant volume.

Now let's jump back to my very rudimentary of MD simulations in the literature. In MD simulations, molecules sit in a simulation box to which periodic boundary conditions are applied. From reading some literature articles it seems that the $NPT$ ensemble is used for equilibration — to obtain the simulation box size that gives an average pressure of, for example, 1 atm. Then, the system is simulated in the $NVT$ ensemble — that is, the simulation box's dimensions are held fixed, hence fixing the system volume. It is from this simulation in the $NVT$ ensemble that ensemble averages are computed and the system's chemistry is analyzed.

Why is the $NVT$ ensemble used for MD simulation production runs?

Best Answer

The reason is that it is just annoying to have the volume of a simulation fluctuate. What do you do if you want to change the volume? Have periodic boundaries that move? Then you need equations of motion for the boundaries.

To thermalize water molecules you can just bounce them off a boundary wall with a Maxwellian distribution of velocities (or do this some other way, like picking a molecule at random and making it's velocity maxwellian with velocity v every once in a while). This implements a temperature in an easy way.

If you want to implement a fixed pressure ensemble, you need to allow the volume to fluctuate. This is much more numerically annoying than allowing the energy to fluctuate. You would need to simulate the walls of the simulation container moving, or the periodic boundaries shrinking, and calculate the force required to shrink the boundaries or move the walls, and this is a terrible headache.

It's also an unnecessary headache, because a constant volume simulation and a constant pressure simulation are equivalent at large numbers of particles. This is also true of a constant temperature and constant energy simulation. In order to make the pressure right, all you have to do is put in enough water molecules to make the density of water the right one for the appropriate temperature, and this is something that's easy to do numerically. The fluctuations in the pressure are not a worry, the only worry is that the pressure you are simulating at is far too low or far too high.

Related Question