[gmx-users] g_energy averages
Erik Lindahl
lindahl at stanford.edu
Wed Jul 17 19:03:41 CEST 2002
David L. Bostick wrote:
> HI,
>
> I use g_energy on an edr file from a constant surface tension simulation.
> I printed out Box-X, Box-Y, and Box-Z lengths and Press-XX, Press-YY, and
> Press-ZZ pressures. I am trying to fine tune a bilayer/protein system in
> order to preserve the xy-area of the box. I parsed the xvg file using a
> simple awk script in order to calculate area, surface tension, average
> pressures.. etc, but when comparing the values to those generated by
> g_energy, there is a small discrepancy. I am pretty sure I am calculating
> things correctly. Does g_energy use some other precision for it's
> calculation of averages and so forth?
>
Well, not a different precison but a completely different algorithm :-)
It is described in detail at the end of the manual.
We actually store a couple of partial sums in the energy file, which
makes it possible to calculate the REAL average and fluctuation from all
the simulation steps - not only the average of the values written to the
energy file.
It's kind of complicated; the easiest way to do it (as you've probably
seen in a statistics textbook) is to store the sum and sum-of-squared
values, but that leads to numerical inaccuracies for longs trajectories,
thus the need for partial sums.
Cheers,
Erik
More information about the gromacs.org_gmx-users
mailing list