# Command to calculate energy of newly defined groups from an pre calculated xtc file

**URL:** <https://gromacs.bioexcel.eu/t/command-to-calculate-energy-of-newly-defined-groups-from-an-pre-calculated-xtc-file/4668>\
**Category:** User discussions\
**Tags:** mdp-parameters, mdrun\
**Created:** [August 24, 2022, 8:28am UTC](https://gromacs.bioexcel.eu/t/command-to-calculate-energy-of-newly-defined-groups-from-an-pre-calculated-xtc-file/4668 "2022-08-24T08:28:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![samapika](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@samapika](https://gromacs.bioexcel.eu/u/samapika)\
**Post date:** [August 24, 2022, 8:28am UTC](https://gromacs.bioexcel.eu/t/command-to-calculate-energy-of-newly-defined-groups-from-an-pre-calculated-xtc-file/4668/1 "2022-08-24T08:28:22Z")

</div>

GROMACS version: 2018.1  
GROMACS modification: No  
I have already completed the simulation. But now I am interested in calculating the energy of different system subgroups. I found that I can evaluate the same using gmx mdrun -rerun command.  
Do I need to generate a fresh tpr file and feed in the command? How should I extract the new edr file containing the energy of the new subgroups?

Please suggest.

---

<div class="post-metadata">

**Author:** ![alevilla](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/alevilla/32/439_2.png) [@alevilla](https://gromacs.bioexcel.eu/u/alevilla)\
**Post date:** [August 24, 2022, 9:53am UTC](https://gromacs.bioexcel.eu/t/command-to-calculate-energy-of-newly-defined-groups-from-an-pre-calculated-xtc-file/4668/2 "2022-08-24T09:53:57Z")

</div>

Hi,  
this post may already answer to one of your questions [Calculating vdW and ES energy between molecules](https://gromacs.bioexcel.eu/t/calculating-vdw-and-es-energy-between-molecules/386)

> [@samapika](#):
>
> How should I extract the new edr file containing the energy of the new subgroups?

You can use gmx energy to extract energy from energy file \*.edr.

\Alessandra
