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: 
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 labels of the values that you would like to print to the file
=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.10
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 labels of the values that you would like to print to the file
=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 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.3516 11.6475 -18233.1562 11.6321 20.3789 0.0054 200.2300 284.9140
-18160.8711 11.6475 -18284.6797 11.6321 12.0117 0.0054 1030.7317 284.9140
-18142.7949 11.6475 -18322.5742 11.6321 9.1797 0.0054 1958.4467 284.9140
-18119.9199 11.6475 -18343.8066 11.6321 4.7480 0.0054 4715.3434 284.9140
-18098.9004 11.6475 -18348.9844 11.6321 1.7910 0.0054 13963.2468 284.9140
-18086.1914 11.6475 -18344.4883 11.6321 2.5371 0.0054 10180.7559 284.9140
-18084.9434 11.6475 -18338.3730 11.6321 6.9355 0.0054 3654.0692 284.9140
-18093.4629 11.6475 -18336.0391 11.6321 12.5586 0.0054 1931.5552 284.9140
-18106.3086 11.6475 -18338.6016 11.6321 16.1699 0.0054 1436.5744 284.9140
-18117.3809 11.6475 -18344.1934 11.6321 15.7578 0.0054 1439.3654 284.9140
-18123.9004 11.6475 -18351.0020 11.6321 12.7383 0.0054 1782.8272 284.9140
-18128.5957 11.6475 -18359.9043 11.6321 11.8008 0.0054 1960.1126 284.9140
-18137.5820 11.6475 -18373.7832 11.6321 17.2969 0.0054 1365.5714 284.9140
-18154.9297 11.6475 -18393.7520 11.6321 28.7969 0.0054 829.3339 284.9140
-18177.9609 11.6475 -18415.9258 11.6321 39.4453 0.0054 603.2779 284.9140
-18197.8359 11.6475 -18432.1543 11.6321 40.1055 0.0054 584.2554 284.9140
-18205.4668 11.6475 -18435.2109 11.6321 26.4961 0.0054 867.0868 284.9140
-18197.2188 11.6475 -18423.7207 11.6321 2.5352 0.0054 8934.4385 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