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 of 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 of 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
-18194.1211 11.6475 -18233.3594 11.6321 20.8359 0.0054 188.3202 284.9140
-18166.4277 11.6475 -18285.3281 11.6321 13.5234 0.0054 879.2173 284.9140
-18153.1934 11.6475 -18323.8535 11.6321 11.8809 0.0054 1436.4294 284.9140
-18135.1074 11.6475 -18345.7051 11.6321 8.4121 0.0054 2503.5057 284.9140
-18117.8301 11.6475 -18351.3398 11.6321 5.8828 0.0054 3969.3563 284.9140
-18107.3418 11.6475 -18347.1465 11.6321 6.4844 0.0054 3698.1928 284.9140
-18106.7344 11.6475 -18341.0996 11.6321 10.2949 0.0054 2276.5130 284.9140
-18114.8008 11.6475 -18338.6973 11.6321 15.2539 0.0054 1467.7977 284.9140
-18126.6914 11.6475 -18341.1602 11.6321 18.3613 0.0054 1168.0460 284.9140
-18136.9082 11.6475 -18346.6270 11.6321 17.8340 0.0054 1175.9501 284.9140
-18142.9883 11.6475 -18353.3711 11.6321 15.0762 0.0054 1395.4657 284.9140
-18147.7090 11.6475 -18362.2852 11.6321 14.5312 0.0054 1476.6532 284.9140
-18156.9609 11.6475 -18376.1934 11.6321 20.3262 0.0054 1078.5721 284.9140
-18174.5625 11.6475 -18396.1934 11.6321 31.9023 0.0054 694.7165 284.9140
-18197.6211 11.6475 -18418.3965 11.6321 42.3516 0.0054 521.2922 284.9140
-18217.3242 11.6475 -18434.5879 11.6321 42.7344 0.0054 508.4049 284.9140
-18224.6152 11.6475 -18437.5938 11.6321 28.8027 0.0054 739.4385 284.9140
-18216.0918 11.6475 -18426.0703 11.6321 4.7441 0.0054 4426.0597 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