1. Particle arrangement
Click a particle to choose the reference (black). Orange particles lie in the shaded distance bin. Arrow keys cycle through reference particles.
2. Pair distribution, g(r)
Click the graph to select a bin. The dashed line is g(r) = 1, the ideal-gas expectation. The graph averages over every reference particle.
Read the structure
- Predict: where should the first peak appear for a square crystal? Set disorder to zero and check.
- Compare: switch to the ideal gas at the same particle count. Why does g(r) fluctuate around 1?
- Explore: increase crystal disorder. How do the peaks change?
- Investigate: change the bin width. Which features persist, and which are sampling noise?
How the calculation works
For each unordered pair, measure the shortest distance across the periodic box and increment its distance bin once. In two dimensions, normalize by the area of an annulus:
gₖ = 2 Cₖ A / [N(N − 1) π(rₖ₊₁² − rₖ²)]
Cₖ is the number of unordered pairs in bin k; A is the box area (1600 diameter²); N is the actual particle count. The N − 1 correction gives an expected g(r) of 1 for independent random points at finite N. The plotted range ends at 10 diameters, below half the shortest box side. The highlighted ring shows one reference particle; its count need not equal the average over all particles.
These are illustrative arrangements, not equilibrium molecular dynamics. Liquid-like points use random sequential placement with a minimum separation of 1; high requested counts may not fit within the attempt limit. Disorder moves preserve excluded volume and retain particles when a trial move is rejected. Crystals may contain vacancies if the requested count does not fill the periodic lattice. The triangular lattice uses a rectangular box to preserve periodicity and the same area. Gas circles are markers and may overlap. Radial averaging loses directional information, particularly in layered structures.
Further reading: LAMMPS radial distribution documentation.