# Calculation of density?

**URL:** <https://gromacs.bioexcel.eu/t/calculation-of-density/1228>\
**Category:** User discussions\
**Created:** [December 8, 2020, 4:54pm UTC](https://gromacs.bioexcel.eu/t/calculation-of-density/1228 "2020-12-08T16:54:15Z")\
**Posts on this page:** 5\
**Page:** 1

<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:** [December 8, 2020, 4:54pm UTC](https://gromacs.bioexcel.eu/t/calculation-of-density/1228/1 "2020-12-08T16:54:15Z")

</div>

GROMACS version:  
GROMACS modification: Yes/No  
Here post your question Dear all,  
I have a simulation system with a polymer in a vacuum.

1. I wanted to calculate its identity. The term density in gmx energy refers to the density I am looking for?
2. I wanted to make a simulation box which is tightly packed the polymer, ie I do not want to add a gap between them, how to do that? (usual gmx editconf with -d option add extra space)

---

<div class="post-metadata">

**Author:** ![NimaSoltani](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@NimaSoltani](https://gromacs.bioexcel.eu/u/NimaSoltani)\
**Post date:** [December 8, 2020, 6:28pm UTC](https://gromacs.bioexcel.eu/t/calculation-of-density/1228/2 "2020-12-08T18:28:14Z")

</div>

Dear Scinikhil  
According to the manual, gmx energy gives you the total density of NPT simulations  
For extracting partial densities you can use gmx density:

> **[gmx density — GROMACS 2020.4 documentation](http://manual.gromacs.org/current/onlinehelp/gmx-density.html?highlight=gmx%20density)**

---

<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:** [December 8, 2020, 6:29pm UTC](https://gromacs.bioexcel.eu/t/calculation-of-density/1228/3 "2020-12-08T18:29:52Z")

</div>

My simulation system having only one type of molecule and I need to get its density. So do I need to do gmx density?

---

<div class="post-metadata">

**Author:** ![NimaSoltani](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@NimaSoltani](https://gromacs.bioexcel.eu/u/NimaSoltani)\
**Post date:** [December 8, 2020, 6:30pm UTC](https://gromacs.bioexcel.eu/t/calculation-of-density/1228/4 "2020-12-08T18:30:44Z")

</div>

I would assume both method give the same result

---

<div class="post-metadata">

**Author:** ![Dr\_DBW](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/dr_dbw/32/42_2.png) [@Dr\_DBW](https://gromacs.bioexcel.eu/u/Dr_DBW)\
**Post date:** [December 9, 2020, 10:46pm UTC](https://gromacs.bioexcel.eu/t/calculation-of-density/1228/5 "2020-12-09T22:46:08Z")

</div>

Only manner to get the polymer tightly packed is to start with an oversized box then run some sort simulations with NPT conditions, allowing the box to contract, molecules relax and flex around each other, and get the density up to the “correct” value.
