Loading the engineShared by all simulations, so the next one opens instantly.
The physics

Two neutral atoms barely notice each other far apart, attract weakly at a few diameters, and repel violently when their electron clouds overlap. John Lennard-Jones wrote this down in 1924 as a simple formula with two numbers, a size and a binding energy, and it became the workhorse of molecular dynamics: the attractive r−6 tail is the van der Waals force between induced dipoles, and the steep r−12 wall stands in for the overlap repulsion. For noble gases such as argon it is quantitatively good.

What you see

Particles in an 800 by 800 pixel box with reflecting walls, colored by speed. Lines join neighbors closer than 1.55 σ, so bound clusters show as networks. The panel shows the temperature T∗=kBT/ε and the virial pressure P∗=Pσ2/ε, both in reduced units. Unlike the phase-transition simulation, nothing holds the temperature here: the total energy is conserved, unless cooling is on.

Every run starts with the particles on a loose square grid at random velocities.

Model

Each pair interacts through

V(r)=4ε[(σr)12−(σr)6],

which is zero at r=σ, has its minimum −ε at r=21/6σ≈1.12σ, and attracts beyond it. The motion is integrated with velocity Verlet at Δt=1/960 s, which keeps the total energy within 2% of the mean kinetic energy over a minute. Cooling adds a drag −γ𝐯 to every particle.

Presets

Gas: 80 particles of diameter 40 px with a shallow well (ε=20,000). The temperature stays near T∗=0.7, well above the binding energy: pairs meet, swing around each other and separate, and at any moment about a fifth of the particles have no neighbor within 1.5 σ.

Dense fluid: 100 particles of diameter 52 px. They start cold (T∗=0.2), but as they pull together the binding energy they release heats them, and within ten seconds the fluid sits near T∗=0.55, about the critical temperature of the 2D Lennard-Jones fluid. Clusters form, merge and tear apart; every particle has neighbors, but no lasting order.

Cooling into a crystal: 120 particles with a deeper well and cooling on at γ=0.3/s. The kinetic energy drains away, the particles settle into the minima of their neighbors’ wells, and within 30 seconds they freeze into a hexagonal crystal: two thirds of them have six neighbors, and the hexagonal order parameter |ψ6| reaches 1.

Parameters

Particles: 2 to 200, applies on Reset. Particles that do not fit on the start grid are left out.

Diameter σ (px): 20 to 100, and Well depth ε: 5,000 to 200,000 in units of ½mv² (px²/s²).

Cooling and Drag rate (1/s): switch the drag on and set γ, 0.05 to 5; velocities shrink by a factor e every 1/γ seconds.

Periodic boundaries: particles leaving one edge come back in at the opposite one, and pairs interact across the edges.

The force sliders add a uniform acceleration, like gravity, and the rotation slider a rotating frame. Everything except the particle count applies immediately.