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:
eENERGYCalculate 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:
eENERGYCalculate 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 |
-18194.3809 11.6475 | -18231.9336 11.6321 | 22.4121 0.0054 | 167.5556 284.9140 |
-18167.2266 11.6475 | -18280.5840 11.6321 | 18.4043 0.0054 | 615.9291 284.9140 |
-18154.7012 11.6475 | -18314.7422 11.6321 | 21.1387 0.0054 | 757.1006 284.9140 |
-18137.2773 11.6475 | -18332.2324 11.6321 | 22.1855 0.0054 | 878.7481 284.9140 |
-18120.5566 11.6475 | -18334.4102 11.6321 | 23.5547 0.0054 | 907.9021 284.9140 |
-18110.3613 11.6475 | -18328.1992 11.6321 | 26.8281 0.0054 | 811.9758 284.9140 |
-18109.8691 11.6475 | -18321.5801 11.6321 | 31.9863 0.0054 | 661.8794 284.9140 |
-18117.8613 11.6475 | -18319.6328 11.6321 | 37.0938 0.0054 | 543.9501 284.9140 |
-18129.6270 11.6475 | -18322.9863 11.6321 | 39.6074 0.0054 | 488.1898 284.9140 |
-18139.7188 11.6475 | -18329.3066 11.6321 | 38.2051 0.0054 | 496.2374 284.9140 |
-18145.7422 11.6475 | -18336.4648 11.6321 | 34.7168 0.0054 | 549.3671 284.9140 |
-18150.4473 11.6475 | -18345.3516 11.6321 | 33.7754 0.0054 | 577.0601 284.9140 |
-18159.7363 11.6475 | -18358.9492 11.6321 | 39.5723 0.0054 | 503.4154 284.9140 |
-18177.3867 11.6475 | -18378.7109 11.6321 | 51.3574 0.0054 | 392.0061 284.9140 |
-18200.4512 11.6475 | -18400.8438 11.6321 | 62.0566 0.0054 | 322.9188 284.9140 |
-18220.1230 11.6475 | -18417.2480 11.6321 | 62.5273 0.0054 | 315.2621 284.9140 |
-18227.3770 11.6475 | -18420.6094 11.6321 | 48.5371 0.0054 | 398.1128 284.9140 |
-18218.8027 11.6475 | -18409.3438 11.6321 | 24.2227 0.0054 | 786.6231 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: