For the radial distribution function

$$g(r)=\frac{N(r)}{4\pi r^{2}dr \rho}$$

how do you do the calculation of the volume of the spherical shell in the denominator, $4\pi r^{2} dr$, when the simulation is done on a lattice? Since only discrete values of $r$ are possible, I imagine the calculation might be subtle.

  • $\begingroup$ any value of r is possible, particles only appear at discrete values of r, but that is inconsequential. The volume does not depend on the particles locations, only on ... the volume $\endgroup$
    – B. Kelly
    Mar 10, 2022 at 15:22
  • $\begingroup$ I don't follow you: the spherical shell is not exactly spherical on a lattice because of the discretized nature of the lattice, so I would think that this needs to be accounted for. $\endgroup$
    – user2026
    Mar 10, 2022 at 17:21
  • 4
    $\begingroup$ The sphere is exactly spherical. A RDF measures from a given location, the probability of finding a particle of a certain type, a distance "r" from that central location. It doesn't matter if they are on a lattice or not. In the end you are just binning "dr"s and using particles x,y,z coordinates to calculate the "r" to figure out what bin to put them in, but you don't care if the particles are arranged on a lattice. $\endgroup$
    – B. Kelly
    Mar 10, 2022 at 18:15
  • $\begingroup$ I would recommend getting this book, amazon.com/Molecular-Theory-Solutions-Arieh-Ben-Naim-ebook/dp/…, and reading about the rdf. Ben-Naim does the best job of anyone I have run across on explaining, in at least two different ways, the RDF. $\endgroup$
    – B. Kelly
    Mar 10, 2022 at 18:20
  • $\begingroup$ @B.Kelly nice suggestion, any chapter or sections you recommend in particular? $\endgroup$ Mar 10, 2022 at 22:29

1 Answer 1


As others have commented, discretization does not matter.

Below you can see a picture that tries to explain this point. The $\mathrm{d}r$, or more correctly for the approximation we are making the $\Delta r$, is just the distance between the two circles.

When you are working on a grid, this simply amounts to counting the number of valid squares with their center in between the two circles.

enter image description here

Script used to generate the figure here.


You must log in to answer this question.