gmx rdf [-f [<.xtc/.trr/...>]] [-s [<.tpr/.gro/...>]] [-n [<.ndx>]] [-o [<.xvg>]] [-cn [<.xvg>]] [-b <time>] [-e <time>] [-dt <time>] [-tu <enum>] [-xvg <enum>] [-[no]rmpbc] [-[no]pbc] [-sf <file>] [-selrpos <enum>] [-bin <real>] [-[no]norm] [-[no]xy] [-[no]excl] [-cut <real>] [-rmax <real>] [-surf <enum>] [-ref <selection>] [-sel <selection>]
gmx rdf calculates radial distribution functions from one refernce set of position (set with -ref) to one or more sets of positions (set with -sel). To compute the RDF with respect to the closest position in a set in -ref instead, use -surf: if set, then -ref is partitioned into sets based on the value of -surf, and the closest position in each set is used. To compute the RDF around axes parallel to the z-axis, i.e., only in the x-y plane, use -xy.
To set the bin width and maximum distance to use in the RDF, use -bin and -rmax, respectively. The latter can be used to limit the computational cost if the RDF is not of interest up to the default (half of the box size with PBC, three times the box size without PBC).
To use exclusions from the topology (-s), set -excl and ensure that both -ref and -sel only select atoms. A rougher alternative to exclude intra-molecular peaks is to set -cut to a non-zero value to clear the RDF at small distances.
The RDFs are normalized by 1) average number of positions in -ref (the number of groups with -surf), 2) volume of the bin, and 3) average particle density of -sel positions for that selection. To only use the first factor for normalization, set -nonorm. In this case, the RDF is only scaled with the bin width to make the integral of the curve represent the number of pairs within a range. Note that exclusions do not affect the normalization: even if -excl is set, or -ref and -sel contain the same selection, the normalization factor is still N*M, not N*(M-excluded).
For -surf, the selection provided to -ref must select atoms, i.e., centers of mass are not supported. Further, -nonorm is implied, as the bins have irregular shapes and the volume of a bin is not easily computable.
Option -cn produces the cumulative number RDF, i.e. the average number of particles within a distance r.
Options to specify input files:
Options to specify output files:
Other options: