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.2852 11.6346 6.8730 0.0000 312.3047 0.0000
-18171.1543 11.6346 -18239.4023 11.6346 11.2246 0.0000 608.0216 0.0000
-18162.0371 11.6346 -18291.7754 11.6346 11.4922 0.0000 1128.9260 0.0000
-18144.6230 11.6346 -18336.2871 11.6346 8.0195 0.0000 2389.9660 0.0000
-18122.6406 11.6346 -18364.1133 11.6346 3.0098 0.0000 8022.9711 0.0000
-18102.6094 11.6346 -18374.4531 11.6346 0.3535 0.0000 76897.1560 0.0000
-18090.7559 11.6346 -18372.9453 11.6346 0.1426 0.0000 197919.3515 0.0000
-18090.1582 11.6346 -18367.5898 11.6346 4.4355 0.0000 6254.7334 0.0000
-18099.0820 11.6346 -18364.4648 11.6346 10.1230 0.0000 2621.5705 0.0000
-18112.1074 11.6346 -18365.5684 11.6346 13.8516 0.0000 1829.8364 0.0000
-18123.1816 11.6346 -18369.8750 11.6346 13.5781 0.0000 1816.8441 0.0000
-18129.6875 11.6346 -18376.0371 11.6346 10.7344 0.0000 2294.9600 0.0000
-18134.4082 11.6346 -18385.0020 11.6346 9.9414 0.0000 2520.7073 0.0000
-18143.5352 11.6346 -18399.2949 11.6346 15.5859 0.0000 1640.9650 0.0000
-18161.0586 11.6346 -18419.6582 11.6346 27.1387 0.0000 952.8823 0.0000
-18184.2168 11.6346 -18441.9238 11.6346 37.7637 0.0000 682.4205 0.0000
-18204.0859 11.6346 -18457.8398 11.6346 38.2871 0.0000 662.7659 0.0000
-18211.5586 11.6346 -18460.3887 11.6346 24.4980 0.0000 1015.7139 0.0000
-18203.1172 11.6346 -18448.5273 11.6346 0.3848 0.0000 63781.6637 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