Bernoulli bond percolation on a honeycomb lattice
Channel: Nils Berglund
Date: 04/08/2022

This video shows Bernoulli bond percolation on a hexagonal, or honeycomb lattice. The graph shows the proportion of flooded bonds (the number of flooded bonds, shown in yellow, divided by the open ones, shown in yellow or pink). 
Percolation models describe the ability of a liquid to flow through a porous medium, such as oil flowing through certain types of rock, or water flowing through a coffee machine. Each bond is open with probability p, and closed with probability 1-p. Closed bonds are shown in dark purple. Open bonds can be flooded (shown in yellow), or not (shown in pink). The flooded bonds are vertical ones in the leftmost column, and those that can be reached from the left column by moving only through open bonds.
The simulation has six parts, featuring lattices of increasing size. 
60x36 grid: 0:00
120x72 grid: 0:44
240x144 grid: 1:30
480x287 grid: 2:14
960x573 grid: 2:59
1920x1146 grid: 3:44
The grid sizes give the number of hexagons. The number of bonds is three times the number of hexagons in the lattice.
In each part, the probability p of sites being open increases smoothly from 0 to 1. The remarkable property of percolation models is that there is a rather sharp transition between cases where only very few sites are flooded, to cases where most of them are flooded. The transition becomes sharper as the size of the lattice increases. One can show that when the lattice size goes to infinity, the transition concentrates on a particular value pc of p, which depends on the type of lattice. For the hexagonal lattice shown here, the critical value of p is equal to 1 - 2*sin(Pi/18), or about 0.652703645, see https://en.wikipedia.org/wiki/Percolation_threshold . One can guess from this expression that there is some clever mathematics involved in computing pc!
To make transitions more visible, in each part the increase of p is slowed down around this critical value. Of particular interest is the shape of the cluster of flooded cells when p is equal to pc, which has fractal properties. 
In each part of this simulation, all sites are given random values between 0 and 1. These values are independent, and follow a uniform distribution. A site becomes open when its value is smaller than the increasing parameter p. Then a variant of depth-first search algorithm is used to find all flooded cells. 

Render time: 1 hour 36 minutes, 18 minutes for parts 1-5
Color scheme: Inferno by Nathaniel J. Smith and Stefan van der Walt
https://github.com/BIDS/colormap

Music: Intractable by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 licence. https://creativecommons.org/licenses/by/4.0/
Source: http://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100194
Artist: http://incompetech.com/

Current version of the C code used to make these animations: 
https://github.com/nilsberglund-orleans/YouTube-simulations

https://www.idpoisson.fr/berglund/software.html

Some outreach articles on mathematics:
https://images.math.cnrs.fr/_Berglund-Nils-1343_.html
(in French, some with a Spanish translation)