Charged interacting pentagons
Channel: Nils Berglund
Date: 2024-04-04

The recent simulation https://youtu.be/OTw5y7waxFQ on this channel tried to have interacting particles with pentagonal symmetry build a quasicrystal. The simulation failed doing that, however, as the pentagons seemed to prefer arranging on a honeycomb lattice.
In this variant, three things have been changed, and the result, while being far from perfect, looks somewhat better:
- The first change is that pentagons are charged, and interact via a Coulomb instead of a Lennard-Jones potential (there is still a repulsive LJ interaction between particles of opposite charge to prevent particles from collapsing on one point). 
- The second change is that if particle A has attached to particle B, and particle B has attached to particle C, particle A and C are not allowed to attach. 
- The third change is that attached particles can rotate, and interact via a torque that tends to align the sides of the pentagons.  
As in the previous simulation, particles that come within a certain distance can "react", thereby becoming members of a same "molecule". These reactions are highlighted by a quickly fading white disc. 
The video has four parts, showing the same simulation with four different color schemes:
Charge: 0:00
Orientation: 1:10
Clusters: 2:20
Energy: 3:30
In the first part, the particles' color hue depends on their charge. In the second part, it depends on their orientation, modulo 72 degrees. In the third part, particles in the same cluster are given the same color, which is updated when several clusters merge. In the last part, the color hue depends on the particles' kinetic energy. 
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 temperature is controlled by a thermostat, implemented here with the "Nosé-Hoover-Langevin" algorithm introduced by Ben Leimkuhler,  Emad Noorizadeh and Florian Theil, see reference below. The idea of the algorithm is to couple the momenta of the system to a single random process, which fluctuates around a temperature-dependent mean value. Lower temperatures lead to lower mean values. 
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: Parts 1 and 2 - 9 minutes 39 seconds
Parts 3 and 4 - 9 minutes 52 seconds
Compression: crf 23
Color scheme: Part 1 - Twilight
Part 2 - HSL/Jet
Part 3 - Viridis by Nathaniel J. Smith, Stefan van der Walt and Eric Firing
Part 4 -  Inferno by Nathaniel J. Smith and Stefan van der Walt
https://github.com/BIDS/colormap

Music: Seven Lives to Live by Twin Musicom is licensed under a Creative Commons Attribution 4.0 licence. https://creativecommons.org/licenses/by/4.0/
Source: http://www.twinmusicom.org/song/270/seven-lives-to-live
Artist: http://www.twinmusicom.org

Reference: Leimkuhler, B., Noorizadeh, E. & Theil, F. A Gentle Stochastic Thermostat for Molecular Dynamics. J Stat Phys 135, 261–277 (2009). https://doi.org/10.1007/s10955-009-9734-0
http://www.maths.warwick.ac.uk/~theil/HL12-3-2009.pdf

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)

#molecular_dynamics #quasicrystal