Skip to main content

Phase Locking

Module 2: Synchronization and Collective Behaviour

A single firefly can lock its flashing to a periodic light. The model below, from Strogatz (2024, sec. 4.5), is based on Ermentrout and Rinzel (1984). It is the smallest model of synchronization: one oscillator driven by one rhythm.

The model

Let \(\Theta(t)\) be the phase of the stimulus and \(\theta(t)\) the phase of the firefly. A flash happens when a phase passes through \(0\). The stimulus runs at constant frequency \(\Omega\). The firefly has natural frequency \(\omega\) and is pulled toward the stimulus with strength \(A > 0\):

\[ \dot\Theta = \Omega, \qquad \dot\theta = \omega + A\sin(\Theta - \theta). \tag{1}\]

If the stimulus is ahead (\(0 < \Theta - \theta < \pi\)), the firefly speeds up. If it is behind, the firefly slows down.

Phase difference

The quantity you care about is the phase difference \(\phi = \Theta - \theta\). It obeys

\[ \dot\phi = \Omega - \omega - A\sin\phi. \tag{2}\]

With the dimensionless time \(\tau = At\) and detuning \(\mu = (\Omega - \omega)/A\), this becomes

\[ \phi' = \mu - \sin\phi, \tag{3}\]

which is the nonuniform oscillator from Flows on the Circle.

Locking range

  • If \(|\mu| \le 1\), Equation 3 has a stable fixed point \(\phi^* = \arcsin\mu\). The firefly runs at the stimulus frequency \(\Omega\) with a constant phase lag. This is phase locking, or entrainment.
  • If \(|\mu| > 1\), there are no fixed points and \(\phi\) keeps increasing. The firefly drifts relative to the stimulus. This is phase drift.

In the original variables the firefly entrains when

\[ \omega - A \le \Omega \le \omega + A. \tag{4}\]

Outside this range, the time for \(\phi\) to grow by \(2\pi\) is

\[ T_{\text{drift}} = \frac{2\pi}{\sqrt{(\omega - \Omega)^2 - A^2}}. \tag{5}\]

Both predictions can be tested with a flashing light, because \(\omega\) and the width of the locking range are measurable (Strogatz 2024, sec. 4.5). Real fireflies differ between species. Some can even shift their own natural frequency, which needs an extra adaptation variable (Ermentrout 1991).

Figure 1: Phase difference \(\phi = \Theta - \theta\) for a firefly with \(\omega = 1\) and \(A = 0.2\). Inside the locking range (\(\Omega = 1.15\)) the difference settles to \(\arcsin\mu\). Outside it (\(\Omega = 1.3\)) the difference keeps growing, one turn every \(T_{\text{drift}}\).
Predicted drift period for Omega = 1.3: 28.10
NoteExercise

Use Figure 1 and the printed value. Measure the drift period in the plot for \(\Omega = 1.3\) and compare it with Equation 5.

With \(\omega = 1\), \(\Omega = 1.3\) and \(A = 0.2\), Equation 5 gives \(T_{\text{drift}} = 2\pi/\sqrt{0.09 - 0.04} = 2\pi/\sqrt{0.05} \approx 28.1\). In the plot \(\phi\) climbs by about \(2\pi \approx 6.28\) every 28 time units, with slow stretches where \(\phi\) is near \(\pi/2\), the bottleneck.

NoteExercise

A firefly has a natural period of \(0.9\) s and entrains to stimulus periods between \(0.78\) s and \(1.06\) s. Estimate \(A\).

Convert periods to angular frequencies with \(\Omega = 2\pi/T\). The extremes of the locking range are \(\Omega_{\max} = 2\pi/0.78 \approx 8.06\) and \(\Omega_{\min} = 2\pi/1.06 \approx 5.93\) rad/s. By Equation 4, \(\Omega_{\max} - \Omega_{\min} = 2A\), so \(A \approx 1.06\) rad/s. The midpoint, \(6.99\) rad/s, is close to \(\omega = 2\pi/0.9 \approx 6.98\) rad/s, which is a consistency check. (These numbers are illustrative, chosen for the exercise.)

Explore locking and drift

The figure integrates Equation 1 with \(\omega = 1\), starting from \(\phi(0) = 0\), with the same Runge-Kutta scheme as Figure 1. The left panel shows both phases on the circle; each flashes as it passes the top. The middle panel is the flow Equation 2 on the circle, with its fixed points (filled: stable, hollow: unstable).

  1. With \(\Omega = 1.15\) and \(A = 0.2\), where does \(\phi\) settle? Compare it with \(\arcsin\mu\) for \(\mu = 0.75\). Who flashes first, the light or the firefly?
  2. Raise \(\Omega\) slowly. At which value does locking break? Watch the two fixed points in the flow panel just before it happens, and compare with Equation 4.
  3. Set \(\Omega = 1.3\). Check the measured drift period against Equation 5. Where on the circle does \(\phi\) move slowly, and why?
  4. Keep \(\Omega = 1.3\) and increase the coupling \(A\). What is the smallest \(A\) that entrains the firefly?
  5. Now set \(\Omega = 0.85\), below \(\omega\). The firefly still locks. What is the sign of the phase lag, and what does it mean for the order of the flashes?

Build this in Python. In the lab you write the code behind this figure: Kuramoto Lab: Pairwise vs Mean Field. With \(N = 2\) oscillators, your pairwise right-hand side reduces to \(\phi' = \Delta\omega - K\sin\phi\) for \(\phi = \theta_2 - \theta_1\), the same equation as here with \(A = K\).

From one oscillator to many

Here the stimulus is fixed and does not respond to the firefly. In a swarm every firefly is both a stimulus and a responder. The Kuramoto model treats that case.

References

Ermentrout, Bard. 1991. “An Adaptive Model for Synchrony in the Firefly Pteroptyx Malaccae.” Journal of Mathematical Biology 29 (6): 571–85. https://doi.org/10.1007/BF00164052.
Ermentrout, G. Bard, and John Rinzel. 1984. “Beyond a Pacemaker’s Entrainment Limit: Phase Walk-Through.” American Journal of Physiology: Regulatory, Integrative and Comparative Physiology 246 (1): R102–6. https://doi.org/10.1152/ajpregu.1984.246.1.R102.
Strogatz, Steven H. 2024. Nonlinear Dynamics and Chaos: With Applications to Physics, Biology, Chemistry, and Engineering. Chapman; Hall/CRC.