Analyze local structure in liquids and soft matter. Turn binned neighbor counts into g(r) curves. Choose units, validate inputs, and export results easily today.
The radial distribution function g(r) compares the observed neighbor count in a spherical shell to the count expected for a uniform (ideal) distribution:
Here n(r) is the average number of neighbors per reference particle within the shell centered at r with thickness Δr.
Illustrative values for a nano-scale simulation box. Use “Load example” to autofill.
| N | V (m³) | Δr (nm) | r (nm) | n(r) | Expected | g(r) |
|---|---|---|---|---|---|---|
| 1000 | 1e-24 | 0.1 | 1.0 | 0.95 | ~1.2566 | ~0.7563 |
| 1000 | 1e-24 | 0.1 | 1.5 | 1.23 | ~2.8274 | ~0.4351 |
| 1000 | 1e-24 | 0.1 | 2.0 | 1.05 | ~5.0265 | ~0.2089 |
The radial distribution function, g(r), is a core descriptor of microscopic structure in gases, liquids, colloids, polymers, and soft solids. It measures how particle density varies with distance from a reference particle, relative to an ideal uniform system at the same number density. In experiments, g(r) is often inferred from scattering data, while in simulations it is computed directly by counting neighbors in spherical shells.
A value g(r)=1 indicates no spatial correlation at distance r. Values above 1 represent enhanced probability of finding a neighbor (local ordering), and values below 1 represent depletion. For many simple liquids, g(r) rises from near zero at small r (excluded volume), reaches a strong first peak, then decays toward 1 as r increases.
Peaks correspond to coordination shells. For a dense Lennard-Jones–like liquid, a first peak often appears near one particle diameter, while the second peak may sit around twice that distance. The spacing between peaks reflects short‑range packing, and peak heights increase as temperature decreases or density increases.
This calculator uses number density ρ = N/V to normalize raw neighbor counts. The expected count in a shell of thickness Δr at radius r is ρ·4πr²Δr. Dividing the observed average count n(r) by this expectation yields g(r), which is dimensionless and comparable across units once N and V are consistent.
Smaller Δr improves resolution of sharp peaks but increases noise because fewer pairs contribute per bin. Larger Δr smooths the curve and can hide fine structure. A practical strategy is to start with Δr ≈ 1–5% of the dominant structural length scale (for example, particle diameter), then refine based on statistical stability.
In periodic simulations, meaningful r values typically stay below half the smallest box length to reduce artifacts. At large r, limited sampling and boundary effects can cause drift from g(r)→1. Increasing system size, averaging over more frames, and verifying convergence helps produce reliable long‑range behavior.
A common derived metric is the coordination number up to a cutoff rc, computed as 4πρ∫0rc g(r) r² dr. Selecting rc at the first minimum after the initial peak estimates the average number of nearest neighbors. Use the multi‑bin output as a starting point for numerical integration in analysis tools.
Compare curves across conditions: higher density often shifts peaks inward and raises their heights, while higher temperature broadens peaks and reduces ordering. If your curve never approaches 1, revisit density, units, and how n(r) was averaged. Consistent units, sufficient sampling, and a sensible Δr are the main levers for trustworthy g(r) estimates.
You need particle count N, system volume V, a radius r, a bin width Δr, and the measured average neighbor count n(r). The calculator converts units and returns g(r) plus intermediate values.
Most particles cannot overlap, so the probability of finding another particle very close to a reference one is low. This excluded‑volume effect drives g(r) toward zero at sufficiently small distances.
It can indicate finite-size artifacts, insufficient averaging, or an incorrect density normalization. Increase sampling, verify V and units, and keep r below half the smallest box length for periodic systems.
Use single-bin mode to sanity-check one shell quickly. Use multi-bin mode to compute a table across many radii for plotting a full g(r) curve and for downstream analysis like coordination numbers.
Choose Δr small enough to resolve peaks but large enough to reduce noise. A common starting point is 1–5% of the characteristic particle spacing or diameter, then adjust based on smoothness and stability.
Yes. g(r) is dimensionless. As long as N, V, r, and Δr are internally consistent, converting units will not change g(r). Differences usually come from inconsistent inputs, not unit selection.
No. It converts binned neighbor counts into normalized g(r). Compute n(r) from coordinates using your simulation or analysis tool, then paste the bins here to normalize, export, and report results.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.