Sinai billiard on a torus with triangular lattice, collisions and free path statistics
Channel: Nils Berglund
Date: 14/10/2021

Like the video https://youtu.be/mLYes2W2U3Q, this seventh simulation with collision statistics in a Sinai billiard uses periodic boundary conditions (or wrap-around, or pacman-style boundaries), which gives "cleaner" collision and mean path distributions as for reflecting boundary conditions. 
The bottom half of the simulation shows a particle moving at constant speed, and bouncing off 440 circular pegs on a triangular grid. Whenever it leaves the rectangular box, it returns through the opposite side. The circles have radius 0.05, their centers are at distance 0.2, and the columns of obstacles are at distance 0.2*sqrt(3)/2 = 0.1732... The scale is such that the rectangle has width 2, and length 7.621 (chosen to fit an integer number of columns). 
To help tracking the motion of the particle, the pegs change color when they are hit: they become red when they are hit for the first time, and then their hue changes gradually, and becomes red again after 48 collisions. The numbers at the bottom show the total number of collisions (pegs and outer rectangle) and the number of pegs hit as least once.
The two histograms on top show two different statistics. The left one shows how many pegs have been hit once, twice, three times, and so on. The colors in the histogram correspond to the colors of the hit pegs. The right plot shows the distribution of distances traveled between collisions, also called free paths. The vertical scale changes in the course of time in such a way that the maximum of the histogram remains constant. 
For each of the statistics, the maximum value, mean value, and standard deviation (denoted stdv) are shown at the top right.
Similarly to the simulation https://youtu.be/UcrbCeTDEhU in a reflecting box, the free path distribution shows distinctive peaks, corresponding to the distance between nearest-neighbor obstacles, next-to-nearest neighbors, and so on. The peaks show however a sharper cut-off on the left, because the statistics is not perturbed by collisions with the outer rectangle. 

Render time: 9 minutes 20 seconds
Color scheme: HSLuv https://www.hsluv.org/

Music: "Mist" by Odonis Odonis@felte

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)