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
-18192.9512 11.6475 -18233.0488 11.6321 22.1797 0.0054 180.7855 284.9140
-18162.7461 11.6475 -18284.2891 11.6321 17.6582 0.0054 688.3088 284.9140
-18146.3047 11.6475 -18321.8203 11.6321 19.8887 0.0054 882.4904 284.9140
-18125.0625 11.6475 -18342.6875 11.6321 20.6504 0.0054 1053.8541 284.9140
-18105.3184 11.6475 -18347.5742 11.6321 22.0898 0.0054 1096.6844 284.9140
-18093.3477 11.6475 -18342.9219 11.6321 25.7695 0.0054 968.4857 284.9140
-18092.3262 11.6475 -18336.7441 11.6321 31.5430 0.0054 774.8731 284.9140
-18100.6914 11.6475 -18334.4414 11.6321 37.2344 0.0054 627.7801 284.9140
-18113.2109 11.6475 -18337.1016 11.6321 40.0742 0.0054 558.6899 284.9140
-18123.9785 11.6475 -18342.7578 11.6321 38.6582 0.0054 565.9324 284.9140
-18130.3711 11.6475 -18349.6113 11.6321 34.8984 0.0054 628.2236 284.9140
-18135.0625 11.6475 -18358.5156 11.6321 33.6094 0.0054 664.8536 284.9140
-18144.1387 11.6475 -18372.3438 11.6321 39.1504 0.0054 582.8935 284.9140
-18161.5703 11.6475 -18392.3047 11.6321 50.9023 0.0054 453.2883 284.9140
-18184.6133 11.6475 -18414.4785 11.6321 61.7598 0.0054 372.1925 284.9140
-18204.4219 11.6475 -18430.7207 11.6321 62.4805 0.0054 362.1913 284.9140
-18211.9512 11.6475 -18433.8086 11.6321 48.7520 0.0054 455.0739 284.9140
-18203.5996 11.6475 -18422.3438 11.6321 24.4844 0.0054 893.4030 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