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.9219 11.6475 | -18232.7383 11.6321 | 22.9004 0.0054 | 165.1343 284.9140 |
-18168.9238 11.6475 | -18283.3496 11.6321 | 19.9258 0.0054 | 574.2600 284.9140 |
-18157.8477 11.6475 | -18320.0293 11.6321 | 23.9785 0.0054 | 676.3623 284.9140 |
-18141.8906 11.6475 | -18340.0469 11.6321 | 26.3379 0.0054 | 752.3619 284.9140 |
-18126.3027 11.6475 | -18344.2539 11.6321 | 28.7207 0.0054 | 758.8643 284.9140 |
-18116.7793 11.6475 | -18339.2129 11.6321 | 32.5645 0.0054 | 683.0564 284.9140 |
-18116.4648 11.6475 | -18332.9082 11.6321 | 37.8535 0.0054 | 571.7920 284.9140 |
-18124.3359 11.6475 | -18330.7031 11.6321 | 42.8223 0.0054 | 481.9156 284.9140 |
-18135.8047 11.6475 | -18333.5332 11.6321 | 45.0625 0.0054 | 438.7873 284.9140 |
-18145.6270 11.6475 | -18339.3672 11.6321 | 43.4199 0.0054 | 446.2013 284.9140 |
-18151.5176 11.6475 | -18346.2812 11.6321 | 39.8164 0.0054 | 489.1543 284.9140 |
-18156.2344 11.6475 | -18355.1738 11.6321 | 38.9180 0.0054 | 511.1763 284.9140 |
-18165.5938 11.6475 | -18368.9609 11.6321 | 44.7773 0.0054 | 454.1743 284.9140 |
-18183.3301 11.6475 | -18388.8633 11.6321 | 56.6660 0.0054 | 362.7098 284.9140 |
-18206.4102 11.6475 | -18411.0273 11.6321 | 67.3516 0.0054 | 303.8047 284.9140 |
-18226.0215 11.6475 | -18427.3359 11.6321 | 67.7441 0.0054 | 297.1688 284.9140 |
-18233.1797 11.6475 | -18430.4707 11.6321 | 53.6758 0.0054 | 367.5606 284.9140 |
-18224.5254 11.6475 | -18419.0508 11.6321 | 29.2930 0.0054 | 664.0685 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: