Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

A How to calculate RDF (Radial Distribution Function)

  1. Mar 31, 2017 #1
    Dear friends
    How can i calculate RDF(radial distribution function)?
    Thanks
     
  2. jcsd
  3. Mar 31, 2017 #2

    mathman

    User Avatar
    Science Advisor
    Gold Member

    What are you starting with?
     
  4. Apr 1, 2017 #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: Apr 1, 2017
  5. Apr 1, 2017 #4

    BvU

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    What are the particle sizes in your simulation ? And in the Wiki figure ?
    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 !
     
  6. Apr 1, 2017 #5
    Should i average RDF on all particles?

    Or RDF is for one particle?
     
  7. Apr 1, 2017 #6

    BvU

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    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)
     
  8. Apr 2, 2017 #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
     
  9. Apr 3, 2017 #8
    What is the meaning of ##\delta (r-r_{ij})## in the following equation?

    8iVzem8.png

    Before all what is the meaning of ##\delta##?
     
  10. Apr 3, 2017 #9

    BvU

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Kronecker delta: (integer argument) ##\delta_{ij} = 1## if ## i = j## and for all other values of the argument it is 0.
    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.
     
  11. Apr 3, 2017 #10
  12. Apr 3, 2017 #11

    BvU

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    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.
     
  13. Apr 3, 2017 #12
    particleateachbin=particle at each bin(particles between r , r+dr)
    totalnumberofatoms=total number of atoms(N)
     
  14. Apr 3, 2017 #13

    BvU

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    And remember: that is ##g(r)dr##, not ##g(r)## -- check dimensions
     
  15. Apr 3, 2017 #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##
     
  16. Apr 3, 2017 #15
    I think i should take average over all of particles...??!!

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

    Is it true?
     
  17. Apr 3, 2017 #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?
     
  18. Apr 3, 2017 #17

    BvU

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Hmm, I think I'm making a mess of this. Misunderstood the two N for 2N.
    ##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.

    (same as post #5). Do you expect a difference ?
    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).
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: How to calculate RDF (Radial Distribution Function)
Loading...