Web Simulation 

 

 

 

 

Synchronization in Complex Systems: The Kuramoto Model

Theory

The Kuramoto model describes how a population of coupled oscillators with different natural frequencies can spontaneously synchronize. It captures a phase transition: below a critical coupling strength the system stays disordered; above it, coherence emerges and the oscillators lock to a common rhythm. This behavior appears in fireflies, heart cells, power grids, and neural networks.

What this simulation shows

Main canvas: Each dot is an oscillator. Its phase θ (angle) evolves in time; color maps phase to hue so that similar phases look similar. At low coupling the dots flicker randomly; as you increase Coupling strength K, they can suddenly lock into a shared rhythm.

Phase circle: The same oscillators plotted on a unit circle (angle = phase). Synchronization appears as dots clustering in one direction.

Order parameter R: The magnitude of the mean phase vector, from 0 (disordered) to 1 (fully synchronized). The sparkline shows R(t) in real time. The Phase transition curve is built by the "Run Auto-Sweep" experiment: it plots R vs K and reveals the critical coupling where order emerges.

Mathematical foundation

There are N oscillators. Each has a phase θi and a natural frequency ωi (drawn from a distribution, e.g. Gaussian). The dynamics are

i/dt = ωi + (K/N) Σj sin(θj − θi)

The sum is over all other oscillators (all-to-all coupling). The sine term pulls oscillator i toward the phases of the others; K sets the strength. Integration is done with a simple Euler step: θi(t+dt) = θi(t) + dt · dθi/dt.

Order parameter: The complex number re = (1/N) Σj ej. The magnitude R = |re| (0 ≤ R ≤ 1) measures global coherence: R ≈ 0 when phases are spread uniformly, R → 1 when they align.

Phase transition: For a unimodal frequency distribution there is a critical coupling Kc. For K < Kc, R stays near 0; for K > Kc, R grows. The "Run Auto-Sweep" experiment gradually increases K and records R, drawing the transition curve.

LIVE

Time vs phase for all individual

Real-time coherence R

0%

Phase transition curve

R vs K

2.0
1.5
2.0

Click a generator to overload it; watch stress spread. R < 0.8 = instability.
Double-click a node to cycle: normal → overloaded → blackout.

Links: Low stress Medium stress High stress Tripped
Nodes: Generator (0) Generator (π/4) Generator (π/2) Generator (3π/4) Generator (π) Generator (5π/4) Generator (3π/2) Generator (7π/4)
Overloaded Blackout
R: Blackout: 0 Tripped: 0

Usage (Theory tab)

  1. Play with coupling: Move the Coupling K slider. At low K the dots flicker independently; as K crosses a critical value the system can synchronize and the sparkline R jumps up.
  2. Watch the sparkline: The real-time R graph shows global coherence. Red when R < 0.5, cyan when R is high.
  3. Run Auto-Sweep: Click "Run Auto-Sweep". The simulation increases K from 0 to 5, records R at each step, and plots the phase transition curve (R vs K) on the right. You see the critical point where order emerges.
  4. Reset reinitializes phases and positions. Randomize frequencies draws new natural frequencies from the current spread.
  5. Freq spread controls the width of the Gaussian distribution of natural frequencies. Larger spread makes synchronization harder (higher Kc).

Usage (Power Grid tab)

  1. Click a generator and hold to overload it temporarily; release to clear. Double-click a node to cycle its state: normal → overloaded → blackout → normal. Overloaded nodes (red) add stress; blackout nodes (gray) are disconnected. Toggling blackout → normal also clears tripped links for that node.
  2. Run/Stop: Start or pause the simulation. Reset and Randomize Phases leave the sim stopped.
  3. R < 0.8 shows an instability warning; R < 0.5 shows system collapse. Metrics (R, Blackout count, Tripped count) and the R(t), Phase distribution, and Time vs generator plots update in real time.
  4. Auto-Tune Critical K sets coupling to 0 and ramps it up until R stays above 0.9 for 30 frames, then displays the critical K. It uses the current grid state (phases, node states). Changing the K slider hides the result banner.

Parameters

  • Coupling K (Theory): Strength of all-to-all coupling. Larger K pulls phases together; above a critical value the system synchronizes.
  • Coupling k (Power Grid): Strength of 4-neighbor coupling on the lattice. Lower k allows more drift; higher k helps synchronization.
  • Trip threshold (Power Grid): If the phase difference between neighbors exceeds this (radians), the link trips (dashed red). Lower value = easier to trip.
  • Overload (Power Grid): Extra frequency added to a node while it is overloaded (click-hold or double-click state), increasing stress on its links.
  • Freq spread (Theory): Standard deviation of the Gaussian distribution of natural frequencies.
  • Order parameter R: Magnitude of (1/N) Σ ej. R = 0: disordered; R = 1: full sync.

Buttons

  • Run Auto-Sweep (Theory): Steps K from 0 to 5, records R, and draws the phase transition curve. Coupling slider disabled until done.
  • Reset (Theory): New random phases and positions; natural frequencies unchanged.
  • Randomize frequencies (Theory): New natural frequencies from the current Gaussian; phases randomized.
  • Repair Grid (Power Grid): Clears all tripped links and sets all nodes to normal. Does not reset phases or stop the sim.
  • Reset (Power Grid): Rebuilds the grid with all phases 0 (synchronized), clears tripped/overload/history, and stops the sim.
  • Randomize Phases (Power Grid): Coherent random phases (within tolerance) and diverse natural frequencies; clears tripped/history and stops the sim. Run to see drift vs sync.
  • Auto-Tune Critical K (Power Grid): Ramps k from 0 on the current grid until R > 0.9 for 30 frames, then shows the critical k. Hides when you move the K slider.
  • Run/Stop (Power Grid): Toggles simulation run vs pause.