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
-18192.7793 11.6475 -18232.0723 11.6321 22.5137 0.0054 174.5294 284.9140
-18162.2012 11.6475 -18281.1094 11.6321 18.7129 0.0054 635.4347 284.9140
-18145.2695 11.6475 -18315.7324 11.6321 21.8691 0.0054 779.4677 284.9140
-18123.5449 11.6475 -18333.6895 11.6321 23.6738 0.0054 887.6660 284.9140
-18103.4375 11.6475 -18336.2539 11.6321 26.0605 0.0054 893.3673 284.9140
-18091.2539 11.6475 -18330.2539 11.6321 30.4707 0.0054 784.3600 284.9140
-18090.1465 11.6475 -18323.6914 11.6321 36.6250 0.0054 637.6653 284.9140
-18098.5723 11.6475 -18321.6914 11.6321 42.4668 0.0054 525.3967 284.9140
-18111.1855 11.6475 -18324.9551 11.6321 45.2266 0.0054 472.6637 284.9140
-18122.0410 11.6475 -18331.1660 11.6321 43.6113 0.0054 479.5199 284.9140
-18128.4707 11.6475 -18338.3086 11.6321 39.6406 0.0054 529.3506 284.9140
-18133.1504 11.6475 -18347.1719 11.6321 38.1875 0.0054 560.4491 284.9140
-18142.2109 11.6475 -18360.8164 11.6321 43.6934 0.0054 500.3174 284.9140
-18159.6309 11.6475 -18380.5898 11.6321 55.4844 0.0054 398.2364 284.9140
-18182.6504 11.6475 -18402.7246 11.6321 66.4102 0.0054 331.3864 284.9140
-18202.4883 11.6475 -18419.1133 11.6321 67.2285 0.0054 322.2219 284.9140
-18210.0352 11.6475 -18422.4102 11.6321 53.4688 0.0054 397.1946 284.9140
-18201.7363 11.6475 -18411.1328 11.6321 29.2070 0.0054 716.9386 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