This module covers the last two steps of preparing a protein box for dynamics: minimization and equilibration. The water box in the workshop and on the bench is computed in your browser right now; the ubiquitin numbers and images come from this project's real GROMACS runs.
MD-EQ · Minimization and equilibration

From clashing atoms to equilibrium: minimization and equilibration

Hydrogens are added to the crystal structure and a box of water is poured around it. In this setup some atoms end up much closer to each other than they should be. If motion is started right away, these clashes produce huge forces and the simulation blows up in its first steps. In this lab you will first remove the clashes (minimization), then bring the system to the target temperature (equilibration), and measure from this project's real log whether it has reached equilibrium.

Discoveries: 0 / 5
Experimental bridge

You wait before you measure

When you put a cuvette into the thermostatted holder of a spectrophotometer, you do not take the reading at once; you wait until the sample reaches the temperature of the holder. In ITC or DSC, too, the measurement starts only after the baseline has settled. MD has the same two steps. First the atoms left "in the wrong place" by the setup are fixed, then the system is left to itself at the target temperature and pressure. Only after that does the measurement, the production run, begin.

The closer two atoms get, the harder they are pushed apart. Below is the Lennard-Jones interaction between two TIP3P water oxygens. Change the distance: the repulsive force grows very fast below σ.

Energy
Same energy in units of kT (300 K)
Force

TIP3P oxygen-oxygen parameters: σ = 0.31506 nm, ε = 0.63639 kJ/mol (tip3p.itp shipped with amber99sb-ildn). The two marks on the plot come from this project's real minimization: the largest initial force, 196,569 kJ mol⁻¹ nm⁻¹ (with LJ alone this force corresponds to an approach to 0.175 nm), and the stopping criterion emtol = 1,000 kJ mol⁻¹ nm⁻¹ (0.260 nm).

1 · Workshop

What happens if you start without minimizing?

The box holds 125 rigid water molecules (TIP3P geometry and charges; red oxygen, white hydrogen). The box is a three-dimensional cube with an edge of 1.55 nm; you can rotate it by dragging with the mouse or your finger. The box has been equilibrated beforehand; GROMACS's solvate command also copies water from such a ready-made box. Clashes come from what is added to the box afterwards: the hydrogens added to the protein, the waters placed by solvate, the ions placed by genion. Here, instead, a few water molecules are squeezed into the box; the squeezed ones are marked with a dark ring. Start the dynamics first without minimizing. The dynamics lasts 10 ps (5,000 steps); the last 0.5 ps of each molecule's path is drawn with a thin line, and the whole path of three marked molecules with a gold line. In liquid water a molecule travels about half a nanometer on average in 10 ps, one and a half times its own diameter.

Setup
State
Minimization steps (accepted / tried)
Largest force Fmax (kJ mol⁻¹ nm⁻¹)
Closest two atoms of different molecules
Temperature, now / highest
Mean displacement of the oxygens from the start
Largest atom displacement in the last step (O-H bond 0.096 nm)

Minimization: Fmax (logarithmic)Dynamics: temperatureDashed lines: emtol = 1,000 kJ mol⁻¹ nm⁻¹ and the target temperature of 300 K

Model: rigid TIP3P water in a three-dimensional periodic cubic box: O-H 0.09572 nm, H-O-H 104.52°, charges O −0.834 e and H +0.417 e; Lennard-Jones only between oxygens (σ = 0.31506 nm, ε = 0.63639 kJ/mol). Interactions are cut per molecule: they are smoothly switched to zero as the oxygen-oxygen distance goes from 0.60 to 0.75 nm. This cut-off, which suits the small box, stands in for GROMACS's PME and is not as accurate. Real units: step 2 fs, V-rescale 300 K, τT = 0.1 ps; minimization with GROMACS's steepest-descent rule (emstep 0.01 nm, emtol 1,000). Water molecules are kept rigid with SHAKE (GROMACS uses SETTLE for water). If a water molecule rotates by more than 30° in one step a warning is written; if the constraints cannot be satisfied the program stops. The equilibrated box was started from a lattice, minimized, melted for 5 ps at 600 K and equilibrated for 15 ps at 300 K. Measured in this box: diffusion coefficient D ≈ 4.0 × 10⁻³ nm²/ps, potential energy per molecule ≈ −40.6 kJ/mol. Published values for TIP3P are D ≈ 5.9 × 10⁻³ nm²/ps and ≈ −41 kJ/mol; a small periodic box is known to lower diffusion (Yeh and Hummer 2004).

2 · Bench

How does a thermostat bring the temperature there?

After minimization the atoms are given initial velocities (gen_vel) and a thermostat pulls the system to the target temperature. τT sets how tightly the thermostat pulls. In the same equilibrated water box, change the starting temperature, the thermostat and τT; look at how long the temperature takes to reach the target and how much it fluctuates around it.

Thermostat
Starting temperature
Reaching ±5% of the target (averaged over 0.13 ps)
Mean of the last 2.5 ps
Fluctuation in the last 2.5 ps (standard deviation)
Fluctuation of the correct distribution

Model: the equilibrated 125-molecule water box of the workshop; step 2 fs, 2,500 steps. V-rescale (Bussi, Donadio and Parrinello 2007) scales the kinetic energy with a random term and gives the canonical distribution; Berendsen only damps the difference and keeps the fluctuation smaller than it should be. The fluctuation of the correct distribution is T·√(2/Nf); each rigid water molecule carries 3 translational and 3 rotational degrees of freedom and the total momentum is kept fixed: Nf = 6 · 125 − 3 = 747, a fluctuation of 15.5 K at 300 K. This project's setting: V-rescale, τT = 0.1 ps, 300 K.

Why is Berendsen not used in production?

You saw it above: Berendsen puts the mean exactly at 300 K, but lets the temperature fluctuate less than it should. If the mean is right, why is that a problem? Because in MD some measurable quantities are computed not from a mean but from a fluctuation. The most familiar one is the heat capacity: the simulation counterpart of the Cp you measure by DSC comes from the fluctuation of the total energy at constant temperature, CV = σE² / (kB T²). This formula holds only if the correct ensemble is sampled. Below, the two thermostats run side by side for 10 ps with the same box, the same initial velocities and the same τT = 0.1 ps; the first 2.5 ps are discarded.

V-rescaleBerendsen
Mean temperature, K (target 300)··
Temperature fluctuation, K (correct 15.5)··
Total energy fluctuation, kJ/mol··
Heat capacity from the fluctuation, J mol⁻¹ K⁻¹ (correct ≈ 74)··

V-rescaleBerendsenCorrect distribution: mean 300 K, standard deviation 15.5 K

The correct heat capacity in the table was computed not from a fluctuation but from means: in this model two runs of 20 ps each were made at 270 and at 330 K, and the difference in mean energy was divided by the difference in temperature. V-rescale gave 73 and Berendsen 75 J mol⁻¹ K⁻¹; the means are right with both thermostats (the Cp of real water is 75.3 J mol⁻¹ K⁻¹). A value computed from the fluctuation is noisy in a short run; your run also gives a slightly different number each time. But Berendsen's shortfall is much larger than this noise. In our runs at 300 K with different initial velocities and lengths of 10 to 20 ps, V-rescale gave values between 39 and 110 (18 runs, mean 73, the same as the value from the means); Berendsen gave between 5 and 28 (16 runs, mean 12). Someone who runs production with Berendsen and computes a heat capacity finds roughly one sixth of what a calorimeter would show. Pressure has the same problem: the Berendsen barostat suppresses volume fluctuations and spoils a compressibility computed from them.

A second flaw builds up in long runs: Berendsen transfers kinetic energy from fast vibrations to slow translation and rotation, and in the end the system moves as a whole like a "flying ice cube" (Harvey, Tan and Cheatham 1998; Braun, Moosavi and Smit 2018). Because the water here is rigid, that is, it does not vibrate, this box cannot show that effect; in our 20 ps runs we saw no separation between the translational and rotational temperatures beyond the noise.

What Berendsen does well is equilibration: it brings the system to the target quickly and without oscillation. Production, however, needs a thermostat that samples the ensemble correctly: V-rescale (this project's setting) or Nosé-Hoover. That is why GROMACS writes this note at the grompp stage when Berendsen is chosen: The Berendsen thermostat does not generate the correct kinetic energy distribution.

Heat capacity: CV = σE² / (kB T²), with E the sum of kinetic and potential energy, divided by the 125 molecules. In a short run a single value can fall anywhere between half and one and a half times the mean of many runs. As τT grows, Berendsen approaches a run without a thermostat (NVE); as it shrinks, a constant kinetic energy: in our 20 ps runs the temperature fluctuation was 6.2 K at τT = 0.01 ps, 11.0 K at 0.1 ps and 12.8 K without a thermostat; V-rescale 15.5 K.

Open

What does minimization prevent?

In the workshop, start the dynamics in a squeezed box once without minimizing and once after minimizing.

In the same squeezed setup, start the dynamics first without minimization, then with minimization.
Open

What does τT change?

On the bench, try at least three values of τT with V-rescale, then look at Berendsen.

Run at least three values of τT with V-rescale (the largest at least ten times the smallest), then make one run with Berendsen.
Open

Has the density settled?

In the notebook below, measure the NPT density with two different "discarded starts"; look at the pressure as well.

Measure the NPT density with at least two different discarded starts (one 0, one at least 4 ps) and one pressure series.
Open

Why is Berendsen absent from production?

In the test at the bottom of the bench, run the two thermostats side by side.

Run the two thermostats side by side in the same box for 10 ps; look at the temperature distribution and the heat capacity.
Open

Where are the bonds that broke?

In "Back to the protein", first minimize one site, then step through to the last frame in the mode without minimization.

Follow the same site (other than the two waters) once with minimization to the end and once to the last frame in the mode without minimization.
3 · Discovery notebook

Measure from the log: is the system at equilibrium?

The data come from the real energy files of this project's ubiquitin box (S0: 18,937 atoms; NVT and NPT for 10 ps each with position restraints, then 10 ps unrestrained). Each series is 51 values 0.2 ps apart. Choose a series, set how much of its start to discard and measure: the mean, the standard deviation and the means of the two halves of the remaining time are computed.

Series

No measurements.

Chosen seriesMean of the remaining partMeans of the two halvesFaded: discarded start
SeriesDiscarded (ps)MeanStandard deviation1st half / 2nd half
4 · Back to the protein

This project's minimizations and the run without minimization

Where the clashes are: this project's real box

The view shows the ubiquitin of this project's main box at the real coordinates from the file (S0: 1,231 protein atoms and 5,902 waters, 18,937 atoms in all). The starting point is the box solvated but not minimized (solvated.gro). The five sites with red rings were chosen from where the atoms are most squeezed. Choosing one zooms the view in and also draws the waters around it. Compare the two modes: With minimization shows the same site before and after minimization (em.gro). Without minimization shows the snapshots GROMACS wrote to disk as it crashed when the same box went straight into dynamics (S1).

Mode
Site
Showing
Site

CNOHWater oxygenForce arrow (logarithmic length)Dashed: pair closer than 0.2 nm; arrow at the edge: atom thrown out of the view

Coordinates and bonds come from this project's files: solvated.gro, em.gro, topol.top; for S1, scenarios/step0b.pdb, step0c.pdb and step1c.pdb (step1b.pdb is identical to step0c.pdb). The intermediate steps of the minimization were not saved (em.trr holds only the last frame); the "Minimize" animation is a straight transition between the start and end positions, not the path the minimization took. The transition between S1 frames is also only visual; distances are written only while on a frame. The bond lengths in the table were taken from the LINCS tables in GROMACS's S1 log; the same lengths were also computed from the snapshots and checked. The largest force in the box (196,569 kJ mol⁻¹ nm⁻¹, atom 10895) is the value GROMACS reports in a zero-step minimization with the same inputs, and it matches the first Fmax in S0's energy file; the final value of 755 is from em.log. The arrows and the forces at the chosen site are forces recomputed for the two boxes with GROMACS 2023.3; because water is rigid, the force on a water was reduced to the part that translates and rotates the molecule. This reduction differs slightly from GROMACS's (it gives 204,651 for the same water). The page holds all the protein atoms and the 151 waters within 0.6 nm of the chosen sites.

Three minimizations and the run without minimization

In this project the ubiquitin box was minimized in three forms: the main box (S0), a narrow box (S3, d = 0.5 nm) and a box with 0.15 M NaCl added (S4). The plot shows the potential energy of all three, divided by the number of atoms, step by step. The same box was also put into dynamics with no minimization at all (S1).

S0: main boxS3: narrow boxS4: 0.15 M NaClAll three stopped when Fmax < emtol = 1,000 kJ mol⁻¹ nm⁻¹
S0S3S4
S1: NVT without minimization, GROMACS output
Step 0, time 0 (ps)  LINCS WARNING
rms 0.152415, max 3.147544 (between atoms 1157 and 1159)
Step 1, time 0.002 (ps)  LINCS WARNING
rms 144479440.000000, max 2820661504.000000 (between atoms 1217 and 1218)
Segmentation fault (exit code 139)

At step 0 the temperature was 1,151 K and the pressure 66,225 bar (from the energy file). One step later the length of a bond involving H grew to about 2.8 billion times what it should be, and the program crashed.

StageSetting (this project's .mdp files)What for?
Minimizationintegrator = steep, emtol = 1000, emstep = 0.01, at most 5,000 stepsTo remove clashes; there are no velocities and no temperature
NVT, 10 psdefine = -DPOSRES, tcoupl = V-rescale, tau_t = 0.1, ref_t = 300, gen_vel = yesTo bring the water to 300 K; the heavy atoms of the protein are tied to their positions with springs
NPT, 10 pspcoupl = C-rescale, tau_p = 5.0, ref_p = 1.0, -DPOSRESTo adjust the box volume to the density at 1 bar
Unrestrained, 10 psno position restraints, same thermostat and barostatStart of the production run; here only a technical trial

Data: gromacs_trial (S0, 24 September 2026, WSL, GROMACS 2023.3) and scenarios/S1, S3, S4 (25 September 2026, cloud, same GROMACS version). S0 reached emtol in 667 steps, S3 in 403 and S4 in 600. The energy files of S3 and S4 do not record rejected steps, so there are gaps in the step numbers. All runs are 10 ps technical trials; they are not evidence of equilibrium or convergence.

5 · Test yourself

Six questions

Model: in the workshop and on the bench, 125 rigid TIP3P waters in a three-dimensional periodic box, in real units (nm, ps, kJ/mol; step 2 fs). Because of the small box and the simplified cut-off, the numbers do not match those of a large GROMACS box one to one; they show the behavior of clashes, minimization and the thermostat at its real scale. The energy and force in the bridge are computed with the TIP3P parameters; all numbers in "Back to the protein" and in the notebook come from this project's real runs. Your notebook is stored only in this browser.

Terms in this module

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