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