A simulation made using p5.js
to demonstrate Markov chain Monte Carlo methods, using the example of hard disks in a fixed space. This was the initial problem for which the Metropolis algorithm was developed: a variant on this algorithm is used in this simulation.
You can find the simulation here.