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
-18192.4727 11.6475 -18233.8086 11.6321 20.5996 0.0054 200.6637 284.9140
-18161.2500 11.6475 -18286.8320 11.6321 12.7402 0.0054 985.7121 284.9140
-18143.4961 11.6475 -18326.6953 11.6321 10.5664 0.0054 1733.7893 284.9140
-18120.9414 11.6475 -18349.9238 11.6321 6.7676 0.0054 3383.5210 284.9140
-18100.2109 11.6475 -18356.6367 11.6321 4.4141 0.0054 5809.2914 284.9140
-18087.6328 11.6475 -18353.0723 11.6321 5.4941 0.0054 4831.3194 284.9140
-18086.4141 11.6475 -18347.2090 11.6321 10.0195 0.0054 2602.8656 284.9140
-18094.8984 11.6475 -18344.6562 11.6321 15.6211 0.0054 1598.8497 284.9140
-18107.6855 11.6475 -18346.8145 11.6321 19.1270 0.0054 1250.2196 284.9140
-18118.6973 11.6475 -18352.0254 11.6321 18.5898 0.0054 1255.1376 284.9140
-18125.1836 11.6475 -18358.6758 11.6321 15.5098 0.0054 1505.4527 284.9140
-18129.8828 11.6475 -18367.5723 11.6321 14.5254 0.0054 1636.3723 284.9140
-18138.8906 11.6475 -18381.5762 11.6321 20.0547 0.0054 1210.1188 284.9140
-18156.2676 11.6475 -18401.6680 11.6321 31.5781 0.0054 777.1215 284.9140
-18179.2832 11.6475 -18423.8613 11.6321 42.2422 0.0054 578.9902 284.9140
-18199.1445 11.6475 -18440.0156 11.6321 42.9062 0.0054 561.3893 284.9140
-18206.7480 11.6475 -18442.9004 11.6321 29.2617 0.0054 807.0351 284.9140
-18198.4980 11.6475 -18431.2910 11.6321 5.2500 0.0054 4434.1518 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