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
-18176.9609 11.6346 -18237.2910 11.6346 17.7344 0.0000 340.1872 0.0000
-18180.2090 11.6346 -18284.8027 11.6346 31.8691 0.0000 328.1976 0.0000
-18178.5938 11.6346 -18322.9141 11.6346 46.2109 0.0000 312.3077 0.0000
-18172.2031 11.6346 -18344.3574 11.6346 58.8906 0.0000 292.3289 0.0000
-18164.3398 11.6346 -18349.6152 11.6346 69.5332 0.0000 266.4560 0.0000
-18159.6426 11.6346 -18345.1543 11.6346 78.4531 0.0000 236.4619 0.0000
-18161.1348 11.6346 -18338.9570 11.6346 85.5176 0.0000 207.9365 0.0000
-18168.5430 11.6346 -18336.5078 11.6346 89.8203 0.0000 187.0010 0.0000
-18178.4375 11.6346 -18338.9883 11.6346 90.1543 0.0000 178.0844 0.0000
-18186.7051 11.6346 -18344.4941 11.6346 86.6582 0.0000 182.0821 0.0000
-18191.7793 11.6346 -18351.2793 11.6346 82.0332 0.0000 194.4335 0.0000
-18196.5527 11.6346 -18360.1758 11.6346 81.0762 0.0000 201.8140 0.0000
-18206.5703 11.6346 -18374.0586 11.6346 87.5879 0.0000 191.2231 0.0000
-18224.9395 11.6346 -18394.0176 11.6346 100.0957 0.0000 168.9165 0.0000
-18248.2559 11.6346 -18416.1777 11.6346 110.9922 0.0000 151.2916 0.0000
-18267.5078 11.6346 -18432.4141 11.6346 110.9648 0.0000 148.6113 0.0000
-18273.9277 11.6346 -18435.4727 11.6346 96.0840 0.0000 168.1289 0.0000
-18264.4629 11.6346 -18423.9863 11.6346 70.8496 0.0000 225.1578 0.0000

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:
engforces_master