Video #700: A tribute to John Lennard-Jones
Channel: Nils Berglund
Date: 17/01/2023

This is the 700th video on this channel (the 701st counting one video I made two versions of). So thanks again to all for watching and providing many ideas for new videos!
I thought this would be a good opportunity for a little tribute to John Lennard-Jones. I made over 150 videos so far about particles interacting with the Lennard-Jones potential, but never mentioned the man behind it.  
Sir John Lennard-Jones (1894-1954) was a British mathematician, teaching theoretical physics first an the University of Bristol, and later at the University of Cambridge. He worked on theoretical and computational chemistry, and is probably best known for the potential bearing his name, which is a model for intermolecular forces. The picture used in this video is from the Wikipedia page https://en.wikipedia.org/wiki/John_Lennard-Jones (photograph by Computer Laboratory, University of Cambridge - http://www.cl.cam.ac.uk/Relics/archive_photos.html, CC BY 2.0, https://commons.wikimedia.org/w/index.php?curid=2424953 ).
This simulation is a variant of the breaking dam simulation https://youtu.be/2ciiOY0vV1A . It starts with 9176 particles, and the particle number is increased up to 13228. They are subject to gravity and viscous friction, and interacting via a Lennard-Jones potential. There are harmonic repulsive forces from the dam and from the rectangular boundaries. At a given time, the dam vanishes, causing the particles to spread over the available space. In some time interval after the dam break, I also added particles from the top, as if it were raining (this was to have enough particles at the end to form a large enough image).
The effect of the particles landing in just the right place to form a message is achieved by computing the whole evolution first, and then rendering the movie, with colors chosen in terms of the final position of the particles. I looked into different methods to import the picture into the program, and finally chose quite a simple one. The picture was imported into gimp, reduced in size, and exported in .ppm format, a variant of bitmap. One has the option of exporting it in ASCII format, and the resulting file, which consists simply of the picture dimensions and a list of RGB values, can easily be imported into C. 
The simulation has two parts, showing the same evolution with two different speeds:
Time lapse: 0:00
Slow motion: 0:54
In the first part, the speed has been increased by a factor 3.
To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle. 
The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see https://en.wikipedia.org/wiki/Lennard-Jones_potential

Render time: 1 hour 2 minutes (computation), 8 minutes 5 seconds (rendering)
Color scheme: Turbo, by Anton Mikhailov
https://gist.github.com/mikhailov-work/6a308c20e494d9e0ccc29036b28faa7a

Music: "Orange Sunset" by Quincas Moreira@QuincasMoreira

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)