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
-39774.1262 8.4175 -39774.1262 8.4175 0.0000 0.0000 0.0000 0.0000
-39775.3685 8.4177 -39775.3205 8.4176 0.1232 0.0000 39.0068 100.0000
-39777.6814 8.4184 -39777.4903 8.4182 0.4906 0.0001 38.9550 100.0000
-39780.5490 8.4195 -39780.1143 8.4192 1.1095 0.0003 39.1799 100.0000
-39784.9267 8.4211 -39784.1600 8.4205 1.9636 0.0006 39.0464 100.0000
-39790.6379 8.4231 -39789.4629 8.4222 3.0321 0.0009 38.7525 100.1075
-39796.8501 8.4256 -39795.6828 8.4243 3.8347 0.0013 30.4417 100.0000
-39803.1513 8.4286 -39800.8262 8.4268 5.3909 0.0018 43.1305 100.0550
-39810.5306 8.4320 -39808.0361 8.4296 7.1667 0.0024 34.8068 100.0421
-39818.7940 8.4358 -39815.8197 8.4328 8.8352 0.0030 33.6643 100.1000
-39827.2275 8.4401 -39824.0387 8.4364 10.0141 0.0037 31.8433 100.1082
-39837.6784 8.4448 -39833.2083 8.4404 13.1239 0.0045 34.0604 100.1343
-39848.4496 8.4500 -39842.5180 8.4447 15.2295 0.0053 38.9478 100.1507
-39858.6919 8.4556 -39854.0928 8.4494 16.9920 0.0062 27.0665 100.1931
-39873.1650 8.4617 -39865.5073 8.4545 20.8782 0.0072 36.6783 100.2085
-39886.9740 8.4682 -39878.9794 8.4599 23.7104 0.0082 33.7174 100.2549
-39900.8740 8.4751 -39893.2083 8.4657 25.1962 0.0094 30.4239 100.2887
-39913.4983 8.4824 -39905.8788 8.4718 26.4756 0.0105 28.7797 100.3228
-39926.6434 8.4902 -39917.3175 8.4784 29.5526 0.0118 31.5571 100.3737
-39942.5323 8.4984 -39929.8297 8.4852 36.4867 0.0131 34.8145 100.4127

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