Swarmalator
The Swarmalator visualizes the collective dynamics of particles whose pairwise interactions depend on both spatial distance and phase difference, reproducing the mathematical model from a *Nature Communications* paper. Particles are added or removed up to a user-set count, while phase drives each dot’s color via a circular HSL scale. The simulation uses d3.forceSimulation with a custom force that updates velocity and phase according to the swarmalator equations, then redraws circles on a Canvas. Interactive controls via dat.GUI adjust particle count, coupling strengths, and a temperature mode that recolors particles based on their kinetic energy.
AI-generated descriptiond3.forceSimulation for https://www.nature.com/articles/s41467-017-01190-3
Observable version: https://beta.observablehq.com/@fil/swarmalator
(See also http://usediscretion.blogspot.fi/2017/01/the-swarmalator.html )
Built with blockbuilder.org