How to calculate RDF (Radial Distribution Function)

In summary: OIn summary, the RDF plot is smooth but the Wiki figure is not. Purely statistics. Instead of a cube, take a sphere and use a higher number of particles. You should realize that 8 particles in a bin is ##\pm\sqrt8## ! If you want a noise band of 1%, make sure that even in the higher ##r## bins there are at least 10000 particles per bin !
  • #1
Auteng
20
1
Dear friends
How can i calculate RDF(radial distribution function)?
Thanks
 
Physics news on Phys.org
  • #2
What are you starting with?
 
  • Like
Likes Auteng
  • #3
I attache my RDF plot
is it true?
Why it is not smooth?
27 particles in 3.8nm*3.8nm*3.8nm
my formula:
g=(h(n)*l_x^3)/(n_p*4*pi*((n-0.5)*delta_r)^2*delta_r);
h(n):number of particles in bin
n_p:total number of particles
bY0MgDJ.png

But this RDF figure form Wikipedia is very smooth:
and my first peak is very more than this figure...
800px-Radial_Distribution_Function_of_Liquid_Argon.png
 
Last edited:
  • #4
What are the particle sizes in your simulation ? And in the Wiki figure ?
Auteng said:
Why it is not smooth
Purely statistics. Instead of a cube, take a sphere and use a higher number of particles. You should realize that 8 particles in a bin is ##\pm\sqrt8## ! If you want a noise band of 1%, make sure that even in the higher ##r## bins there are at least 10000 particles per bin !
 
  • Like
Likes Auteng
  • #5
Should i average RDF on all particles?

Or RDF is for one particle?
 
  • #6
The RDF is usually determined by calculating the distance between all particle pairs and binning them into a histogram. The histogram is then normalized with respect to an ideal gas, where particle histograms are completely uncorrelated. For three dimensions, this normalization is the number density of the system multiplied by the volume of the spherical shell, which mathematically can be expressed as ##{\displaystyle g(r)_{I}=4\pi r^{2}\rho dr}##, where ##{\displaystyle \rho }## is the number density.
From where you nicked the picture :rolleyes:.
In order not to bias the result: take a few of the particles near the center of your sphere (which should have a radius well exceeding your ##r/\sigma## scale)
 
  • Like
Likes Auteng
  • #7
I write the RDF formula:

$$g(r)=\frac{\frac{particle at each bin} {4 \pi r^2}} {\frac{total number of atoms} {V total}}$$

But i don't understand why the following link two times divided it by N. I think we should divide by N one time according to the formula that i have wrote...
http://www.physics.emory.edu/faculty/weeks//idl/gofr2.html
 
  • #8
What is the meaning of ##\delta (r-r_{ij})## in the following equation?

8iVzem8.png


Before all what is the meaning of ##\delta##?
 
  • #9
Kronecker delta: (integer argument) ##\delta_{ij} = 1## if ## i = j## and for all other values of the argument it is 0.
Not to be confused with the Dirac delta function, ...

But what you have here is the Dirac delta function (real number as argument) which -- for beginning physicists -- is a kind of limit of a 'spike at zero', such that the function is zero for all arguments ##\ne 0## but ##\displaystyle \int_{-\infty}^{+\infty} \delta(x) \, dx = 1 ## nevertheless.

You get away with it because in fact you don't plot/calculate ##g(r)## but ##\int g(r) \, dV## with ##dV = 4\pi r^2 dr ##, the bin width of your histogram.
 
  • Like
Likes Auteng
  • #11
Auteng said:
I write the RDF formula:

$$g(r)=\frac{\frac{particle at each bin} {4 \pi r^2}} {\frac{total number of atoms} {V total}}$$

But i don't understand why the following link two times divided it by N. I think we should divide by N one time according to the formula that i have wrote...
http://www.physics.emory.edu/faculty/weeks//idl/gofr2.html
Can't read it. What is the dimension of particleateachbin ? :smile:

the 2N occurs because you encounter each pair twice, e.g. 34 as 3,4 and as 4,3

[edit] no, that's corny. If you change particleateachbin to numberofparticlesineachbin I'd be happy.
 
  • Like
Likes Auteng
  • #12
particleateachbin=particle at each bin(particles between r , r+dr)
totalnumberofatoms=total number of atoms(N)
 
  • Like
Likes BvU
  • #13
Auteng said:
particleateachbin=particle at each bin(particles between r , r+dr)
totalnumberofatoms=total number of atoms(N)
And remember: that is ##g(r)dr##, not ##g(r)## -- check dimensions
 
  • Like
Likes Auteng
  • #14
Yes i forgot dr in denominator

But the formula that i write is not math with #8
My formula has one N but that formula have two N one in denominator and one in ##\rho_0=N/V##
 
  • #15
I think i should take average over all of particles...??!

What i write is for one particle...?!o_O

Is it true?
 
  • #16
I think for example if we have 3 particles:
first we look at bin 1 for all three particles:
bin 1 for particle 1: 1 atom
bin 1 for particle 2: 1 atom
bin 1 for particle 3: 0 atom

And so on...

we have ##\frac{2} {3} = 0.67## for bin 1 in histogram?
 
  • #17
Hmm, I think I'm making a mess of this. Misunderstood the two N for 2N.
For three dimensions, this normalization is the number density of the system multiplied by the volume of the spherical shell, which mathematically can be expressed as ##{\displaystyle g(r)_{I}=4\pi r^{2}\rho dr}##, where ##{\displaystyle \rho }## is the number density.
##g(r)## is dimensionless and should go to 1 for ##r>>\sigma## (because by then density shouldn't depend on ##r## any more).
So I think #8 (where did that come from?) is something else :smile: than #7. (or it has something to do with this dirac delta)

Your denominator in #7 is ##\rho##. Your numerator goes toward ##\rho## so I think you are OK: the number of particles between ##r## and ##r+dr## is ##g(r) \rho \, 4\pi r^2 \, dr ## so ##g(r)## gives the ratio between what you expect from ideal gas (see quote) and what you count.

Auteng said:
I think i should take average over all of particles...??!
(same as post #5). Do you expect a difference ?
What i write is for one particle...?!o_O
Is that a question ? After all, it's your calculation: you should know that better than anyone else :rolleyes:

Back to post #4: You haven't described what you actually do for your calculation, but one can imagine there is a simulation going on of a volume with particles that obey this potential function. So you have a bunch of positions.

If you take the particle closest to the center of your volume, you get some statistics that can be improved by taking some more particles near the center and repeat. But the further you get from the center, the more asymmetric and biased things become: for a particle at the boundary of your volume the average distance is considerably bigger that for the original particle at the center.

It's a tradeoff; I suppose you are reasonably OK as long as your total volume radius ##>>## the maximum ##r/\sigma## of your ##g(r)## plot and the radius of the sphere you use for counting is ##<## than that maximum. The translation from ## >> ## to a number is up to you (you simply look at the results).
 
  • Like
Likes Auteng

1. What is RDF?

RDF, or Radial Distribution Function, is a measure of the spatial distribution of particles in a system. It is commonly used in the field of molecular dynamics to analyze the structure of a system.

2. How do you calculate RDF?

RDF is calculated by dividing the number of particles within a certain distance from a reference particle by the expected number of particles in that distance interval. This calculation is repeated for various distance intervals to obtain a complete RDF curve.

3. What are the inputs required for calculating RDF?

The inputs required for calculating RDF include the coordinates of the particles in the system and the box dimensions. These can be obtained from a molecular dynamics simulation or experimental data.

4. What does the RDF curve represent?

The RDF curve represents the probability of finding a particle at a certain distance from a reference particle. It provides information on the structure and interactions within a system.

5. What are some limitations of RDF?

RDF is limited by the assumption of a homogeneous system and the need for a large number of particles to obtain accurate results. It also does not provide information on the dynamics of the system, only the spatial distribution.

Similar threads

  • Introductory Physics Homework Help
Replies
28
Views
2K
  • Atomic and Condensed Matter
Replies
1
Views
5K
  • Atomic and Condensed Matter
Replies
1
Views
1K
  • Atomic and Condensed Matter
Replies
1
Views
3K
  • General Discussion
Replies
2
Views
255
Replies
1
Views
1K
  • High Energy, Nuclear, Particle Physics
Replies
4
Views
343
  • Advanced Physics Homework Help
Replies
4
Views
233
  • Atomic and Condensed Matter
Replies
6
Views
2K
  • Introductory Physics Homework Help
Replies
14
Views
569
Back
Top