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
-114.5089 5.6839 -114.5083 -0.0000 0.0022 5.6839 26.4679 100.0000
-114.5569 5.6827 -114.5545 -0.0000 0.0088 5.6827 26.6561 100.0000
-114.6289 5.6802 -114.6236 5.6809 0.0197 0.0011 26.7727 66.7258
-114.7027 5.6764 -114.6933 5.6777 0.0347 5.6764 26.8262 0.0235
-114.8030 5.6713 -114.7886 -0.0000 0.0539 5.6713 26.7837 100.0000
-114.9086 -0.0000 -114.8880 -0.0000 0.0774 5.6695 26.5913 0.0000
-115.0332 5.6575 -115.0055 -0.0000 0.1045 0.0060 26.4502 93744.8550
-115.1620 0.0000 -115.1265 5.6543 0.1354 5.6569 26.2511 99.9533
-115.3194 -0.0000 -115.2753 5.6459 0.1731 0.0000 25.5324 0.0000
-115.4801 -0.0000 -115.4267 5.6368 0.2109 5.6409 25.3257 99.9274
-115.6514 5.6176 -115.5882 -0.0000 0.2523 0.0145 25.0521 38833.2849
-115.8167 -0.0000 -115.7435 5.6164 0.2929 5.6222 24.9839 99.8960
-116.0039 5.5913 -115.9207 -0.0000 0.3419 5.5913 24.3443 100.0000
-116.1997 5.5760 -116.1066 -0.0000 0.3864 5.5760 24.0906 100.0000
-116.3950 -0.0000 -116.2924 -0.0000 0.4360 5.5857 23.5445 0.0000
-116.5973 5.5431 -116.4854 -0.0000 0.4882 0.0289 22.9075 19173.1002
-116.8098 5.5256 -116.6893 5.5464 0.5453 5.5256 22.0877 0.3761
-117.0312 5.5076 -116.9028 5.5305 0.6032 0.0355 21.2867 64.3118
-117.2359 -0.0000 -117.1007 -0.0000 0.6514 5.5279 20.7584 0.0000
-117.4504 5.4694 -117.3096 5.4964 0.7066 5.4694 19.9211 0.4940

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