rdf normalization confusion

37 views
Skip to first unread message

aj...@nyu.edu

unread,
Nov 30, 2023, 5:36:51 PM11/30/23
to MDnalysis discussion
When calculating rdf based on this documentation: https://docs.mdanalysis.org/1.1.0/documentation_pages/analysis/rdf.html#module-MDAnalysis.analysis.rdf

I never get the rdf normalized to 1 at large distances. Also tried setting density=True/False, and that does not help. 

Also, rdf.count does not sum up to the number of pairs. 

I am unsure about what could be wrong here. 

It seems that if I do

density*4*np.pi*np.square(rdf.bins)*rdf.rdf*np.diff(rdf.edges)

I get roughly the correct count in each bin, but according to the documentation, it seems that I already should have a value like that in the rdf structure. 

Would be grateful for any advice. 
Thank you!

Oliver Beckstein

unread,
Nov 30, 2023, 6:38:42 PM11/30/23
to mdnalysis-discussion
Hello,

On Nov 30, 2023, at 15:36, aj...@nyu.edu <aj...@nyu.edu> wrote:



Which version of MDAnalysis are you using?

import MDAnalysis as mda
print(mda.__version__)


I never get the rdf normalized to 1 at large distances. Also tried setting density=True/False, and that does not help. 

What kind of system are you looking at?

Can you share your code and some actual results that show the problem?

Did you try the analysis on a system where you know the answer, e.g., a box of water?

Best,
Oliver


Also, rdf.count does not sum up to the number of pairs. 

I am unsure about what could be wrong here. 

It seems that if I do

density*4*np.pi*np.square(rdf.bins)*rdf.rdf*np.diff(rdf.edges)

I get roughly the correct count in each bin, but according to the documentation, it seems that I already should have a value like that in the rdf structure. 

Would be grateful for any advice. 
Thank you!


--
Oliver Beckstein (he/his/him)

email: orbe...@mdanalysis.org
twitter: @orbeckst
GitHub: @orbeckst

MDAnalysis – a NumFOCUS fiscally sponsored project



aj...@nyu.edu

unread,
Nov 30, 2023, 9:30:57 PM11/30/23
to MDnalysis discussion
Super, thank you. The problem was the old documentation. When I use norm='none', it seems I get the proper count in rdf.rdf.
Thank you very much!
Alexej 

Reply all
Reply to author
Forward
0 new messages