2D Lennard–Jones gas

Explore a periodic 2D Lennard–Jones system with reproducible starts, temperature, pressure and energy averages.

About this tool

Compare low and high number density in a two-dimensional periodic Lennard–Jones system. Run starts a reproducible state; Reset removes the result and keeps the inputs. Physics edits require a new run. Playback changes only the displayed pace; One step advances one Δt*.

All values use reduced units: σ = ε = m = kB = 1, τ = σ√(m/ε), T* = kBT/ε, ρ* = Nσ²/A and P* = Pσ²/ε. L* = √(N/ρ*) determines the actual box size. This is 2D pressure (energy per area), not a pressure in MPa. The presets describe starting densities, not guaranteed equilibrium phases.

The pair potential is U*(r*) = 4(r*⁻¹² − r*⁻⁶) − U*LJ(2.5) below r꜀* = 2.5, and zero beyond it. Its force is 24(2r*⁻¹³ − r*⁻⁷), with zero at r* = 2^(1/6). The potential shift preserves this force. No tail correction is applied. Velocity Verlet recomputes forces between its two half kicks; periodic minimum images are used. Overlaps below 0.6 σ stop the run instead of clipping the force.

Seed fixes the small position jitter and initial Gaussian velocities. Mean velocity is removed and initial temperature is normalized using 2N − 2 thermal degrees of freedom. With K measured relative to the centre of mass, T* = K*/(N − 1) and P* = (2K* + Σpairs r*F*)/(2L*²). For example, N = 144 and ρ* = 0.3 give L* ≈ 21.91; initial T* = 1 does not stay fixed in NVE.

NVE leaves the system isolated. Optional velocity rescaling forces the target T* after every step; it does not generate a canonical ensemble. Heat Q* records the resulting kinetic-energy change, positive into the system. The displayed energy balance is (E* − E*₀ − Q*)/N. Compare with half the time step to assess numerical error: a continuous shifted potential still has a force jump at the cutoff.

Means use equally spaced post-step samples after the chosen start time. Restart averages begins a fresh measurement at the current model time. Neither a fixed discard time nor a smooth mean proves equilibration; samples are correlated and no uncertainty estimate is supplied. The colour scale stays fixed from v* = 0 to 5; higher speeds saturate only the colour.

References: Lennard–Jones potential, temperature and degrees of freedom, pressure and virial, velocity Verlet.