# Radial density

**URL:** <https://gromacs.bioexcel.eu/t/radial-density/1046>\
**Category:** User discussions\
**Created:** [November 4, 2020, 3:17pm UTC](https://gromacs.bioexcel.eu/t/radial-density/1046 "2020-11-04T15:17:10Z")\
**Posts on this page:** 4\
**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:** [November 4, 2020, 3:17pm UTC](https://gromacs.bioexcel.eu/t/radial-density/1046/1 "2020-11-04T15:17:10Z")

</div>

GROMACS version: 2020.1  
GROMACS modification: No  
Hi all,

I have a water system where the molecules are flat-bottom restrained to make a partition. Those whose oxygen atom is at r \< 1 nm from the system’s COM are restrained inside the sphere of that radius, and for those at r \> 1 nm the restraints are inverted so they do not mix with the firsts. The visualization of the trajectory shows that the restraints are effective and the waters do not mix. However, when I plot the radial density with `gmx density` (`gmx density -s system.tpr -f system.xtc -o density_mass.xvg -dens mass -ng 3 -n index.ndx -center -symm`, either mass or number), there are density values at r \< 1 (see attached graph, blue curve). I was expecting a gap at -1 \< r \< 1 nm. Is this an error/bug of the command?

 ![radial_density](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/1X/92677f15df543c322355274e2caefbe39d9ec8f3.jpeg)

Best.

---

<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:** [November 5, 2020, 9:30am UTC](https://gromacs.bioexcel.eu/t/radial-density/1046/2 "2020-11-05T09:30:09Z")

</div>

Hi,  
gmx density computes partial densities across the box (see [http://manual.gromacs.org/current/onlinehelp/gmx-density.html?highlight=gmx%20density](http://manual.gromacs.org/current/onlinehelp/gmx-density.html?highlight=gmx%20density)), not the radial density. Your graph looks fine to me.  
Best regards  
Alessandra

---

<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:** [November 5, 2020, 9:52am UTC](https://gromacs.bioexcel.eu/t/radial-density/1046/3 "2020-11-05T09:52:56Z")

</div>

Hi,  
Thank you for your reply.

In the command I used the `-center` and `-symm` options to analyze the density across the box but centered in the system’s COM (x = 0, that’s why I called radial). The red and blue curves belongs to different water groups. Those corresponding to the blue curve, never reach the region -1 \< r \< 1, so I don’t understand why I get values for the blue curve in that region.

Best regards

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [November 5, 2020, 2:21pm UTC](https://gromacs.bioexcel.eu/t/radial-density/1046/4 "2020-11-05T14:21:20Z")

</div>

The density you are seeing is from the region of water outside of the sphere but inside the box. The tool does not give you a radial density; it will just slice along the box in the specified dimension.
