Check force on energy

It is common practise to use the potential energy as a collective energy. Some MD codes thus pass the potential energy to PLUMED and PLUMED can then apply forces on this collective variable. We test that any forces that PLUMED applies on the potential energy are correctly passed back to the MD code by doing the following test. We first run a short simulation at $T$ K with a timestep of $\tau$ ps. During the course of this simulation we monitor the potential energy using the following PLUMED input:

Click on the labels of the actions for more information on what each action computes
tested on2.10
tested onmaster
e: ENERGYCalculate the total potential energy of the simulation box. More details
v: VOLUMECalculate the volume the simulation box. More details
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=e,v FILEthe name of the file on which to output these quantities=energy1

We then run a second simulation (starting from identical conditions) at a temperature of $T\alpha$ and with a timestep of $\tau/\sqrt(\alpha)$. The thermostat and barostat relaxation times are similarly divided by $\sqrt(\alpha)$. In the tests that are run on this website we set $\sqrt(\alpha)=1.1$. The PLUMED file above is used when this test is run but a different time series of energy values is recorded as the MD parameters in this second simulation are different.

If PLUMED is working correctly we should be able to recapture the time series of energy values for the first simulation by running an MD simulation with the modified parameters that were used in the second simulation and the following PLUMED input file:

Click on the labels of the actions for more information on what each action computes
tested on2.10
tested onmaster
e: ENERGYCalculate the total potential energy of the simulation box. More details
v: VOLUMECalculate the volume the simulation box. More details
# slope is such that 
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=e FILEthe name of the file on which to output these quantities=energy2
# slope should be (alpha-1)=0.21
RESTRAINTAdds harmonic and/or linear restraints on one or more variables. More details ATthe position of the restraint=0.0 ARGthe values the harmonic restraint acts upon=e SLOPE specifies that the restraint is linear and what the values of the force constants on each of the variables are=0.21

In other words, when forces are passed correctly the time series for the energies and volumes from the first and third of these calculations should be identical.

To determine if PLUMED passes this test we calculate the difference between the time series that were observed in the first and third simulations described above. We then divide this by the difference between the first and second time series.

An NPT version of this calculation is performed as well as an NVT calculation if the virial is passed to PLUMED.

Trajectories

  1. Input and output files for the unpeturbed calculation are available in this zip archive

  2. Input and output files for the peturbed calculation are available in this zip archive

  3. Input and output files for the peturbed calculation in which a PLUMED restraint is used to undo the effect of the changed MD parameters are available in this zip archive

Results

Original With PLUMED Effect of peturbation % Difference
-18174.8223 11.6346 -18174.8223 11.6346 0.0000 0.0000 0.0000 0.0000
-18171.8203 11.6346 -18193.2891 11.6346 6.8730 0.0000 312.3615 0.0000
-18193.0918 11.6475 -18233.2129 11.6321 18.0098 0.0054 222.7741 284.9140
-18163.2051 11.6475 -18284.8477 11.6321 4.6484 0.0054 2616.8490 284.9140
-18147.1602 11.6475 -18322.8828 11.6321 4.9219 0.0054 3570.2381 284.9140
-18126.2969 11.6475 -18344.3086 11.6321 16.5254 0.0054 1319.2530 284.9140
-18106.8574 11.6475 -18349.5938 11.6321 25.8652 0.0054 938.4656 284.9140
-18095.0898 11.6475 -18345.1816 11.6321 29.8438 0.0054 838.0039 284.9140
-18094.1035 11.6475 -18339.0742 11.6321 28.1309 0.0054 870.8255 284.9140
-18102.4199 11.6475 -18336.7227 11.6321 23.1836 0.0054 1010.6403 284.9140
-18114.8633 11.6475 -18339.2617 11.6321 18.8535 0.0054 1190.2206 284.9140
-18125.5742 11.6475 -18344.8262 11.6321 17.8359 0.0054 1229.2707 284.9140
-18131.9180 11.6475 -18351.6328 11.6321 19.4121 0.0054 1131.8443 284.9140
-18136.6172 11.6475 -18360.5371 11.6321 19.4297 0.0054 1152.4628 284.9140
-18145.7188 11.6475 -18374.4062 11.6321 13.7285 0.0054 1665.7846 284.9140
-18163.1914 11.6475 -18394.3945 11.6321 2.5469 0.0054 9077.9141 284.9140
-18186.2031 11.6475 -18416.5684 11.6321 7.5352 0.0054 3057.2059 284.9140
-18206.0156 11.6475 -18432.8047 11.6321 7.8320 0.0054 2895.6609 284.9140
-18213.5098 11.6475 -18435.8242 11.6321 5.8301 0.0054 3813.2329 284.9140
-18205.1484 11.6475 -18424.3242 11.6321 29.4844 0.0054 743.3625 284.9140

The table below includes some of the results from the calculation. The columns contain:

  1. Time series for the energy and volume that were obtained from the simulation at $T$ K, $x_{md}$.
  2. Time series for the energy and volume that were obtained from the simulation at $\alpha T$ K and in which PLUMED applied a restraint on the energy, $x_{pl}$.
  3. The absolute value of the difference between the time series of energies and volumes that were obtained from the simulations running at $T$ K and $\alpha T$ K, $\vert x_{md}’-x_{md} \vert$. No PLUMED restraints were applied in either of these simulations.
  4. The values of $100\frac{\vert x_{md} - x_{pl}\vert }{ \vert x_{md}’-x_{md} \vert}$.

If the PLUMED interface is working correctly the first two sets of numbers should be identical and the final column should be filled with zeros.

Graphical representation (beta)

A visualization of the table above:
engvir_v2.10