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
-18170.6211 11.6346 -18238.6426 11.6346 9.3535 0.0000 727.2290 0.0000
-18160.4336 11.6346 -18289.2754 11.6346 5.7051 0.0000 2258.3705 0.0000
-18141.5879 11.6346 -18331.5059 11.6346 2.9551 0.0000 6426.8344 0.0000
-18118.2012 11.6346 -18357.0410 11.6346 13.3145 0.0000 1793.8390 0.0000
-18097.0762 11.6346 -18365.5566 11.6346 21.1836 0.0000 1267.3981 0.0000
-18084.6094 11.6346 -18363.0020 11.6346 23.7422 0.0000 1172.5650 0.0000
-18083.8066 11.6346 -18357.3496 11.6346 20.9043 0.0000 1308.5490 0.0000
-18092.8672 11.6346 -18354.4688 11.6346 15.2988 0.0000 1709.9451 0.0000
-18106.1582 11.6346 -18356.0527 11.6346 10.8066 0.0000 2312.4163 0.0000
-18117.5020 11.6346 -18360.7910 11.6346 10.0508 0.0000 2420.5986 0.0000
-18124.1211 11.6346 -18367.1836 11.6346 12.0879 0.0000 2010.7934 0.0000
-18128.8535 11.6346 -18376.1250 11.6346 12.4746 0.0000 1982.1983 0.0000
-18137.8770 11.6346 -18390.2598 11.6346 6.9121 0.0000 3651.3141 0.0000
-18155.3633 11.6346 -18410.4941 11.6346 4.4277 0.0000 5762.1090 0.0000
-18178.4980 11.6346 -18432.7012 11.6346 14.7891 0.0000 1718.8589 0.0000
-18198.4180 11.6346 -18448.7441 11.6346 15.2461 0.0000 1641.9036 0.0000
-18205.9844 11.6346 -18451.4707 11.6346 1.5742 0.0000 15594.1663 0.0000
-18197.6309 11.6346 -18439.7695 11.6346 22.2500 0.0000 1088.2637 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_v2.10