NVE, NVT, and NPT Ensembles in Molecular Dynamics: what they mean and when to use them
In MD simulations, the choice of ensemble defines what the simulation keeps constant: energy, temperature, pressure, or particle number. This article explains the four main ensembles (NVE, NVT, NPT, and grand-canonical) and the standard protocol for using them in GROMACS.
The microcanonical ensemble (NVE)
Let’s start with the most basic one.
In the NVE ensemble, the system has constant moles (N), volume (V), and energy (E). The microcanonical ensemble, therefore, corresponds to an isolated system that can not exchange heat or matter with the outer environment.
The result is a system where the total energy is conserved but fluctuations in potential and kinetic energy ($E_{tot}=K+V$) are still allowed.
A typical MD simulation starts from an unstable initial structure characterized by high potential energies that need to be minimized. As a result, since the total energy needs to be conserved, a decrease in $V$ corresponds to an increase in kinetic energy $K$ translating into higher temperatures.
A sudden increase in temperature may lead to some problems. For instance, a protein may unfold when we increase the temperature causing an unsuccessful experiment.
The microcanonical NVE ensemble is not always appropriate to perform MD simulations.
The canonical ensemble (NVT)
In the NVT ensemble, moles (N), volume (V), and temperature (T) are kept constant. In this case, the system is allowed to exchange heat with outer space so that the temperature stays constant. We can imagine it as a system being immersed in a giant thermostat.
This condition is achieved by simply scaling the velocities of the system so that we adjust the kinetic energy and, consequently, the temperature. If the temperature is too low we increase the velocities and vice versa. In this way, we are able to implement a thermostat in our experiment.
The NVT ensemble is commonly used in MD simulations to mimic systems at a constant temperature. We already talked about the different ways to achieve Molecular Dynamics at constant temperature in another article.
The Isothermal-Isobaric Ensemble (NPT)
Moles (N), pressure (P), and temperature (T) are conserved. This ensemble is more flexible than the one we previously saw. Our system is allowed to exchange heat and, at the same time, we can adjust the volume so that the pressure is kept constant.
Therefore, the pressure is manipulated by constantly rescaling one or multiple dimensions of the simulation box.
A simulation environment that keeps the pressure constant is called a barostat.
The NPT ensemble is great to simulate chemical reactions which are usually carried out at constant pressure in the laboratory. We have an article dedicated to the different ways to implement a barostat in Molecular Dynamics.
The Grand-Canonical Ensemble ($\mu$VT)
Chemical potential ($\mu$), volume (V), and temperature (T) are constant. The main difference with the above ensembles is that the number of molecules is allowed to fluctuate during the simulation. The system is assumed to be open and can exchange heat and particles with a very large reservoir. The two systems are in equilibrium, they can exchange matter between each other while the heat reservoir acts as a thermostat. This is usually not supported by most Molecular Dynamics software.
The vast majority of experimental observations are performed within an NPT, $\mu$VT, and NVT ensemble. On the other side, microcanonical ensembles (NVE) are rarely used in real experiments and, therefore, also in MD.
Which ensembles are the most common in MD?
Performing an MD simulation requires you to perform different steps which have already been detailed in other articles.
As a result, a standard MD procedure is not performed within a single ensemble but is composed of different simulations carried out within different ensembles. In GROMACS, you can specify the ensemble you want to use by setting the appropriate parameters in the mdp files.
A typical course of action is the one reported in Figure 1.
Figure 1 Standard procedure for MD simulation
First of all, we perform an MD simulation in the NVT ensemble to bring the system to the desired temperature. Most of the time, this is needed even if our goal is to bring the system under constant pressure.
The NVT step is followed by a simulation in the NPT ensemble. Overall, the first two steps are needed to equilibrate the system, and are therefore named equilibration steps.
After the system is equilibrated we can start our real simulation at constant pressure mimicking laboratory conditions. After this phase, named production run, we will collect our data.
The above example is just one of the many ways you can choose to setup a simulation protocol. If you want to learn more about setting up simulations here you can find GROMACS tutorial providing a more detailed explanation of the process.
Setting the Ensemble in GROMACS: Key mdp Parameters
The ensemble is controlled by the coupling settings in your mdp file. Here are the minimal relevant parameters for each ensemble.
NVE (no coupling):
|
|
NVT (temperature coupling, no pressure coupling):
|
|
NPT (temperature and pressure coupling):
|
|
For water-based biological systems, compressibility = 4.5e-5 bar$^{-1}$ is the standard value at 300 K and 1 bar. For a full discussion of thermostat and barostat options, see the dedicated articles on thermostats and barostats in MD.
Putting this into practice? Equilibrating under NVT and then NPT before the production run is a standard part of any GROMACS workflow. My complete GROMACS protein-in-water guide walks through those exact stages, from PDB file to analysed trajectory, with every MDP file and script included. Get the guide →