N = 125 particles interact through the truncated Lennard-Jones potential in reduced (σ = ε = m = 1) units, integrated with velocity-Verlet under periodic boundary conditions (minimum-image convention) inside a cubic box of side L, where ρ* = N/L³:
U(r) = 4ε[(σ/r)^12 − (σ/r)^6], r < r_c = 2.5σ
F(r) = 24ε[2(σ/r)^12 − (σ/r)^6] / r (along r̂)
Velocity Verlet: v(t+dt/2)=v+½a·dt; x+=v·dt; recompute a; v+=½a·dt
A Berendsen thermostat gently rescales velocities toward the target T* each step (τ = 0.15) so the requested temperature is reached without a hard, unphysical reset. Instantaneous temperature and pressure come from the equipartition theorem and the virial equation:
T* = (2/3N) · Σ ½mv²
P* = ρT* + (1/3V) · Σ_(i<j) r_ij · F_ij
The radial distribution function g(r) is the ratio of the average local particle density at distance r from a typical particle to the density of an ideal (uncorrelated) gas at the same overall density:
g(r) = ⟨n(r → r+dr)⟩ / (4π r² dr · ρ)
It is built here as a running histogram of every pairwise separation (minimum image) across recent frames, normalized by the ideal-gas shell count. g(r) → 0 at short range (particles can't overlap), a first peak marks the nearest-neighbor shell, and g(r) → 1 at large r once correlations die out. A gas shows a single broad hump; a liquid shows several damped oscillations; a compressed solid shows sharp, persistent peaks from lattice order. The coordination number above integrates 4πr²ρg(r) out to the first minimum (~1.5σ) — the average number of nearest neighbors around any particle.
- T* slider — thermostat setpoint; higher T* melts structure toward a gas-like g(r).
- ρ* slider — rescales the box (and particle positions with it) to change packing density.
- Bond toggle — draws a line between any pair inside the first coordination shell.
- Presets — jump to representative gas / liquid / solid-like (T*, ρ*) states.