Sorry, I sent the mail accidentally half done before. The complete version: Dear all,
My own rdf calculations show different results from lammps. Here is a simple test case:
I have 4 atoms at positions x=[1,2,3,4] and y=0 z=0 for all.
box dimensions so that we have no pbc contribution:
-5 10 xlo xhi
-5 5 ylo yhi
-5 5 zlo zhi
we have vol=1500 and number density is: rho=4/1500
If rmax=1.5 and nbin=2 --> rbin=0.75.
The relative number density for each bin and each atom:
where the columns correspond to bins and rows to atoms. The mean for the second bin: 45.4728
compute 1 all rdf 2
fix 2 all ave/time 1 1 1 c_1[*] file tmp.rdf mode vector
# Time-averaged data for fix 2
# TimeStep Number-of-rows
# Row c_1 c_1 c_1
1 0.375 0 0
2 1.125 60.6305 1.5
(60.635=~45.4728) As you can see, it's as if lammps is not considering the first and last atoms and is computing the average for two atoms. The coordination number is correct however.
I'm attaching the runfile and data file that reproduce this. I'm using 11Aug2017 version of lammps.
Thank you and best regards,