# How do I define the density of system?

Lets' say I have a solid system made with N atoms in a box with a volume of V as shown below. In this case, the number density of my system is simply $$\frac{N}{Volume\; of \; occupied\;3D\; space}$$.

but what if I have a system with $$N$$ atoms in the same box, but $$N_{1}$$ atoms are in the solid phase and $$N_{2}$$ atoms are in the gas phase $$\left( N_{1} + N_{2} = N \right)$$.

How should I calculate the number density in this case? Do I consider the whole box volume $$V$$?

• This seems to be a question of what definition you choose for number density. Commented Oct 10, 2022 at 14:29
• You come up with a criteria to distinguish solid from vapor, which is a pretty standard thing in MD. Matter Modeling SE might be a better place to ask since they have experience over there. Commented Oct 10, 2022 at 15:08

Yes, you take the whole volume. That is the definition of density $$\rho = N/V$$. I guess what you are thinking of is in fact local density $$\rho(r) = \delta N(r) / \delta V$$ where $$\delta N(r)$$ is the number of particles in the immediate vicinity $$(x\pm 0.5dx, y\pm 0.5dy, z\pm 0.5dz)$$ of the point $$\vec{r} = (x,y,z)$$, $$\delta V = dx\, dy\, dz$$.