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.9
tested onmaster
e: 
ENERGY
Calculate the total potential energy of the simulation box. More details
v:
VOLUME
Calculate the volume of the simulation box. More details
PRINT
Print quantities to a file. More details
ARG
the input for this action is the scalar output from one or more other actions
=e,v
FILE
the 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.9
tested onmaster
e: 
ENERGY
Calculate the total potential energy of the simulation box. More details
v:
VOLUME
Calculate the volume of the simulation box. More details
# slope is such that
PRINT
Print quantities to a file. More details
ARG
the input for this action is the scalar output from one or more other actions
=e
FILE
the name of the file on which to output these quantities
=energy2 # slope should be (alpha-1)=0.21
RESTRAINT
Adds harmonic and/or linear restraints on one or more variables. More details
AT
the position of the restraint
=0.0
ARG
the arguments on which the bias is acting
=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

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.

Original result Result with PLUMED Effect of peturbation % Difference
-18174.6855 11.6346 -18174.6855 11.6346 0.0000 0.0000 0.0000 0.0000
-18171.6855 11.6346 -18193.1699 11.6346 6.8730 0.0000 312.5888 0.0000
-18194.5762 11.6475 -18235.8340 11.6321 20.4121 0.0054 202.1242 284.9140
-18168.1230 11.6475 -18293.7500 11.6321 12.1992 0.0054 1029.7950 284.9140
-18156.4570 11.6475 -18340.0723 11.6321 9.2891 0.0054 1976.6822 284.9140
-18139.9160 11.6475 -18369.8086 11.6321 4.3711 0.0054 5259.3831 284.9140
-18123.8691 11.6475 -18381.6836 11.6321 0.5312 0.0054 48529.7794 284.9140
-18114.1074 11.6475 -18381.0820 11.6321 0.0254 0.0054 1051453.7002 284.9140
-18113.6973 11.6475 -18376.0547 11.6321 3.1055 0.0054 8448.2383 284.9140
-18121.6348 11.6475 -18372.8438 11.6321 7.7852 0.0054 3226.7684 284.9140
-18133.2363 11.6475 -18373.6094 11.6321 10.9707 0.0054 2191.0451 284.9140
-18143.1016 11.6475 -18377.5547 11.6321 10.6523 0.0054 2200.9536 284.9140
-18149.0840 11.6475 -18383.5957 11.6321 8.3184 0.0054 2819.2065 284.9140
-18153.7852 11.6475 -18392.5547 11.6321 8.0391 0.0054 2970.1168 284.9140
-18163.1211 11.6475 -18406.9961 11.6321 13.9551 0.0054 1747.5717 284.9140
-18180.8281 11.6475 -18427.4902 11.6321 25.5020 0.0054 967.2283 284.9140
-18203.8984 11.6475 -18449.7988 11.6321 35.7949 0.0054 686.9700 284.9140
-18223.5312 11.6475 -18465.6250 11.6321 35.9668 0.0054 673.1034 284.9140
-18230.7148 11.6475 -18468.0176 11.6321 22.0254 0.0054 1077.4053 284.9140
-18222.0840 11.6475 -18455.9922 11.6321 2.0586 0.0054 11362.5224 284.9140