# Recalculate potential energy according to a different topology

**URL:** <https://gromacs.bioexcel.eu/t/recalculate-potential-energy-according-to-a-different-topology/3580>\
**Category:** User discussions\
**Tags:** free-energy\
**Created:** [February 2, 2022, 1:28am UTC](https://gromacs.bioexcel.eu/t/recalculate-potential-energy-according-to-a-different-topology/3580 "2022-02-02T01:28:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mvarun](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@mvarun](https://gromacs.bioexcel.eu/u/mvarun)\
**Post date:** [February 2, 2022, 1:28am UTC](https://gromacs.bioexcel.eu/t/recalculate-potential-energy-according-to-a-different-topology/3580/1 "2022-02-02T01:28:15Z")

</div>

GROMACS version: 2019.6  
GROMACS modification: No

Hi,

I need to calculate the potential energy of the configurations generated during my MD run according to a different potential. The system comprises spheres interacting via LJ potentials.  
I would like to take a simulation that has already been run and recalculate the potential energy for each frame according to a different LJ potential between them. This is required for input to pyMBAR.

Is there a GROMACS utility that I can use to rerun over my trajectory to get this information?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [February 2, 2022, 2:38am UTC](https://gromacs.bioexcel.eu/t/recalculate-potential-energy-according-to-a-different-topology/3580/2 "2022-02-02T02:38:12Z")

</div>

Generate a new `.tpr` file with the new topology and use `mdrun -rerun` on the existing trajectory, e.g.

`gmx mdrun -s new.tpr -rerun orig.xtc`

---

<div class="post-metadata">

**Author:** ![mvarun](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@mvarun](https://gromacs.bioexcel.eu/u/mvarun)\
**Post date:** [February 2, 2022, 2:52am UTC](https://gromacs.bioexcel.eu/t/recalculate-potential-energy-according-to-a-different-topology/3580/3 "2022-02-02T02:52:32Z")

</div>

Thanks Justin!  
Can I also specify table files during the rerun such as the following?

> gmx mdrun -s new.tpr -rerun orig.trr -table table.xvg

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [February 2, 2022, 3:03am UTC](https://gromacs.bioexcel.eu/t/recalculate-potential-energy-according-to-a-different-topology/3580/4 "2022-02-02T03:03:24Z")

</div>

Never tried it, but I assume so.
