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
-18196.7109 11.6475 -18233.3730 11.6321 21.6973 0.0054 168.9711 284.9140
-18174.5078 11.6475 -18285.3809 11.6321 16.1973 0.0054 684.5171 284.9140
-18168.2852 11.6475 -18323.9043 11.6321 16.6855 0.0054 932.6583 284.9140
-18157.1172 11.6475 -18345.7852 11.6321 15.0195 0.0054 1256.1508 284.9140
-18145.2969 11.6475 -18351.4473 11.6321 13.5156 0.0054 1525.2746 284.9140
-18137.9531 11.6475 -18347.2676 11.6321 14.1113 0.0054 1483.3080 284.9140
-18138.2969 11.6475 -18341.2285 11.6321 17.2402 0.0054 1177.0817 284.9140
-18145.6836 11.6475 -18338.8066 11.6321 21.2578 0.0054 908.4803 284.9140
-18156.2227 11.6475 -18341.2656 11.6321 23.6680 0.0054 781.8287 284.9140
-18165.1621 11.6475 -18346.7148 11.6321 22.8535 0.0054 794.4193 284.9140
-18170.6074 11.6475 -18353.4824 11.6321 20.3398 0.0054 899.0974 284.9140
-18175.3242 11.6475 -18362.3867 11.6321 20.3086 0.0054 921.1002 284.9140
-18184.9844 11.6475 -18376.2969 11.6321 26.5645 0.0054 720.1823 284.9140
-18202.9746 11.6475 -18396.3184 11.6321 38.2891 0.0054 504.9582 284.9140
-18226.1133 11.6475 -18418.5059 11.6321 48.5098 0.0054 396.6059 284.9140
-18245.5488 11.6475 -18434.7031 11.6321 48.4297 0.0054 390.5751 284.9140
-18252.3809 11.6475 -18437.6992 11.6321 34.1094 0.0054 543.3062 284.9140
-18243.3965 11.6475 -18426.1680 11.6321 9.8164 0.0054 1861.8982 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_master