Firefly Synchrony

Simulated fireflies shift from flashing at random to flashing in unison.

  • Firefly between flashes
  • Flashing
  • Flashlight
100%

Every firefly blinks on its own clock, but each flash nudges its neighbors a little closer to flashing. Click to shine the flashlight, an event in time, or switch Click to to Add fireflies and drag to release more; Rerun releases them again at 0 s.

Setup
500
Click to

How is Firefly Synchrony working for you?

About Firefly Synchrony

Firefly Synchrony simulates fireflies that come to flash in unison. In a few places — Southeast Asian mangroves, and the Great Smoky Mountains in the United States — thousands of fireflies end up flashing in unison, as if a conductor were keeping time. No leader is needed: each firefly simply responds to the flashes it sees.

The simulation uses the pulse-coupled oscillator model of Renato Mirollo and Steven Strogatz (1990), inspired by Charles Peskin's model of heart pacemaker cells. Every firefly has an internal clock that charges up and makes it flash when full, then resets. Seeing a neighbor flash gives its own clock a small push forward. Because the charge curve is concave, fireflies that are almost ready get pulled into firing together, groups merge, and the whole swarm locks into one rhythm.

Tune how hard each flash nudges neighbors, how far the light carries, how much the fireflies' natural rhythms differ and how much they wander. The Synchrony chart tracks the Kuramoto order parameter, from near 0% for random twinkling to 100% for perfect unison. Click with the flashlight to jolt a patch out of step, press Scatter to reset all clocks, turn on the optional flash sound, and export a PNG, video or GIF.

How to use Firefly Synchrony

  1. Press Play. The fireflies start with random clocks, so the forest twinkles at random. Within a few dozen seconds clusters begin flashing together and spread.
  2. Watch the Synchrony chart. It shows how aligned the clocks are, from 0% (random) to 100% (all flashing together).
  3. Change the coupling. Nudge strength sets how much a flash advances neighbors' clocks; Range sets how far a flash is seen. A short range makes waves of light ripple across the forest; the maximum range couples the whole forest.
  4. Add variety. Rhythm spread gives each firefly a slightly different natural period. Too much variety and they can no longer lock together.
  5. Interact. Click with the Flashlight to fire a pulse that knocks nearby fireflies out of step, or switch to Add fireflies and drag to release more. Scatter resets every clock at random. Rerun starts the same forest again from t = 0 with the fireflies you added; Restart clears them and starts the forest again; Reset also returns every setting to its default.
  6. Listen and export. Turn on Flash sound for a soft chirp on each flash, then save a PNG or record a video or GIF. Record 30 s from the start runs the same setup again from the beginning and records its first 30 seconds, frame by frame.

Frequently asked questions

Do real fireflies really flash in sync?

Yes. Synchronous fireflies such as Pteroptyx species in Southeast Asian mangroves and Photinus carolinus in the Great Smoky Mountains flash together in large groups. Biologists such as John and Elisabeth Buck documented the behavior in the 20th century, and recent camera studies have tracked how synchrony spreads through a swarm.

How do they synchronize without a leader?

Each firefly adjusts its own timing in response to the flashes it sees. A small advance after each neighbor's flash, repeated across the whole group, is enough to pull everyone onto a common rhythm. Mirollo and Strogatz proved that for identical oscillators with a concave charge curve, synchrony is almost always reached.

What does the synchrony percentage measure?

It is the Kuramoto order parameter: imagine each firefly's clock as a point on a circle and average all the points. If the clocks are scattered the average sits near the center (0%); if they all agree it sits on the circle (100%).

Where else does this kind of synchronization happen?

Pacemaker cells in the heart, neurons in the brain, crickets chirping in chorus, audiences clapping in unison and even power-grid generators all show coupled-oscillator synchronization.

References

  1. Mirollo, R. E., & Strogatz, S. H. (1990). Synchronization of pulse-coupled biological oscillators. SIAM Journal on Applied Mathematics 50(6), 1645–1662.
  2. Buck, J. (1988). Synchronous rhythmic flashing of fireflies. II.. The Quarterly Review of Biology 63(3), 265–289.