# How to get potential energy of a single water molecule with the rest of the system

**URL:** <https://gromacs.bioexcel.eu/t/how-to-get-potential-energy-of-a-single-water-molecule-with-the-rest-of-the-system/1492>\
**Category:** User discussions\
**Created:** [January 27, 2021, 12:31am UTC](https://gromacs.bioexcel.eu/t/how-to-get-potential-energy-of-a-single-water-molecule-with-the-rest-of-the-system/1492 "2021-01-27T00:31:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![PanyueW](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@PanyueW](https://gromacs.bioexcel.eu/u/PanyueW)\
**Post date:** [January 27, 2021, 12:31am UTC](https://gromacs.bioexcel.eu/t/how-to-get-potential-energy-of-a-single-water-molecule-with-the-rest-of-the-system/1492/1 "2021-01-27T00:31:06Z")

</div>

GROMACS version: 2020  
GROMACS modification: No  
I am trying to get the interaction energy of one water molecule with the rest of the system over an MD trajectory. First I defined a group in the index file call “BULK\_H2O,” then I added this group to the mdp energy group option. I ran the MD for 10 ps and got the edr file. Finally, I use gmx energy to get the potential energy of this water molecule, but I am getting zeros for all kinds of interactions (LJ and coulomb).  
The defines are there for position restraints of protein and ligand respectively.  
Here’s my mdp:  
define = -DPOSRES -DPOSRES\_LIGAND -DPOSRES\_FC\_HG=1000 -DPOSRES\_FC\_HG\_C=1000 -DPOSRES\_FC=1000  
integrator = sd  
dt = 0.001  
tinit = 0  
nsteps = 10000 ; 10 ps  
nstxout = 0 ; every 0.5 ps  
nstvout = 0  
nstfout = 0  
nstxtcout = 500 ; every 0.5 ps  
nstenergy = 500  
energygrps = BULK\_H2O BULK\_rest  
comm\_mode = None  
constraint\_algorithm = lincs  
lincs\_iter = 2  
constraints = all-bonds  
nstlist = 20  
ns\_type = grid  
rlist = 1.4  
rcoulomb = 1.2  
rvdw = 1.2  
Tcoupl = no;  
tc\_grps = System  
tau\_t = 2  
ref\_t = 310  
Pcoupl = no  
pcoupltype = isotropic  
tau\_p = 1.0  
compressibility = 4.5e-5  
ref\_p = 1.0  
refcoord\_scaling = com  
pbc = xyz  
gen\_vel = yes  
gen\_temp = 310  
gen\_seed = 290389

---

<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:** [January 27, 2021, 2:00pm UTC](https://gromacs.bioexcel.eu/t/how-to-get-potential-energy-of-a-single-water-molecule-with-the-rest-of-the-system/1492/2 "2021-01-27T14:00:31Z")

</div>

> [@PanyueW](#):
>
> Finally, I use gmx energy to get the potential energy of this water molecule, but I am getting zeros for all kinds of interactions (LJ and coulomb).

I’m guessing you ran your simulation on a GPU, which cannot handle different energy groups. In any case, this is an analysis method and shouldn’t really be invoked during the run, anyway. Use `mdrun -rerun` on CPU only to recalculate the interaction energies.

---

<div class="post-metadata">

**Author:** ![PanyueW](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@PanyueW](https://gromacs.bioexcel.eu/u/PanyueW)\
**Post date:** [January 29, 2021, 5:02pm UTC](https://gromacs.bioexcel.eu/t/how-to-get-potential-energy-of-a-single-water-molecule-with-the-rest-of-the-system/1492/4 "2021-01-29T17:02:26Z")

</div>

Hi, thanks for the reply. Indeed I have run my MD on a GPU. I have tried “gmx mdrun -rerun md.xtc -nb cpu,” but I am still getting 0 for the interaction energies. I do have values for total potential though.

---

<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:** [January 29, 2021, 5:35pm UTC](https://gromacs.bioexcel.eu/t/how-to-get-potential-energy-of-a-single-water-molecule-with-the-rest-of-the-system/1492/5 "2021-01-29T17:35:52Z")

</div>

Which energy terms are you analyzing?

---

<div class="post-metadata">

**Author:** ![PanyueW](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@PanyueW](https://gromacs.bioexcel.eu/u/PanyueW)\
**Post date:** [January 29, 2021, 5:52pm UTC](https://gromacs.bioexcel.eu/t/how-to-get-potential-energy-of-a-single-water-molecule-with-the-rest-of-the-system/1492/7 "2021-01-29T17:52:10Z")

</div>

LJ-SR and Coulomb-SR of my water molecule vs. the rest of the system.

---

<div class="post-metadata">

**Author:** ![gvigers](https://avatars.discourse-cdn.com/v4/letter/g/a9a28c/32.png) [@gvigers](https://gromacs.bioexcel.eu/u/gvigers)\
**Post date:** [April 1, 2022, 6:41pm UTC](https://gromacs.bioexcel.eu/t/how-to-get-potential-energy-of-a-single-water-molecule-with-the-rest-of-the-system/1492/8 "2022-04-01T18:41:41Z")

</div>

I’m seeing the same thing. This is the third thread that I’ve found with a very similar problem but without a resolution. Is there anyone that I can work with on this? I’m happy to upload files or work with a developer directly. Just let me know!

Thank you

Guy Vigers
