# Rerunning a simulation changes the energy components

**URL:** <https://gromacs.bioexcel.eu/t/rerunning-a-simulation-changes-the-energy-components/4281>\
**Category:** User discussions\
**Tags:** mdrun\
**Created:** [June 8, 2022, 1:14pm UTC](https://gromacs.bioexcel.eu/t/rerunning-a-simulation-changes-the-energy-components/4281 "2022-06-08T13:14:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacqueries](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@Jacqueries](https://gromacs.bioexcel.eu/u/Jacqueries)\
**Post date:** [June 8, 2022, 1:14pm UTC](https://gromacs.bioexcel.eu/t/rerunning-a-simulation-changes-the-energy-components/4281/1 "2022-06-08T13:14:45Z")

</div>

GROMACS version:2022 single  
GROMACS modification: No

I have simulations for a glycosilated protein dimer. There is two types of sugar and two glycosilation by monomer so the dimer has 4 sugars.  
I performed a first simulation with:

gmx mdrun -s changeMDP.tpr -deffnm MDRUN

For the first frame I get this in the .log file (the .edr is the same):

Energies (kJ/mol)

```
       Bond U-B Proper Dih. Improper Dih. CMAP Dih.
1.07905e+04 2.87134e+04 3.29585e+04 1.53244e+03 -1.42534e+03
      LJ-14 Coulomb-14 LJ (SR) Coulomb (SR) Coul. recip.
8.73737e+03 1.30080e+05 1.16829e+06 -1.25230e+07 3.58665e+04
  Potential Kinetic En. Total Energy Conserved En. Temperature

```

-1.11074e+07 1.97155e+06 -9.13586e+06 -9.13539e+06 3.02867e+02  
Pressure (bar) Constr. rmsd  
3.65355e+02 5.01554e-06

When I rerun the same simulation with the same .tpr with:

gmx mdrun -s changeMDP.tpr -rerun MDRUN.xtc -deffnm RERUN

For the first frame of the .log file I obtain:

Energies (kJ/mol)

```
       Bond U-B Proper Dih. Improper Dih. CMAP Dih.
2.59153e+04 4.00655e+04 3.37678e+04 2.62683e+03 -1.33921e+03
      LJ-14 Coulomb-14 LJ (SR) Coulomb (SR) Coul. recip.
9.13910e+03 1.30032e+05 1.23807e+06 -1.25310e+07 4.21402e+04
  Potential

```

-1.10106e+07

Why do I obtain different results using -rerun using the same .tpr file ?

Thanks a lot !

EDIT:  
Here is the content of the .mdp used for the creation of the .tpr:  
integrator = md  
dt = 0.002  
nsteps = 1000000000 ; 1000 ns  
nstlog = 10000  
nstxout = 0  
nstvout = 0  
nstfout = 0  
nstcalcenergy = 100  
nstenergy = 10000  
nstxout-compressed = 10000  
compressed-x-precision = 100  
;  
cutoff-scheme = Verlet  
nstlist = 20  
rlist = 1.2  
coulombtype = pme  
rcoulomb = 1.2  
vdwtype = Cut-off  
vdw-modifier = Force-switch  
rvdw\_switch = 1.0  
rvdw = 1.2  
;  
tcoupl = Nose-Hoover  
tc\_grps = Protein\_with\_sugar non\_protein\_non\_sugar  
tau\_t = 1.0 1.0  
ref\_t = 300 300  
;  
pcoupl = Parrinello-Rahman  
pcoupltype = isotropic  
tau\_p = 5.0  
compressibility = 4.5e-5  
ref\_p = 1.0  
;  
constraints = h-bonds  
constraint\_algorithm = LINCS  
continuation = yes  
;  
nstcomm = 100  
comm\_mode = linear  
comm\_grps = Protein\_with\_sugar non\_protein\_non\_sugar  
;  
refcoord\_scaling = com  
energygrps = Protein\_with\_sugar non\_protein\_non\_sugar

---

<div class="post-metadata">

**Author:** ![adq](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@adq](https://gromacs.bioexcel.eu/u/adq)\
**Post date:** [August 3, 2022, 10:41am UTC](https://gromacs.bioexcel.eu/t/rerunning-a-simulation-changes-the-energy-components/4281/2 "2022-08-03T10:41:09Z")

</div>

Hi Jaquieries,

I am having exactlty the same problem as you report. Evaluating the energy of a single frame using the same tpr file with rerun vs regular run result in slightly (15%) different potential energies.

Could someone let us know if we should specify a special any setting in the input script, or is this expected behaviour?

Many thanks to the community in advance

---

<div class="post-metadata">

**Author:** ![Jacqueries](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@Jacqueries](https://gromacs.bioexcel.eu/u/Jacqueries)\
**Post date:** [August 3, 2022, 12:26pm UTC](https://gromacs.bioexcel.eu/t/rerunning-a-simulation-changes-the-energy-components/4281/3 "2022-08-03T12:26:01Z")

</div>

Hi adq,  
I didn’t find any solution for this… I also had a strange result in the decomposition, some of the 1-4 Electrostatic and hydrophobic contribution were taking into account pairs of atoms that were extremely far from each other and were not linked in 1-4. I verified the simulation and the topolgy and theses atoms are not linked in any way.  
Do you find this bug in your results ? ( do you have computed the decomposition for groups that cannot interact in 1-4 but you still obtain a value ?)

---

<div class="post-metadata">

**Author:** ![adq](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@adq](https://gromacs.bioexcel.eu/u/adq)\
**Post date:** [August 3, 2022, 12:31pm UTC](https://gromacs.bioexcel.eu/t/rerunning-a-simulation-changes-the-energy-components/4281/4 "2022-08-03T12:31:40Z")

</div>

Hi,

No, I don’t think I experience the second bit. Did you try the run and the rerun both without any constrains? I thought it would be related to this. May be some experts can comment?

Thanks!

---

<div class="post-metadata">

**Author:** ![pbauer](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pbauer/32/13_2.png) [@pbauer](https://gromacs.bioexcel.eu/u/pbauer)\
**Post date:** [August 3, 2022, 8:15pm UTC](https://gromacs.bioexcel.eu/t/rerunning-a-simulation-changes-the-energy-components/4281/5 "2022-08-03T20:15:31Z")

</div>

Hello,

this sounds indeed strange. Could you open a bug report at  
[Issues · GROMACS / GROMACS · GitLab](http://gitlab.com/gromacs/gromacs/-/issues) and upload a minimum tpr and  
trajectory that reproduces the issue?

We have recently fixed some issues with energy contributions from  
excluded atom pairs, and if something is going wrong there we need to know.

As an additional test, could you check this with the most recent 2022.2  
patch?

Thanks for your help!

Cheers

Paul

---

<div class="post-metadata">

**Author:** ![spoblete](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@spoblete](https://gromacs.bioexcel.eu/u/spoblete)\
**Post date:** [April 29, 2024, 1:49pm UTC](https://gromacs.bioexcel.eu/t/rerunning-a-simulation-changes-the-energy-components/4281/6 "2024-04-29T13:49:52Z")

</div>

Greetings.

I would like to know if this issue was already solved since I observed the same problem using Gromacs 2021.

Best regards,

Simón
