wrong temperature reported at end of sim with uneven number of steps
For one of my simulations i get a temperature of 3000 K reported for the last bit of 333333 steps, where it was equilibrated around 298.15 K before.
I tried to reproduce this with 333 steps, but that did not result in a spike. Therefore I include the ener.edr file. Using gmx dump, one sees the spike is in the .edr file, so this is not a problem of gmx energy.
Output correct kinetic at last step (modular simulator)
This replicates the fix in I9a0bc228 for the modular simulator.
Fixes a bug which would write an incorrect kinetic energy and
temperature to the energy and log files when using the leap-frog
integrator and having a last step not coinciding with an energy
Always output correct kinetic at last step
When the last step did not coincide with an energy calculation step,
the kinetic energy and temperature written to the energy and log
file were incorrect when using the leap frog integrator.
#2 Updated by Paul Bauer over 1 year ago
- File 3355.tpr 3355.tpr added
- File ener_3355steps.edr ener_3355steps.edr added
- File md_3355steps.log md_3355steps.log added
so, investigating further I found that the only thing significantly diverging between the average and final write step energies is the kinetic energy contribution
The results here are from extending the previous 3333 step run to 3355 steps to have a fast reproducer
Energies (kJ/mol) Bond Angle Ryckaert-Bell. LJ-14 Coulomb-14 5.87965e+03 3.71328e+04 6.73000e+03 0.00000e+00 6.87208e+04 LJ (SR) Coulomb (SR) Coul. recip. Potential Kinetic En. -8.25315e+03 -2.94160e+05 2.65487e+03 -1.81295e+05 1.66365e+06 Total Energy Conserved En. Temperature Pressure (bar) Constr. rmsd 1.48235e+06 1.48278e+06 4.63189e+03 4.11956e+04 1.81575e-06 <====== ############### ==> <==== A V E R A G E S ====> <== ############### ======> Statistics over 3356 steps using 34 frames Energies (kJ/mol) Bond Angle Ryckaert-Bell. LJ-14 Coulomb-14 6.11285e+03 3.70713e+04 6.90941e+03 0.00000e+00 6.86842e+04 LJ (SR) Coulomb (SR) Coul. recip. Potential Kinetic En. -8.27930e+03 -2.93863e+05 2.67504e+03 -1.80689e+05 1.07054e+05 Total Energy Conserved En. Temperature Pressure (bar) Constr. rmsd -7.36357e+04 -7.37932e+04 2.98057e+02 -2.11207e+01 0.00000e+00
The kinetic energy seems to be wrong by a factor of 10.
#6 Updated by Marvin Bernhardt about 1 year ago
Any tip on how to provoke the wrong temperature without running all 333333 steps?
I tried with 3333 steps, but don't get a spike with a not-fixed-2019.3
I also had a look at the fix, but I do not really get what the expression
step_rel + 1 == ir->nsteps