This module uses a new GROMACS grid: alanine dipeptide (22 atoms) in a 1546-atom TIP3P box; 8 thermostat runs (4 ns) and 6 barostat runs (2 ns), the same starting structure, a single seed, GROMACS 2023.3. The run and analysis plan was written before the results and frozen with SHA-256. The real frames of the runs are played in 3D; MSD and autocorrelation curves and a Ramachandran map per thermostat are shown. The thermostat toy (a periodic chain) and the temperature jump are computed in your browser right now. No result has been invented; everything that was not computed is marked "This scenario was not computed".
MD-CON · Controlling the simulation without spoiling the question

What do thermostats and barostats hold constant, what do they distort, and how do you record your choice?

The algorithms that hold temperature and pressure in a simulation can also affect fluctuations and dynamics. In this lab you will look at how far the distributions of the instantaneous temperature and the volume deviate from theory, and how much the motion of the water and the molecule changes, when the algorithm and the coupling time change in the same system. At the end you prepare a "reasons record" that states your choice, what you checked and what you did not check.

Discoveries: 0 / 10
Experimental bridge

Temperature jump: the same τ, a different time

When you bring a sample in the laboratory to another temperature (moving an NMR probe to a new temperature, or a temperature-jump experiment), the temperature approaches the new value with a time constant. A thermostat likewise pulls the system to a new target with a time constant when you change the target temperature abruptly, but the number you write as "τ" does not describe the same physical time in every algorithm. Below, the average of 160 copies of a 16-particle chain (all toward the same target, T = 1 → 1.5; 9-point centered moving average) is drawn; the dashed line is an exponential approach with time constant τ. The time unit is a toy unit (in the harmonic approximation the vibration periods of the chain lie between about 2.8 and 6.3 units).

Thermostat τ:
Open

Same τ, same time?

Choose at least two of τ = 1, 3 and 10. Compare each algorithm's 63% approach time to τ.

1 · Workshop: thermostat

Does the instantaneous temperature fluctuate as theory says?

For the canonical ensemble the standard deviation of the instantaneous temperature is theoretically T√(2/N) (N degrees of freedom; here N = 3099 and SD = 7.62 K, derived in the MD-ENS module). Below is the instantaneous temperature given by four thermostats with two coupling times (0.1 and 1.0 ps) in the same system. The line is the theoretical bell curve of the distribution. Look at the ratio of the run's SD to the theoretical SD, the skewness and the TV distance. Preregistered threshold: a ratio between 0.9 and 1.1 is "consistent with theory", outside it is "deviates from theory". Below, the ratios of the eight runs side by side; click a bar to select that run.

Thermostat:
τ:

The memory of temperature: autocorrelation curves

The relation between the instantaneous temperature and its value Δt later. Where the curve crosses the 1/e line is the "autocorrelation 1/e time" in the readout. Because the samples are 0.2 ps apart the curve has a coarse resolution. Hover to see the value of each run; use the buttons to hide runs and overlay them (dashed line: τ_T 1.0 ps).

Open

Do the four thermostats give the same fluctuation?

Choose at least two different thermostats and look at the SD ratio of the eight runs. Which are inside the threshold?

Open

What happens when τ changes?

Select the same thermostat for τ = 0.1 and 1.0 ps one by one. How do the ratio and the autocorrelation time change?

2 · Workshop: coupling time and dynamics

Does it change the motion too?

A question as important as the temperature distribution: when the algorithm and τ change in the same system, does the motion of the water and the molecule change? Below are water diffusion, ψ transition rate, αR fraction and conserved-energy drift for eight runs (GROMACS did not write the conserved-energy term in the Langevin runs, so those two cells are "not computed"). Each run has a single seed: whether a difference comes from the thermostat or the seed cannot be told apart in this grid; so read the numbers as "measured values", not as a ranking.

The real box: two runs side by side

Speed:

The frames were taken from each run between 1000 and 1080 ps, at 1 ps intervals. The peptide was moved to the box center for display only (trjconv -center). The box is the real unit cell of the system: the triclinic unit cell of the rhombic dodecahedron box. Because the trajectory holds no velocities, water oxygens are colored not by speed but by their displacement in the last 1 ps. The transition between frames is smoothed on screen by linear interpolation; the numbers in the readout are computed from the real frames only. Drag the box to rotate it.

Dynamic measures in eight runs

Measure:

Mean squared displacement of water (MSD)

D was taken from the slope of these curves between 10 and 100 ps (MSD = 6Dt). The steeper the curve, the faster the water spreads. Hover to see the value of each run; dashed line τ_T 1.0 ps.

Where the peptide went: a Ramachandran map per thermostat

Each map is the φ/ψ distribution of one run after 200 ps (1 ps interval, 3801 frames). The lines show the αR, β/PPII and αL boundaries. The maps come from single seeds: differences can come from the thermostat or from the seed.

Open

What does the conserved energy say?

Switch to the "conserved-energy drift" measure and look at the values of six runs (not computed for Langevin).

Open

How much do the dynamics depend on the algorithm?

Look at both water diffusion and the ψ transition rate. Is the difference larger than the error bar and the seed scatter?

3 · Workshop: barostat

How do volume and pressure fluctuate?

A barostat keeps the pressure at its target by changing the box volume. Below is the volume given by three barostats (C-rescale, Berendsen, Parrinello-Rahman) with two coupling times (1 and 5 ps); all were started from the same equilibrated system with the same V-rescale thermostat (τ 0.1 ps). The dashed line is the theoretical volume fluctuation computed with the compressibility given in the mdp (a reference; not the real TIP3P value).

Barostat:

The memory of volume: autocorrelation curves

A curve that dips below zero and rises again shows that the volume oscillates. Hover to see the value of each run; dashed line τ_P 1 ps.

The real box breathes: Berendsen and Parrinello-Rahman (τ_P 5 ps)

Magnification:
Speed:

The frames were taken from the two runs between 1000 and 1080 ps, at 1 ps intervals. The box edge moves by a few parts per thousand in this window; at real scale this cannot be seen. So on screen the deviation of the volume from its window average is magnified by the chosen factor and the molecules are scaled with the box. The volume plot below is not magnified; the numbers are computed from the real frames only.

Open

Do the three barostats give the same volume distribution?

Choose at least two different barostats and look at the volume SD ratio.

Open

How does τ_P change the timescale of the volume?

Select the same barostat for τ_P = 1 and 5 ps. How do the autocorrelation time and the oscillation period change?

Interlude · assessment

Why is Berendsen not used in production runs?

Mechanism. Berendsen coupling pulls the temperature (or pressure) to its target with a first-order, noise-free relaxation: at each step the velocities are scaled by λ = √(1 + (Δt/τ)(T₀/T − 1)), so that dT/dt ≈ (T₀ − T)/τ. With the barostat the box is scaled by the same logic. This closes a deviation quickly and stably; but it also suppresses the natural fluctuations that the canonical ensemble should have. The result: the average stays on target, while the distribution is not that of the correct ensemble.

Evidence on this page. The numbers below are read from the real runs and the toy of this page.

Practical consequence: every quantity computed from fluctuations comes out wrong. For example, the isothermal compressibility is computed from the volume fluctuation as κ = σ_V² / (k_B T ⟨V⟩). The value given by six barostat runs in the same system:

What it did not distort. In this grid the averages of Berendsen could not be told apart from the other algorithms: So the problem is not in the average but in the distribution; a check that does not look at fluctuations will not see this error.

When it is acceptable. In the equilibration stage: it is widely used because it approaches the target quickly and stably from a distant start. For production runs the V-rescale thermostat and the C-rescale barostat are recommended instead; both add a noise term of the correct size to Berendsen's first-order relaxation and sample the canonical (for the barostat, isobaric) distribution (Bussi et al. 2007; Bernetti and Bussi 2020).

The tool says so too. In the Berendsen runs of this grid GROMACS 2023.3 (grompp) gave the following warning, and the runs could only be started by accepting it (-maxwarn 1). For the thermostat: "The Berendsen thermostat does not generate the correct kinetic energy distribution, and should not be used for new production simulations (in our opinion). We would recommend the V-rescale thermostat." For the barostat: "The Berendsen barostat does not generate any strictly correct ensemble, and should not be used for new production simulations (in our opinion). We recommend using the C-rescale barostat instead."

Sources. Berendsen HJC, Postma JPM, van Gunsteren WF, DiNola A, Haak JR. Molecular dynamics with coupling to an external bath. J Chem Phys 1984;81:3684-3690. doi:10.1063/1.448118 · Bussi G, Donadio D, Parrinello M. Canonical sampling through velocity rescaling. J Chem Phys 2007;126:014101. doi:10.1063/1.2408420 · Bernetti M, Bussi G. Pressure control using stochastic cell rescaling. J Chem Phys 2020;153:114107. doi:10.1063/5.0020514

4 · Bench

The thermostat toy: when N and τ change

In the real system we know the theoretical distribution only for the temperature SD; here the whole distribution is known (a gamma distribution with shape parameter N/2). Run an N-particle chain with four thermostats, and change N and τ. The yellow band is the theoretical ±1 SD band of the temperature. The simulation flows continuously; changing a setting starts a new run. Run at least 2·10⁴ steps and Log it.

Thermostat:
N:
τ:
Speed:
Stop:

Open

Holding the average is not holding the fluctuation

Run Berendsen and V-rescale with the same N, τ and seed for at least 2·10⁴ steps and Log both.

Open

When the system gets smaller

With the same thermostat and τ, Log runs for N = 8 and N = 64 (or at least a fourfold difference).

Open

Same name, different τ

With the same thermostat and N, Log runs for τ = 1 and τ = 10.

5 · Notebook

Notebook of your toy runs

Every run you record with the Log it button on the bench is written here. "SD / theory" in the table is the ratio of the measured temperature SD to √(2/N); TV is half the difference between the run's histogram and the gamma distribution (0 identical, 1 no overlap at all).

6 · Back to the protein

A reasons record for your own run

When reporting a protein run, "I used V-rescale" is not enough: why, which τ, what did you check, what did you not check? Choose your settings below and write three short notes; the page builds a record text, automatically adding the values measured in this grid (for settings that have a counterpart in the grid) and what was not measured. The scope of this grid is a peptide in a 1546-atom box; the numbers do not transfer to your protein system, they only teach the format of the record and the questions.


    
7 · Test yourself

Six short questions

Terms in this module

The definition of each term and the other modules where it appears are in the glossary.