# Inconsistency in the pressure calculation

**URL:** <https://gromacs.bioexcel.eu/t/inconsistency-in-the-pressure-calculation/10571>\
**Category:** User discussions\
**Created:** [November 18, 2024, 8:20am UTC](https://gromacs.bioexcel.eu/t/inconsistency-in-the-pressure-calculation/10571 "2024-11-18T08:20:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![horlust](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@horlust](https://gromacs.bioexcel.eu/u/horlust)\
**Post date:** [November 18, 2024, 8:20am UTC](https://gromacs.bioexcel.eu/t/inconsistency-in-the-pressure-calculation/10571/1 "2024-11-18T08:20:57Z")

</div>

GROMACS version: 2024  
GROMACS modification: No

Hi everyone,

It may be a silly question, but I’ve noticed an inconsistency between the average pressure output on GROMACS and the average pressure calculated with the generated .xvg file. For example, for a certain simulation, the output is:

## Energy Average Err.Est. RMSD Tot-Drift

Pressure 1.15318 0.27 308.222 -0.507331 (bar)

However, when calculating the average pressure through the .xvg file on Python, I get -48.23 bar. Is there an explanation? Am I doing something wrong?

Thanks!

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [November 18, 2024, 8:45am UTC](https://gromacs.bioexcel.eu/t/inconsistency-in-the-pressure-calculation/10571/2 "2024-11-18T08:45:53Z")

</div>

As it says in the `gmx energy` description [gmx energy - GROMACS 2024.4 documentation](https://manual.gromacs.org/current/onlinehelp/gmx-energy.html#description) :

“Average, RMSD, and drift are calculated with full precision from the simulation  
(see printed manual). Drift is calculated by performing a least-squares fit of the  
data to a straight line. The reported total drift is the difference of the fit at the first  
and last point. An error estimate of the average is given based on a block  
averages over 5 blocks using the full-precision averages. The error estimate can  
be performed over multiple block lengths with the options -nbmin and -nbmax.  
**Note** that in most cases the energy files contains averages over all MD steps, or  
over many more points than the number of frames in energy file. This makes the  
gmx energy statistics output more accurate than the .xvg output. When exact  
averages are not present in the energy file, the statistics mentioned above are  
simply over the single, per-frame energy values.”
