Fireflies of some species (for example Pteroptyx in Southeast Asian mangroves, Photinus carolinus in the Great Smoky Mountains) end up flashing in unison. Each insect is a nonlinear oscillator with its own natural rhythm that is nudged by the flashes it sees.
Model (Kuramoto, 1975): dθi/dt = ωi + (K/ni) Σj visible sin(θj − θi). A flash is emitted when θ passes a multiple of 2π. The collective state is measured by r eiψ = (1/N) Σ eiθj: r = 0 incoherent, r = 1 perfect unison.
All-to-all, N → ∞, Lorentzian spread g(ω) = (γ/π)/(ω²+γ²): synchrony appears at Kc = 2/(π g(0)) = 2γ and then r = √(1 − Kc/K) (Strogatz 2000). This is the exact curve drawn in orange.
Limited sight: here each firefly averages over the neighbours within range R (3D distance), and the fireflies drift (Ornstein-Uhlenbeck random flight), so the neighbour graph keeps changing. No closed form exists, so only the simulation answers; the practical rule is that you need enough neighbours (roughly > 5-10) within R for global order.
Simplifications, stated honestly: (1) real fireflies are pulse-coupled (a flash resets or advances phase through a phase-response curve; Mirollo-Strogatz 1990, Buck 1988) rather than smoothly coupled; the sine coupling is the standard mathematical idealisation. (2) The natural-frequency distribution is a deterministic Lorentzian (quantiles, tails clipped at 10γ in the swarm). (3) No occlusion by leaves, no light-intensity falloff within R, no delay. (4) Typical flash frequency 1 Hz is a round illustrative value; species differ. (5) Fireflies are drawn about 8 times their real size and the glow is a sprite.
Finite-size effect: below Kc the measured r is not zero but about √(π/4N), shown as the noise floor.
Models and textures: Blender 5.2, procedurally baked with Cycles; rendering Three.js r160.