# About the density of numbers

**URL:** <https://gromacs.bioexcel.eu/t/about-the-density-of-numbers/7964>\
**Category:** User discussions\
**Tags:** analysis-tools\
**Created:** [January 3, 2024, 11:15am UTC](https://gromacs.bioexcel.eu/t/about-the-density-of-numbers/7964 "2024-01-03T11:15:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ok1](https://avatars.discourse-cdn.com/v4/letter/o/9d8465/32.png) [@ok1](https://gromacs.bioexcel.eu/u/ok1)\
**Post date:** [January 3, 2024, 11:15am UTC](https://gromacs.bioexcel.eu/t/about-the-density-of-numbers/7964/1 "2024-01-03T11:15:37Z")

</div>

Hello, I have 190 ozone molecules and 1,000 water molecules in my system, but using the GMX density command (shown here) , adding up the numbers on the y-axis gives me more than 700, if you multiply that by the volume of the box, it’s much bigger than my molecule. What’s going on, please?

 ![e849e23f3bfbcfedd528f1e4c69ab92b](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/0/02bb36fd671b2aa9e1688f713285e8e3c3097f47.png)

---

<div class="post-metadata">

**Author:** ![milosz.wieczor](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@milosz.wieczor](https://gromacs.bioexcel.eu/u/milosz.wieczor)\
**Post date:** [January 3, 2024, 3:23pm UTC](https://gromacs.bioexcel.eu/t/about-the-density-of-numbers/7964/3 "2024-01-03T15:23:03Z")

</div>

You shouldn’t add up the numbers but take the average, which would give you the mean number density of ozone in your box. Check if that yields the correct number of molecules (or perhaps atoms? not sure about `gmx density`) when multiplied by the volume of your box.

---

<div class="post-metadata">

**Author:** ![ok1](https://avatars.discourse-cdn.com/v4/letter/o/9d8465/32.png) [@ok1](https://gromacs.bioexcel.eu/u/ok1)\
**Post date:** [January 15, 2024, 3:56am UTC](https://gromacs.bioexcel.eu/t/about-the-density-of-numbers/7964/4 "2024-01-15T03:56:21Z")

</div>

I see. Thank you very, very much!

But I still have questions,

1. Why did I use the gmx density -dt option and end up with only one density per layer instead of the density over time?

2. Does gmx density calculate the average density over time?

Best wishes to you~

---

<div class="post-metadata">

**Author:** ![milosz.wieczor](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@milosz.wieczor](https://gromacs.bioexcel.eu/u/milosz.wieczor)\
**Post date:** [January 15, 2024, 11:38am UTC](https://gromacs.bioexcel.eu/t/about-the-density-of-numbers/7964/5 "2024-01-15T11:38:01Z")

</div>

You’re welcome!

From the description, `gmx density` computes densities from weighted histograms of particle positions, which by default will be an average over time (a histogram from one frame might be very coarse). The option `-dt` only skips frames that do not fulfill the condition from the analysis.

If you instead wish to have block-averaged densities for different time intervals, the easiest way is to use the `-b X` and `-e Y` options to run `gmx density` multiple times from time `X` to time `Y`, changing `X` and `Y` in a loop.
