HomePhysics & MechanicsGrand Canonical Ensemble 2D: Lattice-Gas Fluctuations

Grand Canonical Ensemble 2D: Lattice-Gas Fluctuations

Interactive grand canonical Monte Carlo simulator on a 2D square lattice gas: sites exchange both energy and particles with a reservoir at fixed temperature and chemical potential, showing the occupation grid live alongside particle-number fluctuations and the fluctuation-compressibility relation.

Physics & Mechanics2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-statistical-mechanics-physics ↗ Open standalone

Most introductions to statistical mechanics stop at the canonical ensemble, where particle number N is fixed and only energy is exchanged with a heat bath. This simulator instead builds the grand canonical (μVT) ensemble directly on a 2D square lattice gas: sites exchange both energy and particles with an implicit reservoir held at fixed temperature and chemical potential, using a real Metropolis grand-canonical Monte Carlo move (ΔΩ = ΔE − μΔN) on every proposed insertion or removal. Watch the equilibrium density respond live as you sweep the chemical potential, see attractive interactions drive clustering into amber domains as temperature drops, and read off the particle-number variance ⟨(ΔN)²⟩ that — via the fluctuation-compressibility relation — directly measures how compressible the simulated system is.

⚙ Under the hood

A 2D lattice-gas Monte Carlo simulator of the grand canonical (μVT) ensemble, rendered as a live occupation grid: particles are exchanged with an implicit reservoir at fixed temperature and chemical potential on a 4-neighbour square lattice, with live particle-number fluctuations and compressibility readouts.

statistical mechanicsmonte carlogrand canonical ensemblelattice gas2D latticethermodynamicsphase transition

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)