# Density profile along the interface normal

**URL:** <https://gromacs.bioexcel.eu/t/density-profile-along-the-interface-normal/4025>\
**Category:** User discussions\
**Created:** [April 15, 2022, 9:29am UTC](https://gromacs.bioexcel.eu/t/density-profile-along-the-interface-normal/4025 "2022-04-15T09:29:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shivangi](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@Shivangi](https://gromacs.bioexcel.eu/u/Shivangi)\
**Post date:** [April 15, 2022, 9:29am UTC](https://gromacs.bioexcel.eu/t/density-profile-along-the-interface-normal/4025/1 "2022-04-15T09:29:12Z")

</div>

Dear all,  
I’d like to observe how density varies within the box, therefore could someone please explain how to find density within each of the slices of a simulation box formed by slicing the simulation cell into 1 angstrom-partitions along the z axis?

---

<div class="post-metadata">

**Author:** ![Sasha](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@Sasha](https://gromacs.bioexcel.eu/u/Sasha)\
**Post date:** [April 15, 2022, 9:48am UTC](https://gromacs.bioexcel.eu/t/density-profile-along-the-interface-normal/4025/2 "2022-04-15T09:48:01Z")

</div>

gmx density: [gmx density — GROMACS 2022 documentation](https://manual.gromacs.org/documentation/current/onlinehelp/gmx-density.html#:~:text=gmx%20density%20computes%20partial%20densities,group%2C%20in%20absolute%20box%20coordinates).

---

<div class="post-metadata">

**Author:** ![Shivangi](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@Shivangi](https://gromacs.bioexcel.eu/u/Shivangi)\
**Post date:** [April 15, 2022, 9:52am UTC](https://gromacs.bioexcel.eu/t/density-profile-along-the-interface-normal/4025/3 "2022-04-15T09:52:27Z")

</div>

Dear Sasha,  
I tried but couldn’t figure out how to do the partition and determine density, so could you please explain in detail how I should proceed?

---

<div class="post-metadata">

**Author:** ![Minalde](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/minalde/32/1370_2.png) [@Minalde](https://gromacs.bioexcel.eu/u/Minalde)\
**Post date:** [April 16, 2022, 1:36pm UTC](https://gromacs.bioexcel.eu/t/density-profile-along-the-interface-normal/4025/4 "2022-04-16T13:36:28Z")

</div>

To set a specific number of slices use `-sl`. The default is 50 slices. To get slices of 1 A, use the length of your box in the Z direction in A as the number of slices. To get the density along the z-axis use ` -d Z`.

---

<div class="post-metadata">

**Author:** ![Shivangi](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@Shivangi](https://gromacs.bioexcel.eu/u/Shivangi)\
**Post date:** [April 17, 2022, 7:39am UTC](https://gromacs.bioexcel.eu/t/density-profile-along-the-interface-normal/4025/5 "2022-04-17T07:39:27Z")

</div>

Thank you Minalde
