What are Swarmalators? Swarmalators are minimal agents that both swarm in space and oscillate in phase. Their spatial attraction/repulsion depends on phase difference while their phase dynamics depends on distance — a two-way coupling that leads to striking self-organized patterns.
The canonical model by O’Keeffe, Hong & Strogatz (2017) couples position ri and phase θi of each of the N agents:
dr_i/dt = (1/N) Σ_{j ≠ i} (r_j − r_i)/|r_j − r_i| · [1 + J·cos(θ_j − θ_i)] − (r_j − r_i)/|r_j − r_i|²
dθ_i/dt = ω_i + (K/N) Σ_{j ≠ i} sin(θ_j − θ_i) / |r_j − r_i|
Our version leverages Three.js along with its TSL (Three Shader Language) compute shaders so that every one of the O(N²) pairwise forces is evaluated in parallel on the GPU. This enables real-time exploration with >10 k particles on commodity graphics cards. We also generalize the original single-species model to up to five species: the spatial (J) and phase (K) couplings are stored in editable matrices Jαβ, Kαβ that let you tailor how species α interacts with species β.
By tuning these matrices—as well as the global offsets— the system exhibits rings, rotating clusters, convection-like flows and many other rich spatio-temporal states.
References
📁 Drop PNG file here or click to load saved configuration
Drag and drop a PNG file containing simulation parameters