# Average velocities

**URL:** <https://gromacs.bioexcel.eu/t/average-velocities/1445>\
**Category:** User discussions\
**Created:** [January 15, 2021, 1:24pm UTC](https://gromacs.bioexcel.eu/t/average-velocities/1445 "2021-01-15T13:24:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![yasser.almeida](https://avatars.discourse-cdn.com/v4/letter/y/76d3ee/32.png) [@yasser.almeida](https://gromacs.bioexcel.eu/u/yasser.almeida)\
**Post date:** [January 15, 2021, 1:24pm UTC](https://gromacs.bioexcel.eu/t/average-velocities/1445/1 "2021-01-15T13:24:01Z")

</div>

GROMACS version: 2020.1  
GROMACS modification: No

Hi all,

I want to calculate the average velocity of a particle group in different systems. I am using:

`gmx traj -s system_1.tpr -f system_1.trr -av system_1.xvg -dt 50 -b 250 -nojump`

… but I get:

```
WARNING: No coordinate frames found for option -cv or -cf

No frames found for average velocity, will not write veloc.pdb

```

What am I missing? The `.trr` file should also contain coordinates, right?

Thanks in advance.

Best  
-Yasser

---

<div class="post-metadata">

**Author:** ![cblau](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/cblau/32/5_2.png) [@cblau](https://gromacs.bioexcel.eu/u/cblau)\
**Post date:** [January 15, 2021, 1:29pm UTC](https://gromacs.bioexcel.eu/t/average-velocities/1445/2 "2021-01-15T13:29:44Z")

</div>

Hi Yasser,

The `trr` file only contains velocities and forces if the `nstfout` and `nstvout` are not set to zero (as they are by default).  
[https://manual.gromacs.org/documentation/current/user-guide/mdp-options.html#output-control](https://manual.gromacs.org/documentation/current/user-guide/mdp-options.html#output-control)

---

<div class="post-metadata">

**Author:** ![yasser.almeida](https://avatars.discourse-cdn.com/v4/letter/y/76d3ee/32.png) [@yasser.almeida](https://gromacs.bioexcel.eu/u/yasser.almeida)\
**Post date:** [January 15, 2021, 1:35pm UTC](https://gromacs.bioexcel.eu/t/average-velocities/1445/3 "2021-01-15T13:35:17Z")

</div>

Hi,

Thanks for the reply.

In my case `nstfout` = `nstvout` = 5000 (otherwise the file would be huge). I am only interested in the velocities, not in the `veloc.pdb`. It is possible to get it without the coordinates?

---

<div class="post-metadata">

**Author:** ![cblau](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/cblau/32/5_2.png) [@cblau](https://gromacs.bioexcel.eu/u/cblau)\
**Post date:** [January 15, 2021, 1:38pm UTC](https://gromacs.bioexcel.eu/t/average-velocities/1445/4 "2021-01-15T13:38:17Z")

</div>

Ah, I see - sorry , I misunderstood the setup. Let me have a look, there should be a way. I’ll reply as soon as I figured.

---

<div class="post-metadata">

**Author:** ![cblau](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/cblau/32/5_2.png) [@cblau](https://gromacs.bioexcel.eu/u/cblau)\
**Post date:** [January 15, 2021, 1:42pm UTC](https://gromacs.bioexcel.eu/t/average-velocities/1445/5 "2021-01-15T13:42:16Z")

</div>

Hi Yasser,

Does `-av` and `-af` work for you? The `trr` does indeed not contain coordinates if you set `nstxout=0`.

---

<div class="post-metadata">

**Author:** ![yasser.almeida](https://avatars.discourse-cdn.com/v4/letter/y/76d3ee/32.png) [@yasser.almeida](https://gromacs.bioexcel.eu/u/yasser.almeida)\
**Post date:** [January 15, 2021, 1:49pm UTC](https://gromacs.bioexcel.eu/t/average-velocities/1445/6 "2021-01-15T13:49:26Z")

</div>

Hi,

No, that’s what I tried before and got the error (see the first post). In my case `nstxout=5000`. I tried the `-ov` option and works, but the file is huge and messy, since it reports the velocity for each particle at each frame.

---

<div class="post-metadata">

**Author:** ![cblau](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/cblau/32/5_2.png) [@cblau](https://gromacs.bioexcel.eu/u/cblau)\
**Post date:** [January 21, 2021, 11:56am UTC](https://gromacs.bioexcel.eu/t/average-velocities/1445/7 "2021-01-21T11:56:55Z")

</div>

Hi Yasser,

I found some time to have a closer look at the source code - it was written overlooking the possiblity that one might have only velocities and forces on hand, but not the coordinates. I was trying to re-write the tool, but could not do a quick-fix and it’s part of future refactoring efforts to provide tools that don’t have that type of issue (the code of `gmx traj` is at least 17 years old).

Does using `gmx trajectory -seltype res_com` help to get averaged numbers per residue? I did not try myself, but it might be an easier way forward…

Best,  
Christian

---

<div class="post-metadata">

**Author:** ![yasser.almeida](https://avatars.discourse-cdn.com/v4/letter/y/76d3ee/32.png) [@yasser.almeida](https://gromacs.bioexcel.eu/u/yasser.almeida)\
**Post date:** [January 25, 2021, 8:57am UTC](https://gromacs.bioexcel.eu/t/average-velocities/1445/8 "2021-01-25T08:57:50Z")

</div>

Hi Christian,

I will try with `gmx trajectory`. I used `gmx msd` as a turn around.

Thanks,  
-Yasser

---

<div class="post-metadata">

**Author:** ![cblau](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/cblau/32/5_2.png) [@cblau](https://gromacs.bioexcel.eu/u/cblau)\
**Post date:** [January 25, 2021, 12:25pm UTC](https://gromacs.bioexcel.eu/t/average-velocities/1445/9 "2021-01-25T12:25:00Z")

</div>

Good - I did not think of `gmx msd`. I’m tagging @pbauer as this is closely related to the work he had planned (as far as I know) on converting and extracting information from trajectories.
