# Calculate speed at which two groups move towards each other

**URL:** <https://gromacs.bioexcel.eu/t/calculate-speed-at-which-two-groups-move-towards-each-other/3720>\
**Category:** User discussions\
**Created:** [February 22, 2022, 12:27am UTC](https://gromacs.bioexcel.eu/t/calculate-speed-at-which-two-groups-move-towards-each-other/3720 "2022-02-22T00:27:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwaldner](https://avatars.discourse-cdn.com/v4/letter/k/ecc23a/32.png) [@kwaldner](https://gromacs.bioexcel.eu/u/kwaldner)\
**Post date:** [February 22, 2022, 12:27am UTC](https://gromacs.bioexcel.eu/t/calculate-speed-at-which-two-groups-move-towards-each-other/3720/1 "2022-02-22T00:27:24Z")

</div>

I’m wondering if there is a way to calculate the speed at which two groups (drugs and polymer) move towards each other?

Also, is there a way to calculate the number of contacts between the two groups during the simulation? Is there a ‘default’ contact distance?

Thanks!

---

<div class="post-metadata">

**Author:** ![Marius](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Marius](https://gromacs.bioexcel.eu/u/Marius)\
**Post date:** [February 22, 2022, 8:49am UTC](https://gromacs.bioexcel.eu/t/calculate-speed-at-which-two-groups-move-towards-each-other/3720/2 "2022-02-22T08:49:51Z")

</div>

Hi @kwaldner,

I am not sure about your first question. You could maybe calculate the velocity of the center of masses of the groups. But maybe somebody else can help you more on that point.

For the second question, I would suggest to calculate the RDF/CDF of the polymer around the drugs (or the other way around, depending on your interest). The advantage is that the RDF and the CDF cover a wider range of distances than a simple contact analysis with only one cut-off. If you really want/need an analysis of the contacts you could use the distance at the first minimum of the RDF as a cut-off value. GROMACS has implemented tools for both types of analysis → gmx rdf and gmx mindist.

Hope I could help you!  
Marius

---

<div class="post-metadata">

**Author:** ![kwaldner](https://avatars.discourse-cdn.com/v4/letter/k/ecc23a/32.png) [@kwaldner](https://gromacs.bioexcel.eu/u/kwaldner)\
**Post date:** [February 22, 2022, 8:44pm UTC](https://gromacs.bioexcel.eu/t/calculate-speed-at-which-two-groups-move-towards-each-other/3720/3 "2022-02-22T20:44:38Z")

</div>

Thanks @Marius, that’s a good suggestion to use RDF. I will try that. Is there a straighforward way to calculate the velocity of the COMs?

---

<div class="post-metadata">

**Author:** ![Marius](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Marius](https://gromacs.bioexcel.eu/u/Marius)\
**Post date:** [February 23, 2022, 7:17am UTC](https://gromacs.bioexcel.eu/t/calculate-speed-at-which-two-groups-move-towards-each-other/3720/4 "2022-02-23T07:17:02Z")

</div>

Hi @kwaldner,

please take a look at this recent blog post:

> [@How to get the velocity of the COM of a pulling group?](https://gromacs.bioexcel.eu/t/how-to-get-the-velocity-of-the-com-of-a-pulling-group/3693):
>
> GROMACS version: 2018.8 Hello, I am using the COM pulling options in my .mdp file. The distance of the COM of a group is outputted by default. But at the same time, I also want to get the velocity of the pulling groups. I could use the results of the distance of the COM to calculate the velocity by \Delta D/ \Delta t, but the problem is that the fluctuation is extremely high and the data becomes useless. Although some data smooth methods can be used to reduce the fluctuation, the result is sti…

Cheers,  
Marius

---

<div class="post-metadata">

**Author:** ![scinikhil](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/scinikhil/32/3483_2.png) [@scinikhil](https://gromacs.bioexcel.eu/u/scinikhil)\
**Post date:** [February 23, 2022, 10:21am UTC](https://gromacs.bioexcel.eu/t/calculate-speed-at-which-two-groups-move-towards-each-other/3720/5 "2022-02-23T10:21:31Z")

</div>

> [@kwaldner](#):
>
> I’m wondering if there is a way to calculate the speed at which two groups (drugs and polymer) move towards each other?

What information you can get byt getting this value?
