[gmx-developers] printing to edr in source code

hess at sbc.su.se hess at sbc.su.se
Tue Sep 8 20:04:13 CEST 2009

Kinetic energy in the log and edr files is the average
of Ekin at minus and plus a half step.


> Hi GMX developers!
> (note: if this seems too rudimentary -- I posted first on the users' list
> but no one picked up the glove...)
> I'm trying to check that the energies I can calculate using the trajectory
> output are the same as those given by g_energy. I'm running a diatomic for
> only a couple of steps and already there are inconsistencies. I'm using
> g_traj to print out the x's and v's from the .trr file (indouble
> precision). The steps I'm looking at are at the beginningof the
> trajectory, but since my initial conditions are zero velocitiesand
> configuration very close to the energy-minimized one, I don't thinkthere
> should be any excessively large forces (the total energy is about21
> kJ/mole).
> I suspect that one possible factor could be that the leap-frog algorithm
> uses trajectory data (i.e. positions and velocities) different from those
> printed to the trajectory file. For example, it appears that the velocity
> printed out in the .trr file is notstrictly the velocity at that
> time-step, but the velocity given by anaverage of the kinetic energies
> half a time-step forwards and back(since GMX uses the leap-frog
> algorithm). This has managed to explainthe discrepancy in the kinetic
> energies (the one given by g_energy andthe one calculated from v's given
> by g_traj). As for the potentialenergy, I'm still trying to figure that
> out...
> Could you please direct me to the file and line in the source code where
> the kinetic and potential energies are calculated, just before they are
> printed to the edr file?
> Thanks very much in advance,
> --
> Inon   Sharony
> ינון     שרוני
> +972(3)6407634
> atto.TAU.ac.IL/~inonshar
> Please consider your environmental responsibility before printing this
> e-mail._______________________________________________
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-developers
> Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-developers-request at gromacs.org.

More information about the gromacs.org_gmx-developers mailing list