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
-18174.8223 11.6346 -18174.8223 11.6346 0.0000 0.0000 0.0000 0.0000
-18171.8203 11.6346 -18193.2852 11.6346 6.8730 0.0000 312.3047 0.0000
-18174.0000 11.6346 -18236.5723 11.6346 14.4375 0.0000 433.4010 0.0000
-18171.0039 11.6346 -18282.4961 11.6346 21.6250 0.0000 515.5708 0.0000
-18161.3848 11.6346 -18318.4688 11.6346 27.0098 0.0000 581.5822 0.0000
-18147.1016 11.6346 -18337.7578 11.6346 30.8203 0.0000 618.6058 0.0000
-18133.0859 11.6346 -18341.3398 11.6346 34.4668 0.0000 604.2160 0.0000
-18124.7773 11.6346 -18335.8848 11.6346 39.1738 0.0000 538.8991 0.0000
-18125.2070 11.6346 -18329.4277 11.6346 44.8535 0.0000 455.3059 0.0000
-18133.4023 11.6346 -18327.1992 11.6346 49.8770 0.0000 388.5499 0.0000
-18144.8887 11.6346 -18330.1191 11.6346 51.9395 0.0000 356.6277 0.0000
-18154.5957 11.6346 -18336.0352 11.6346 50.0664 0.0000 362.3976 0.0000
-18160.3828 11.6346 -18343.0195 11.6346 46.3164 0.0000 394.3240 0.0000
-18165.1465 11.6346 -18351.9180 11.6346 45.4492 0.0000 410.9454 0.0000
-18174.6777 11.6346 -18365.6152 11.6346 51.4922 0.0000 370.8087 0.0000
-18192.6348 11.6346 -18385.4609 11.6346 63.5352 0.0000 303.4952 0.0000
-18215.8516 11.6346 -18407.6152 11.6346 74.2676 0.0000 258.2064 0.0000
-18235.4238 11.6346 -18423.9316 11.6346 74.5469 0.0000 252.8715 0.0000
-18242.3770 11.6346 -18427.1426 11.6346 60.2168 0.0000 306.8340 0.0000
-18233.4336 11.6346 -18415.8008 11.6346 35.5488 0.0000 513.0048 0.0000

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:
engforces_master