# Rdf between Centre of mass of a molecule and a cation

**URL:** <https://gromacs.bioexcel.eu/t/rdf-between-centre-of-mass-of-a-molecule-and-a-cation/5344>\
**Category:** User discussions\
**Created:** [December 1, 2022, 12:47pm UTC](https://gromacs.bioexcel.eu/t/rdf-between-centre-of-mass-of-a-molecule-and-a-cation/5344 "2022-12-01T12:47:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sourav7](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@Sourav7](https://gromacs.bioexcel.eu/u/Sourav7)\
**Post date:** [December 1, 2022, 12:47pm UTC](https://gromacs.bioexcel.eu/t/rdf-between-centre-of-mass-of-a-molecule-and-a-cation/5344/1 "2022-12-01T12:47:48Z")

</div>

GROMACS version:  
GROMACS modification: Yes/No  
Here post your question  
I am facing problem during the calculation of rdf between a centre of mass of a molecule and a cation.  
I tried the -selrpos -seltype options but using this the rdf I am getting is wrong … there is an extra peak coming… but there is no problem when I am calculating the rdf between the centre of mass of two molecule using selrpos and seltype options. And also there is no problem during the calculation of rdf between two atoms in normal way.  
Please help me out why only this problem is arrising during the calculation of rdf of centre of mass of a molecule and a cation or atom.

---

<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:** [December 2, 2022, 8:48am UTC](https://gromacs.bioexcel.eu/t/rdf-between-centre-of-mass-of-a-molecule-and-a-cation/5344/2 "2022-12-02T08:48:52Z")

</div>

Hi,  
can you post the command line that you use? and something more on the system, e.i is the cation composed of one atom or more atoms?  
Thank you  
Alessandra

---

<div class="post-metadata">

**Author:** ![Sourav7](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@Sourav7](https://gromacs.bioexcel.eu/u/Sourav7)\
**Post date:** [June 30, 2023, 11:22am UTC](https://gromacs.bioexcel.eu/t/rdf-between-centre-of-mass-of-a-molecule-and-a-cation/5344/3 "2023-06-30T11:22:16Z")

</div>

Command line  
gmx rdf -f .xtc -s .tpr -selrpos mol\_com -n index.ndx -ref 0 -sel 1 -o rdf.xvg  
Cation is monovalent cation like Li, Na etc.

---

<div class="post-metadata">

**Author:** ![xieliqiang](https://avatars.discourse-cdn.com/v4/letter/x/ea666f/32.png) [@xieliqiang](https://gromacs.bioexcel.eu/u/xieliqiang)\
**Post date:** [February 2, 2024, 2:04am UTC](https://gromacs.bioexcel.eu/t/rdf-between-centre-of-mass-of-a-molecule-and-a-cation/5344/4 "2024-02-02T02:04:53Z")

</div>

your problem fixed?

---

<div class="post-metadata">

**Author:** ![Sourav7](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@Sourav7](https://gromacs.bioexcel.eu/u/Sourav7)\
**Post date:** [March 18, 2024, 10:21am UTC](https://gromacs.bioexcel.eu/t/rdf-between-centre-of-mass-of-a-molecule-and-a-cation/5344/5 "2024-03-18T10:21:28Z")

</div>

yes  
gmx\_mpi rdf -f md.xtc -s md.tpr -ref ‘mol\_com of group 2’ -sel ‘group 3’ -o rdf.xvg  
this is the command
