CHARMM Development Project
Posted By: jamesmao rdf using coor anal - 11/22/21 03:05 AM
I am trying to study rdf of my system. My script is something like this:

coor anal select type ION end -
xref @xsite yref @ysite zref @zsite -
firstu 51 nunit 1 begin ?start skip ?skip -
isdist 41 -
rsph 999.9 mgn 800 dr 0.2 -
dens 0.001

The trajectory file contains 500ns data. I also run the script for every 100ns data by assigning the "begin" and "stop" in the third line such as "firstu 51 nunit 1 begin 10000000 stop 20000000 skip ?skip -".
I thought the rdf using all 500ns should be the average of the five 100ns rdf. However, although the five 100ns rdf plots are similar, their average is very different from the 500ns one. I even see a peak not present in any of the 100ns plots appears in the 500ns plot (within r<1). I am quite confused. Can anyone give me some hint? isn't rdf the average of rdf from each frame?

thank you very much.
Posted By: lennart Re: rdf using coor anal - 11/22/21 05:13 PM
Strange, the partial rdfs should sum up to the overall, as you expect. One thing that could confuse the issue is periodic boundary conditions, in particular for something like ions that I assume are spread out all over you system. COOR ANAL can handle some basic PBCs, but your command does not request this.
Posted By: jamesmao Re: rdf using coor anal - 11/22/21 07:01 PM
thanks Lennart. Turns out I made a silly mistake: 100ns is 100000000 instead of 10000000!
Posted By: lennart Re: rdf using coor anal - 11/23/21 07:22 PM
Good! Honest mistake, rather. As long as you don't repeat it and expect a different outcome you're OK, loosely quoting A. Einstein (a physicist of some fame a hundred years ago).
Having written parts of the underlying code, and used it a lot, I would like to point out that coor anal is not quite as bad as it may sound.
Posted By: jamesmao Re: rdf using coor anal - 11/27/21 11:20 PM
Since I only need local rdf around a specific site, I did not try PBC. Will give it a try later. BTW, what are other options/modules for rdf analysis in charmm besides coor anal? thanks.
Posted By: rmv Re: rdf using coor anal - 11/28/21 09:30 PM
If the site can be near a unit cell boundary, then you should use PBC or else under-counting can occur.

The HIST feature of COOR DISTance can be used to compute g(r) in a loop over frames, but it is much less efficient than using COOR ANAL and not recommended for general use. The COOR DIST approach does offer greater flexibility, including the ability to process each frame before accumulating histogram data, but is more cumbersome to use and significantly slower.
Posted By: lennart Re: rdf using coor anal - 11/29/21 06:29 PM
COOR ANAL only supports very basic PBC. An alternative approach is to preprocess the trajectory and recenter each frame with the site of interest at the center. COOR MERGE RECENTER.
Posted By: jamesmao Re: rdf using coor anal - 12/07/21 03:22 PM
Hi Lennart, what do you mean "very basic PBC"? do you mean the geometry of the box? thanks.
© CHARMM forums