Where do constraints move the limit?
In two different constraint schemes, find the longest step at which no free bond turns red.
An MD program moves atoms forward in small time steps. The longer the step, the less computation it takes to simulate the same stretch of time, but the step must be short enough to follow the fastest vibration in the system. In a protein, the fastest vibrations are in the bonds to hydrogen. In this lab you will read the "clock" of every bond in ubiquitin, blow up a bond with your own hands, and use 24 real runs made in this project to measure the cost of your choices of step, constraints and mass.
A bond vibrates like a spring between two masses. IR spectroscopy measures these vibrations as wavenumbers (cm⁻¹); the wavenumber and the vibrational period T are related simply: ν̃ = 1 / (c · T). Below, the vibrations of the 1,237 bonds in this project's ubiquitin topology, computed from the spring constants of the force field, are shown as a "stick spectrum". Choose a bond type and see both its place in the spectrum and its period.
The four bonds below come from ubiquitin itself: a Ser hydroxyl, a backbone N-H, a C-H of an Ala methyl and a backbone C=O. All four vibrate with their own periods in the same slow motion (1 fs = 0.25 s); the dials on the left are clocks. In the strips on the right, the faint curve is the true vibration of each bond and the dots are samples taken at intervals of Δt: the MD program sees the atoms only at these instants. Make Δt larger and watch the line joining the dots; once there are fewer than two samples per period, the line breaks away from the true vibration and turns into a false, slow wave. If you switch on the stroboscope, you also see the bonds themselves only at the flashes.
Each strip shows 60 fs. Faint curve: the true vibration of the bond. Dots: one sample every Δt (the instants MD sees). Gold line: the current time. If you choose a constraint scheme in the workshop, the strips of the constrained bonds stop.
Period: T = 2π √(μ / k); μ is the reduced mass of the two atoms; k is the bond spring constant in the amber99sb-ildn force field (from this project's .tpr file, gmx dump). This calculation gives 8.99 fs for Thr7 OG1-HG1; the estimate grompp wrote for the same bond in this project is 9.0 fs. The shaded bands are the amide A (N-H stretch, about 3,300 cm⁻¹) and amide I (mostly C=O stretch, 1,600-1,700 cm⁻¹) bands measured in the IR spectra of proteins (Barth 2007, Biochim Biophys Acta 1767:1073). The single-bond, harmonic calculation leaves out how real vibrations mix with neighboring bonds and angles; that is why the value found for C=O lies below the amide I band. Angle vibrations are not included in this figure.
If the period of a bond is shorter than five times the time step, GROMACS warns at the grompp stage and stops. The bars below are the period distribution of the 1,237 bonds of ubiquitin. Change the time step: the free bonds whose period falls below 5 · Δt turn red and light up in the 3D view. Then constrain bonds (a constrained bond keeps a fixed length and does not vibrate) or repartition the hydrogen mass, and see where the limit moves.
Tip: tap a bar of the distribution; the bonds in that period range are highlighted in gold in the 3D view. Red bonds vibrate with exaggerated amplitude; constrained bonds are thick, gray and still.
In two different constraint schemes, find the longest step at which no free bond turns red.
Move a single Ser O-H bond forward yourself with a Verlet algorithm of the kind GROMACS uses: the spring constant and the masses come from this project's topology. The faint curve is the exact solution; the dots are the positions the algorithm computes at each step. Make the step larger; first the energy starts to oscillate, and beyond a certain step the trajectory grows without bound. Then make the hydrogen heavier.
At every step the algorithm does the same four jobs. Follow the steps in order; the numbers are the first step taken, with the Δt you chose above, from the bond stretched by 0.01 nm. At a large Δt, watch how the drift in the third step overshoots the equilibrium.
| Trial | Hydrogen | Δt (fs) | Δt / T | Energy deviation | Result |
|---|
Model: one-dimensional harmonic bond, k = 462,750 kJ mol⁻¹ nm⁻² (amber99sb-ildn, Ser OG-HG and Thr OG1-HG1), O 16.00 u, H 1.008 u; with HMR, H 3.024 u, O 13.984 u. The algorithm is velocity Verlet; GROMACS's default, leap-frog, gives the same trajectory and has the same stability limit: ω Δt < 2, that is Δt < T / π. The energy deviation is the largest relative difference of the total energy from its starting value. In a real protein the bonds are coupled to each other and to the angles; this single bond is here to show where the limit comes from.
Let one run stay stable and a run with a slightly longer step blow up.
Run the same step once normally and once with HMR.
In this project, 24 NVE runs were made from the same start (the end of S0's NPT; velocities regenerated at 300 K with the same seed): 6 time steps × 4 constraint schemes, 20 ps each; the protocol was written and frozen before the runs. NVE has no thermostat, so the integration error shows up in the conserved energy and in the reported temperature. But the mean temperature difference cannot be read directly as "warming" (see the reading notes); look also at the conserved-energy slope of the run you select. Each cell holds the mean temperature difference relative to the 0.5 fs run of the same scheme, and the speed (ns/day). The cell color is your criterion: how large a temperature difference do you allow? Tap a cell; the energy curves of up to three runs are drawn on top of each other below.
Reading notes. With H bonds constrained, the conserved energy rises as the step grows and the reported mean temperature goes up: 298.9 K at 0.5 fs, 309.1 K at 4 fs. This 10.2 K difference is not warming as such: in this system 1 K corresponds to about 160 kJ/mol of kinetic energy, and the 612 kJ/mol rise in the conserved energy can explain at most about 3.8 K of the difference; the rest may come from a transfer of potential to kinetic energy or from the way the reported temperature is computed (book §2.5). At a large step both the conserved energy and the temperature reading go wrong; they are not the same cost. grompp rejected 5 fs (Glu16 CD-OE1, 22.2 fs); when forced, LINCS warnings began at 0.3 ps and the run crashed. In this scheme HMR did not reduce the drift, it increased it (slope 1.05 at 4 fs, 0.29 with H bonds), but it was the only scheme that completed 20 ps at 5 fs without crashing; the temperature rose to 315.5 K. Because HMR makes the heavy atoms lighter, some heavy-atom bonds become faster (in this scheme HMR shortens the period of 497 of the 608 heavy-atom bonds; at 5 fs the number of heavy-atom bonds with a period below 5 · Δt rises from 209 to 329: try "H bonds" with HMR at 5 fs in the workshop); this single-seed, 20 ps experiment cannot isolate the cause of the drift. With all bonds constrained, the slope is negative and grows with the step (−4.20 at 4 fs); the runs were made with the default LINCS settings (lincs-order 4, lincs-iter 1) and at 5 fs crashed at 0.35 ps with a LINCS warning. Without constraints, grompp rejected 2 fs (Thr7 OG1-HG1, 9.0 fs); the forced 2 fs run completed; at 3, 4 and 5 fs, water molecules could not be settled by SETTLE in the first steps (steps 13, 3 and 2) and the runs crashed. At 0.5 and 1 fs there is a small, regular negative slope in every scheme; its source cannot be isolated in this grid. The slope unit is kJ mol⁻¹ ns⁻¹ per atom (18,937 atoms). The speeds were measured on the same machine; at the same step, the small differences between schemes are partly measurement noise, and other jobs were also running on the machine during the hbonds 0.5 fs run.
Choose a temperature-difference limit and find the fastest of the runs that stay under it.
In this project's earlier runs (25 September, 10 ps, thermostat and barostat on), the time step had been tried three times. The grid asks the same questions again, without a thermostat and from the same start. Below are the real grompp output of S2b and the grid counterparts of the three runs.
WARNING 1 [file topol.top, line 11764]: The bond in molecule-type Protein_chain_A between atoms 124 OG1 and 125 HG1 has an estimated oscillational period of 9.0e-03 ps, which is less than 5 times the time step of 4.0e-03 ps. Fatal error: Too many warnings (1). If you are sure all warnings are harmless, use the -maxwarn option.
| Earlier run | Setting | Earlier result | In the grid (NVE, 20 ps) |
|---|---|---|---|
| C1 | 2 fs, H bonds | completed; conserved energy slope about +60 kJ mol⁻¹ ps⁻¹; 13.5 ns/day | completed; +2.3 K relative to 0.5 fs; 7.4 ns/day |
| S2a | 4 fs, H bonds | completed; slope about +68 kJ mol⁻¹ ps⁻¹; 26.8 ns/day | completed; +10.2 K; 15.7 ns/day |
| S2b | 4 fs, no constraints | grompp rejected it; the run did not start | grompp rejected it again; when forced, water molecules could not be settled at step 3 and the run crashed |
In thermostatted runs, the conserved energy also includes the work done by the thermostat, and 10 ps does not give the drift rate reliably; that is why the grid was run in NVE. The common choice in practice is 2 fs with H bonds constrained. 4 fs with HMR was tested on a tripeptide and on lysozyme by Hopkins, Le Grand, Walker and Roitberg 2015 (J Chem Theory Comput 11:1864), who reported that it allows the time step to be made up to 2 times larger. This project's single-seed, 20 ps grid did not show that HMR reduces the drift in this system; that is the result of this short experiment, not a verdict on the method. Compare speeds only within the grid: the grid computed the energy once every 60 fs and was run in a different session from the earlier runs (7.4 against 13.5 ns/day at the same 2 fs).
Previous steps: MD-T · Energy, forces and numerical motion (the Verlet step of a single bond) and MD-EQ · Minimization and equilibration (the equilibrated system the grid starts from).
Model: the single-bond animation is a teaching model computed in the browser. The bond periods were computed from this project's ubiquitin topology (amber99sb-ildn, 1,231 protein atoms, 1,237 bonds); the energy curves, temperatures and speeds come from NVE runs actually made in this project in the cloud with GROMACS 2023.3.
The definition of each term and the other modules where it appears are in the glossary.