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.8184 11.6346 | -18174.8203 11.6346 | 0.0020 0.0000 | 100.0000 0.0000 |
| -18171.8145 11.6346 | -18193.2793 11.6346 | 6.8652 0.0000 | 312.6600 0.0000 |
| -18173.5527 11.6346 | -18237.2227 11.6346 | 14.9043 0.0000 | 427.1917 0.0000 |
| -18169.5645 11.6346 | -18284.6406 11.6346 | 23.0410 0.0000 | 499.4405 0.0000 |
| -18158.6836 11.6346 | -18322.6230 11.6346 | 29.7695 0.0000 | 550.6954 0.0000 |
| -18143.1758 11.6346 | -18343.9082 11.6346 | 35.0566 0.0000 | 572.5946 0.0000 |
| -18128.1738 11.6346 | -18349.0430 11.6346 | 40.0625 0.0000 | 551.3114 0.0000 |
| -18119.3066 11.6346 | -18344.5117 11.6346 | 45.8711 0.0000 | 490.9521 0.0000 |
| -18119.5938 11.6346 | -18338.2891 11.6346 | 52.2969 0.0000 | 418.1805 0.0000 |
| -18127.9023 11.6346 | -18335.8672 11.6346 | 57.5781 0.0000 | 361.1872 0.0000 |
| -18139.6426 11.6346 | -18338.3711 11.6346 | 59.5840 0.0000 | 333.5267 0.0000 |
| -18149.5527 11.6346 | -18343.9141 11.6346 | 57.3691 0.0000 | 338.7907 0.0000 |
| -18155.4727 11.6346 | -18350.7109 11.6346 | 53.2773 0.0000 | 366.4565 0.0000 |
| -18160.2168 11.6346 | -18359.6113 11.6346 | 52.1367 0.0000 | 382.4455 0.0000 |
| -18169.6953 11.6346 | -18373.4531 11.6346 | 58.0840 0.0000 | 350.7986 0.0000 |
| -18187.5703 11.6346 | -18393.4238 11.6346 | 70.1660 0.0000 | 293.3807 0.0000 |
| -18210.7793 11.6346 | -18415.5957 11.6346 | 81.0645 0.0000 | 252.6587 0.0000 |
| -18230.4082 11.6346 | -18431.8418 11.6346 | 81.4883 0.0000 | 247.1933 0.0000 |
| -18237.4473 11.6346 | -18434.8887 11.6346 | 67.2207 0.0000 | 293.7211 0.0000 |
| -18228.5762 11.6346 | -18423.4336 11.6346 | 42.4883 0.0000 | 458.6145 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:
