The science — the physics behind the canvas, model by model
The science
Every model in Stochasm is a piece of statistical mechanics. What unifies them is the way randomness is weighted by energy: proposed changes are accepted or rejected by the Metropolis criterion, which passes energy-lowering moves outright and energy-raising ones with Boltzmann-suppressed probability — more readily the hotter the system. Run one copy and you watch a trajectory; run an ensemble of thousands and each is an independent sample of the same statistical distribution, so the phase-space cloud is that distribution, complete with theoretical bounds drawn where they're provable. The per-model physics below all sit on that shared foundation.

Multi-Component Lattice
The lattice model runs kinetic Monte Carlo. Each step selects a random site and attempts a random eligible move (a flip or a swap), accepted with probability
P(success) = k · min(1, e−(Ef − Ei)/T)
where k is the rule's parameter and Ei, Ef are the total energies of the affected sites before and after the move. Each site's energy has two parts: its type's field, plus the sum of pairwise interaction energies with its neighbours (the 4 or 8 sites of the chosen coordination shell). A rule's facilitation condition is checked first: without the required neighbours, the move simply cannot occur — a kinetic constraint that changes pathways without changing the equilibrium. This combination — thermodynamics from fields and interactions, kinetics from rates and constraints — is why simple palettes produce phase separation, coarsening, glassy arrest, and percolation.
2D Ising
The canonical spin-½ ferromagnet: two states per site, evolving by single-spin Metropolis flips. The energy is the coupling J between neighbouring spins plus a uniform field H. Below the critical temperature like spins align into growing domains; above it, thermal noise wins. In the ensemble the magnetisation–energy cloud traces the phase diagram, bounded by the exact phase-separated and Néel envelopes (the figure above).
Single Particle
One particle in a one-dimensional potential, integrated with Langevin dynamics — deterministic forces plus friction and thermal noise at temperature T. Left to run, an ensemble of walkers relaxes into the Boltzmann distribution of the chosen potential: a Gaussian in a harmonic trap, a two-lobed cloud in a double well. It's the cleanest illustration in the app of an ensemble becoming a distribution.
Patchy Discs
Off-lattice, and a hybrid of two dynamics. Discs move under Langevin dynamics — inertia, friction, and thermal noise — and repel through soft cores, so packing responds to temperature. Bonding is a Monte-Carlo layer on top: at the rule's attempt rate a patch proposes to bind an eligible partner (in range, cones facing) or to release its current one, accepted by the same Metropolis criterion with a candidate-counting factor that keeps detailed balance exact. A formed bond is a short harmonic tether (U = ½k·d² − ε), so ε and T alone set how much bonding you get at equilibrium, while the attempt rate sets only how quickly you get there — equilibrium and kinetics, independently tunable.
By default the box is fixed (the NVT ensemble). Switch to NPT and an isothermal–isobaric Martyna–Tobias–Klein barostat couples the box size to an extra degree of freedom driven by the difference between the system’s internal pressure — kinetic energy plus the force virial — and your target pressure, damped by a Langevin piston. The box then breathes until, on average, the two pressures balance, so the discs find the density the pressure demands rather than one you fix by hand.
Every model's kernel is compiled from C to WebAssembly and runs locally in your browser; in ensemble mode the replicas are distributed across your CPU cores, so thousands of systems step in real time (hundreds of millions of updates per second). An automated fidelity suite verifies each kernel against its reference on every build — byte-identical for the lattice models, to machine precision for the continuous ones. If a configuration ever exceeds the compiled core's fixed capacities, a JavaScript engine takes over automatically.
