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.2891 11.6346 6.8730 0.0000 312.3615 0.0000
-18194.7305 11.6475 -18234.1992 11.6321 19.1211 0.0054 206.4147 284.9140
-18168.2871 11.6475 -18288.1328 11.6321 8.1035 0.0054 1478.9348 284.9140
-18156.6855 11.6475 -18329.1992 11.6321 1.5391 0.0054 11209.0065 284.9140
-18140.1855 11.6475 -18353.6074 11.6321 7.2305 0.0054 2951.7017 284.9140
-18124.1797 11.6475 -18361.2734 11.6321 14.4883 0.0054 1636.4519 284.9140
-18114.4121 11.6475 -18358.2656 11.6321 17.3984 0.0054 1401.5828 284.9140
-18114.0254 11.6475 -18352.5645 11.6321 15.5605 0.0054 1532.9735 284.9140
-18121.9434 11.6475 -18349.8789 11.6321 11.1074 0.0054 2052.1013 284.9140
-18133.5234 11.6475 -18351.7930 11.6321 7.4492 0.0054 2930.0999 284.9140
-18143.4336 11.6475 -18356.7578 11.6321 6.9219 0.0054 3081.8849 284.9140
-18149.3770 11.6475 -18363.3047 11.6321 8.6094 0.0054 2484.8231 284.9140
-18154.0938 11.6475 -18372.2207 11.6321 8.4785 0.0054 2572.7020 284.9140
-18163.4395 11.6475 -18386.2910 11.6321 2.5000 0.0054 8914.0625 284.9140
-18181.1328 11.6475 -18406.4590 11.6321 8.8203 0.0054 2554.6281 284.9140
-18204.2090 11.6475 -18428.6777 11.6321 18.8633 0.0054 1189.9772 284.9140
-18223.8477 11.6475 -18444.7773 11.6321 18.9238 0.0054 1167.4683 284.9140
-18231.0391 11.6475 -18447.5605 11.6321 4.9785 0.0054 4349.1179 284.9140
-18222.4023 11.6475 -18435.8809 11.6321 18.8730 0.0054 1131.1290 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_master