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 of 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 of 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 |
-18171.5801 11.6346 | -18237.1973 11.6346 | 12.4277 0.0000 | 527.9900 0.0000 |
-18163.4336 11.6346 | -18284.4844 11.6346 | 15.3047 0.0000 | 790.9392 0.0000 |
-18147.1914 11.6346 | -18322.3047 11.6346 | 15.1914 0.0000 | 1152.7128 0.0000 |
-18126.4219 11.6346 | -18343.4277 11.6346 | 13.6797 0.0000 | 1586.3364 0.0000 |
-18107.2988 11.6346 | -18348.4570 11.6346 | 13.2266 0.0000 | 1823.2871 0.0000 |
-18096.0195 11.6346 | -18343.8652 11.6346 | 15.6875 0.0000 | 1579.8929 0.0000 |
-18095.5762 11.6346 | -18337.6152 11.6346 | 20.8750 0.0000 | 1159.4686 0.0000 |
-18104.3848 11.6346 | -18335.2168 11.6346 | 26.5879 0.0000 | 868.1848 0.0000 |
-18117.1680 11.6346 | -18337.7500 11.6346 | 29.7930 0.0000 | 740.3828 0.0000 |
-18128.0312 11.6346 | -18343.3184 11.6346 | 28.8594 0.0000 | 745.9867 0.0000 |
-18134.4316 11.6346 | -18350.1230 11.6346 | 25.5117 0.0000 | 845.4601 0.0000 |
-18139.1621 11.6346 | -18359.0254 11.6346 | 24.4941 0.0000 | 897.6158 0.0000 |
-18148.3516 11.6346 | -18372.8750 11.6346 | 30.1797 0.0000 | 743.9555 0.0000 |
-18165.9551 11.6346 | -18392.8242 11.6346 | 41.9180 0.0000 | 541.2217 0.0000 |
-18189.1133 11.6346 | -18414.9883 11.6346 | 52.6777 0.0000 | 428.7865 0.0000 |
-18208.9258 11.6346 | -18431.2344 11.6346 | 53.2266 0.0000 | 417.6648 0.0000 |
-18216.3242 11.6346 | -18434.3105 11.6346 | 39.3320 0.0000 | 554.2209 0.0000 |
-18207.7969 11.6346 | -18422.8555 11.6346 | 15.0293 0.0000 | 1430.9292 0.0000 |
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: