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
-18196.1797 11.6475 -18232.4824 11.6321 24.9902 0.0054 145.2677 284.9140
-18172.8555 11.6475 -18282.4746 11.6321 26.4512 0.0054 414.4207 284.9140
-18165.2227 11.6475 -18318.3457 11.6321 36.2871 0.0054 421.9764 284.9140
-18152.6621 11.6475 -18337.5801 11.6321 44.5117 0.0054 415.4366 284.9140
-18139.7402 11.6475 -18341.1309 11.6321 51.6953 0.0054 389.5723 284.9140
-18131.7754 11.6475 -18335.7109 11.6321 58.6172 0.0054 347.9108 284.9140
-18131.9199 11.6475 -18329.3164 11.6321 65.1328 0.0054 303.0676 284.9140
-18139.4375 11.6475 -18327.1973 11.6321 69.9062 0.0054 268.5880 284.9140
-18150.2422 11.6475 -18330.1953 11.6321 71.1914 0.0054 252.7737 284.9140
-18159.4531 11.6475 -18336.1797 11.6321 68.4590 0.0054 258.1496 284.9140
-18165.0234 11.6475 -18343.1777 11.6321 64.1074 0.0054 277.8996 284.9140
-18169.7559 11.6475 -18352.0645 11.6321 62.9824 0.0054 289.4595 284.9140
-18179.3320 11.6475 -18365.7793 11.6321 69.0273 0.0054 270.1064 284.9140
-18197.2266 11.6475 -18385.6602 11.6321 81.1758 0.0054 232.1303 284.9140
-18220.3711 11.6475 -18407.8008 11.6321 92.0898 0.0054 203.5292 284.9140
-18239.8281 11.6475 -18424.1328 11.6321 92.4160 0.0054 199.4294 284.9140
-18246.7676 11.6475 -18427.3320 11.6321 78.0840 0.0054 231.2439 284.9140
-18237.8828 11.6475 -18415.9629 11.6321 53.3535 0.0054 333.7738 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