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:
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:
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
-
Input and output files for the unpeturbed calculation are available in this zip archive
-
Input and output files for the peturbed calculation are available in this zip archive
-
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.9844 11.6475 | -18234.6543 11.6321 | 21.1875 0.0054 | 196.6722 284.9140 |
| -18162.8418 11.6475 | -18289.6191 11.6321 | 14.5684 0.0054 | 870.2239 284.9140 |
| -18146.4883 11.6475 | -18332.0430 11.6321 | 13.9961 0.0054 | 1325.7606 284.9140 |
| -18125.3066 11.6475 | -18357.8418 11.6321 | 11.7949 0.0054 | 1971.4853 284.9140 |
| -18105.6328 11.6475 | -18366.5918 11.6321 | 10.6875 0.0054 | 2441.7215 284.9140 |
| -18093.7266 11.6475 | -18364.2207 11.6321 | 12.5723 0.0054 | 2151.5148 284.9140 |
| -18092.6875 11.6475 | -18358.6855 11.6321 | 17.3496 0.0054 | 1533.1645 284.9140 |
| -18101.0547 11.6475 | -18355.8535 11.6321 | 22.8477 0.0054 | 1115.2077 284.9140 |
| -18113.5625 11.6475 | -18357.4727 11.6321 | 26.0469 0.0054 | 936.4277 284.9140 |
| -18124.3105 11.6475 | -18362.2012 11.6321 | 25.2031 0.0054 | 943.8934 284.9140 |
| -18130.7012 11.6475 | -18368.5879 11.6321 | 21.9785 0.0054 | 1082.3602 284.9140 |
| -18135.3809 11.6475 | -18377.5352 11.6321 | 20.9785 0.0054 | 1154.2967 284.9140 |
| -18144.4746 11.6475 | -18391.6875 11.6321 | 26.5605 0.0054 | 930.7523 284.9140 |
| -18161.9219 11.6475 | -18411.9434 11.6321 | 38.1816 0.0054 | 654.8212 284.9140 |
| -18184.9590 11.6475 | -18434.1934 11.6321 | 48.8770 0.0054 | 509.9221 284.9140 |
| -18204.7598 11.6475 | -18450.2168 11.6321 | 49.4824 0.0054 | 496.0489 284.9140 |
| -18212.2793 11.6475 | -18452.8965 11.6321 | 35.7656 0.0054 | 672.7610 284.9140 |
| -18203.9277 11.6475 | -18441.1289 11.6321 | 11.6543 0.0054 | 2035.3110 284.9140 |
The table below includes some of the results from the calculation. The columns contain:
- Time series for the energy and volume that were obtained from the simulation at $T$ K, $x_{md}$.
- 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}$.
- 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.
- 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:
