Split up analysis chapter in reference manual
[alexxy/gromacs.git] / docs / reference-manual / radial-distribution-function.rst
1 Radial distribution functions
2 -----------------------------
3
4 | :ref:`gmx rdf <gmx rdf>`
5 | The *radial distribution function* (RDF) or pair correlation function
6   :math:`g_{AB}(r)` between particles of type :math:`A` and :math:`B` is
7   defined in the following way:
8
9 .. math::
10
11    \begin{array}{rcl}
12    g_{AB}(r)&=&    {\displaystyle \frac{\langle \rho_B(r) \rangle}{\langle\rho_B\rangle_{local}}}         \\
13             &=&    {\displaystyle \frac{1}{\langle\rho_B\rangle_{local}}}{\displaystyle \frac{1}{N_A}}
14                    \sum_{i \in A}^{N_A} \sum_{j \in B}^{N_B} 
15                    {\displaystyle \frac{\delta( r_{ij} - r )}{4 \pi r^2}}         \\
16    \end{array}
17
18 with :math:`\langle\rho_B(r)\rangle` the particle density of type
19 :math:`B` at a distance :math:`r` around particles :math:`A`, and
20 :math:`\langle\rho_B\rangle_{local}` the particle density of type
21 :math:`B` averaged over all spheres around particles :math:`A` with
22 radius :math:`r_{max}` (see :numref:`Fig. %s <fig-rdfex>` C).
23
24 .. _fig-rdfex:
25
26 .. figure:: plots/rdf.*
27     :width: 7.00000cm
28
29     Definition of slices in :ref:`gmx rdf <gmx rdf>`: A. :math:`g_{AB}(r)`.
30     B. :math:`g_{AB}(r,\theta)`. The slices are colored gray. C.
31     Normalization :math:`\langle\rho_B\rangle_{local}`. D. Normalization
32     :math:`\langle\rho_B\rangle_{local,\:\theta }`. Normalization volumes
33     are colored gray.
34
35 Usually the value of :math:`r_{max}` is half of the box length. The
36 averaging is also performed in time. In practice the analysis program
37 :ref:`gmx rdf <gmx rdf>` divides the system
38 into spherical slices (from :math:`r` to :math:`r+dr`, see
39 :numref:`Fig. %s <fig-rdfex>` A) and makes a histogram in stead of
40 the :math:`\delta`-function. An example of the RDF of oxygen-oxygen in
41 SPC water \ :ref::ref:`80 <refBerendsen81>` is given in :numref:`Fig. %s <fig-rdf>`
42
43 .. _fig-rdf:
44
45 .. figure:: plots/rdfO-O.*
46     :width: 8.00000cm
47
48     :math:`g_{OO}(r)` for Oxygen-Oxygen of SPC-water.
49
50 With :ref:`gmx rdf <gmx rdf>` it is also possible to calculate an angle
51 dependent rdf :math:`g_{AB}(r,\theta)`, where the angle :math:`\theta`
52 is defined with respect to a certain laboratory axis :math:`{\bf e}`,
53 see :numref:`Fig. %s <fig-rdfex>` B.
54
55 .. math::
56
57    \begin{aligned}
58    g_{AB}(r,\theta) &=& {1 \over \langle\rho_B\rangle_{local,\:\theta }} {1 \over N_A} \sum_{i \in A}^{N_A} \sum_{j \in B}^{N_B} {\delta( r_{ij} - r ) \delta(\theta_{ij} -\theta) \over 2 \pi r^2 sin(\theta)}\\
59    cos(\theta_{ij}) &=& {{\bf r}_{ij} \cdot {\bf e} \over \|r_{ij}\| \;\| e\| }\end{aligned}
60
61 This :math:`g_{AB}(r,\theta)` is useful for analyzing anisotropic
62 systems. **Note** that in this case the normalization
63 :math:`\langle\rho_B\rangle_{local,\:\theta}` is the average density in
64 all angle slices from :math:`\theta` to :math:`\theta + d\theta` up to
65 :math:`r_{max}`, so angle dependent, see :numref:`Fig. %s <fig-rdfex>` D.