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
-18173.0293 11.6346 -18236.0430 11.6346 14.0762 0.0000 447.6620 0.0000
-18167.9355 11.6346 -18280.7285 11.6346 20.4629 0.0000 551.2074 0.0000
-18155.6289 11.6346 -18315.1035 11.6346 24.9121 0.0000 640.1490 0.0000
-18138.7129 11.6346 -18332.7832 11.6346 27.8750 0.0000 696.2164 0.0000
-18122.6309 11.6346 -18335.0840 11.6346 31.0059 0.0000 685.2032 0.0000
-18113.1074 11.6346 -18328.8887 11.6346 35.6270 0.0000 605.6686 0.0000
-18113.2012 11.6346 -18322.1777 11.6346 41.5488 0.0000 502.9662 0.0000
-18121.6543 11.6346 -18320.1387 11.6346 46.9531 0.0000 422.7288 0.0000
-18133.6680 11.6346 -18323.4043 11.6346 49.2930 0.0000 384.9156 0.0000
-18143.8418 11.6346 -18329.6230 11.6346 47.5527 0.0000 390.6847 0.0000
-18149.8691 11.6346 -18336.7656 11.6346 43.7129 0.0000 427.5546 0.0000
-18154.6055 11.6346 -18345.6348 11.6346 42.6504 0.0000 447.8958 0.0000
-18164.0176 11.6346 -18359.2383 11.6346 48.5293 0.0000 402.2739 0.0000
-18181.8301 11.6346 -18378.9785 11.6346 60.5215 0.0000 325.7495 0.0000
-18205.0078 11.6346 -18401.1191 11.6346 71.3340 0.0000 274.9199 0.0000
-18224.6855 11.6346 -18417.5195 11.6346 71.7715 0.0000 268.6777 0.0000
-18231.8262 11.6346 -18420.8652 11.6346 57.6191 0.0000 328.0838 0.0000
-18223.0508 11.6346 -18409.6172 11.6346 33.0371 0.0000 564.7177 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