# Coordination analysis¶

This modifier performs two computations:

Coordination number

It counts the number of neighbors of each particle that are within a given cutoff distance around its current position. This neighbor count, the so-called coordination number of the particle, will be stored in the Coordination output property by the modifier. This output property is available to subsequent modifiers in the OVITO data pipeline. For example, you could select all particles having a certain minimum number of neighbors using the Expression selection modifier or visualize the computed coordination numbers using the Color coding modifier.

The modifier also computes the radial pair distribution function (radial PDF, or simply RDF) for the particle system. The radial pair distribution function $$g(r)$$ measures the probability of finding a particle at distance $$r$$ given that there is a particle at position $$r=0$$; it is essentially a histogram of pair-wise particle distances. The pair distribution function is normalized by the average number density of particles (i.e. the total number of particles in the simulation cell divided by its volume). See the Wikipedia article for more information on this distribution function.

## Element-wise RDFs¶

The option Compute partial RDFs lets the modifier compute separate radial distribution functions for all pair-wise combinations of particle types or chemical elements. The computed partial RDFs will be normalized such that the summation of the partial RDFs, weighted by the product of the two corresponding elemental concentrations, yields the total RDF. For example, for a binary system with two particle species $$\alpha$$ and $$\beta$$, the modifier computes a set of three partials functions $$g_{\alpha \alpha}$$, $$g_{\alpha \beta}$$ and $$g_{\beta \beta}$$, which add up to the total distribution as follows:

$$g(r) = c_{\alpha}^2 g_{\alpha \alpha}(r) + 2 c_{\alpha} c_{\beta} g_{\alpha \beta}(r) + c_{\beta}^2 g_{\beta \beta}(r)$$

Here, $$c_{\alpha}$$ and $$c_{\beta}$$ denote the concentrations of the two species in the system and the factor 2 in the mixed term appears due to $$g_{\alpha \beta}(r)$$ and $$g_{\beta \alpha}(r)$$ being identical.

## Time-averaged RDF¶

Note that the modifier calculates the instantaneous RDF for the current simulation frame only and outputs it as a data table that varies with simulation time. Subsequently, you can use the Time averaging modifier of OVITO to reduce all per-frame RDFs to one mean RDF, averaging over all frames of the loaded trajectory.

## Bond length distribution¶

Furthermore, OVITO provides another analysis tool for computing the bond length distribution specifically for bonded pairs of particles: the Bond analysis modifier. This modifier can additionally compute the distribution of bond angles formed by triplets of particles.