# Distance between COM HP-beta-cyclodextrin and Gliclazide

**URL:** <https://gromacs.bioexcel.eu/t/distance-between-com-hp-beta-cyclodextrin-and-gliclazide/11748>\
**Category:** User discussions\
**Tags:** analysis-tools\
**Created:** [March 13, 2025, 5:44pm UTC](https://gromacs.bioexcel.eu/t/distance-between-com-hp-beta-cyclodextrin-and-gliclazide/11748 "2025-03-13T17:44:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uriel\_MTZ24](https://avatars.discourse-cdn.com/v4/letter/u/ed8c4c/32.png) [@Uriel\_MTZ24](https://gromacs.bioexcel.eu/u/Uriel_MTZ24)\
**Post date:** [March 13, 2025, 5:44pm UTC](https://gromacs.bioexcel.eu/t/distance-between-com-hp-beta-cyclodextrin-and-gliclazide/11748/1 "2025-03-13T17:44:27Z")

</div>

Hi everyone,

I’m trying to calculate the distance between the center of mass (COM) of **HP-beta-cyclodextrin** and **gliclazide** during a simulation using gmx distance, as referenced in [this paper](https://doi.org/10.36922/gpd.2657), However, I keep getting the following error:

Inconsistency in user input:  
Selection ‘GLZ’ does not evaluate into an even number of positions (there are 43 positions)

Gliclazide consists of **43 atoms** , so I assume this error is due to GROMACS expecting an even number of positions for the selection.

How can I properly define the selection so that gmx distance calculates the **COM distance** correctly? Is there a way to force GROMACS to compute the COM even with an odd number of atoms, or should I modify the selection somehow?

Any help would be greatly appreciated!

Thanks in advance.

---

<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:** [March 24, 2025, 10:20am UTC](https://gromacs.bioexcel.eu/t/distance-between-com-hp-beta-cyclodextrin-and-gliclazide/11748/2 "2025-03-24T10:20:16Z")

</div>

Hi,  
As far as I understand you want to calculate the distance between two or more selections. In that case gmx pairdist is better

> **[gmx pairdist - GROMACS 2025.1 documentation](https://manual.gromacs.org/documentation/current/onlinehelp/gmx-pairdist.html)**

To have the com of molecule, you could define the molecule in your index file and use option like `-selrpos`

Here you find a brief description for the difference between gmx distance gmx pairdist

> [@Selections for gmx distance/ gmx mindist / gmx pairdist](https://gromacs.bioexcel.eu/t/selections-for-gmx-distance-gmx-mindist-gmx-pairdist/3689/2):
>
> Hi, gmx mindist : does a selection of pollutant and surface atoms calculate the minimum distance between any pollutant atom and any surface atom at any time in my trajectory or is it somehow averaged across all residues? (i.e. in my case, if one pollutant is adsorbed but all the rest are in still solution how will this look in mindist?) gmx mindist calculates the minimum distance between the two groups at any times in the trajectory file. One group is the polluntants atoms and the other grou…

I hope it helps  
Alessandra  
Here you find more on [Topics tagged gmx-distance](https://gromacs.bioexcel.eu/tags/c/gromacs-user-forum/5/gmx-distance)

---

<div class="post-metadata">

**Author:** ![Uriel\_MTZ24](https://avatars.discourse-cdn.com/v4/letter/u/ed8c4c/32.png) [@Uriel\_MTZ24](https://gromacs.bioexcel.eu/u/Uriel_MTZ24)\
**Post date:** [March 24, 2025, 5:33pm UTC](https://gromacs.bioexcel.eu/t/distance-between-com-hp-beta-cyclodextrin-and-gliclazide/11748/3 "2025-03-24T17:33:59Z")

</div>

I see, thank you so much for the response!!
