Statistics for an (almost) finite horizon Sinai billiard on the torus
Channel: Nils Berglund
Date: 2021-10-17

This simulation is similar to the video https://youtu.be/4FH6MwcIT-U but with larger obstacles: the circles have radius 0.085 instead of 0.05 in the previous simulation. The distance between the centers of pegs is 0.2, while the columns of obstacles are at distance 0.2*sqrt(3)/2 = 0.1732. I did not check this when I chose the obstacle radius, which I believed by mistake to be large enough to make the horizon finite, meaning that the free path is limited by a value comparable to the distance between obstacles. I'm sure attentive observers will find the precise times in the video where this mistake shows. 
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 (in other words, the boundary conditions are periodic, or the system has the topology of a torus). The scale is such that the rectangle has width 2, and length 7.621. 
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 256 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.

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

Music: "Stellar Wind" by the Unicorn Heads@UnicornHeads

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)