Devlog #79 – Wave 59: Strange Attractors, Wolf-Sheep & Kuramoto

Wave 59 spans chaos theory, ecology, and neuroscience — with a 3D drag-to-rotate strange attractor visualizer covering four classic chaotic systems, a spatial agent-based predator-prey simulation producing emergent population cycles, and a Kuramoto coupled-oscillator model demonstrating a phase transition from incoherence to synchrony. The library now stands at 553 simulations.

Wave 59 — 3 simulations added
553
Total simulations
3
New this wave
59
Wave number
79
Devlog #

New Simulations

πŸŒ€

Strange Attractors — Lorenz, RΓΆssler, Thomas, Halvorsen

3D drag-to-rotate visualization of four chaotic strange attractors. RK4 integration, three colour modes (velocity / time / depth), adjustable trails and parameters. Pre-runs 2000 steps to land on the attractor before display.

🐺

Wolf-Sheep Predation — Agent-Based Ecology

50×50 spatial grid where sheep eat grass, wolves hunt sheep using range vision, and sheep flee from nearby wolves. Population time series chart shows Lotka-Volterra-style cycles emerging from local rules.

πŸ”„

Kuramoto Synchronization — Coupled Phase Oscillators

N oscillators governed by dΟ†α΅’/dt = Ο‰α΅’ + (K/N)Ξ£sin(Ο†β±Όβˆ’Ο†α΅’). Order parameter r(t) time series and live phase histogram show the continuous synchronization phase transition at K_c β‰ˆ 2Οƒ_Ο‰.

πŸŒ€ Strange Attractors β€” 3D Chaotic Topology

What makes an attractor "strange"?

A strange attractor is a set toward which a dynamical system evolves, but where nearby trajectories diverge exponentially β€” the hallmark of deterministic chaos. The key properties are: (1) bounded motion, (2) sensitivity to initial conditions (positive Lyapunov exponent), and (3) fractal structure (non-integer Hausdorff dimension).

The simulation implements four classic systems using a 4th-order Runge-Kutta (RK4) integrator. Points are stored in a circular trail buffer and rendered with alpha-blended line segments. A simple perspective projection with two rotation angles (rotX, rotY) allows full 3D exploration via mouse drag or touch.

The four attractors

Colour modes

Three modes reveal different attractor geometry:

🐺 Wolf-Sheep Predation β€” Spatial Agent Ecology

From ODEs to individual agents

The classic Lotka-Volterra equations describe predator-prey dynamics with smooth differential equations. This simulation replaces them with individual agents on a 50×50 grid, where each sheep and wolf makes its own local decisions each tick. Global-scale cycles emerge from purely local interactions β€” no equations encode the oscillation explicitly.

Agent rules

The population time series chart records history for 350 ticks. Typical behaviour: sheep overshoot as grass is abundant β†’ wolf population spikes with lag β†’ sheep collapse β†’ wolves starve β†’ sheep rebound. The spatial structure produces refugia β€” patches where sheep survive wolf waves β€” which sustain the cycles rather than leading to extinction.

πŸ”„ Kuramoto Synchronization β€” A Phase Transition in Coupled Oscillators

The model

Yoshiki Kuramoto (1975) proposed one of the most elegant models in nonlinear science. Each oscillator i has a phase Ο†α΅’ ∈ [0, 2Ο€) that evolves as:

dΟ†α΅’/dt = Ο‰α΅’ + (K/N) Ξ£β±Ό sin(Ο†β±Ό βˆ’ Ο†α΅’)

where Ο‰α΅’ is drawn from a Gaussian distribution with spread Οƒ, and K is the global coupling strength. Natural frequencies are frozen (quenched disorder), so without coupling each oscillator simply runs at Ο‰α΅’. The sin coupling term pulls each oscillator toward its neighbours' phases.

Order parameter and the phase transition

The degree of synchrony is measured by the complex order parameter:

r e^(iψ) = (1/N) Ξ£β±Ό e^(iΟ†β±Ό)     β†’     r ∈ [0, 1]

r = 0 means the phases are uniformly spread (incoherent); r = 1 means all phases are identical (fully synchronized). Kuramoto's exact solution for the Lorentzian frequency distribution gives a critical coupling:

K_c = 2Ξ³   (Lorentzian)    K_c β‰ˆ 2Οƒβˆš(2/Ο€)  (Gaussian)

Below K_c: r β†’ 0 as N β†’ ∞ (incoherent phase). Above K_c: r jumps continuously from zero β€” a second-order phase transition. The simulation uses a Gaussian distribution and estimates K_c β‰ˆ 2Οƒ as a quick guide.

Try this

Real-world applications

Kuramoto-type synchronization appears across biology and engineering: cardiac pacemaker cells in the sinoatrial node, neural gamma oscillations in cortex, circadian clock cells in the suprachiasmatic nucleus, flashing fireflies, and stability of AC power grids. The universality of the model is one of the most striking facts in complex systems science.

Looking Ahead

Candidate simulations for Wave 60 include: a Turing-diffusion reaction-diffusion system (distinct from the Turing machine), a viscoelastic fluid solver, a double pendulum ensemble showing chaos onset, and a network science visualizer for random/scale-free/small-world graphs. We're also considering adding a "collections" feature to let visitors bookmark and share curated sets of simulations.

← Devlog #78 β€” Wave 58 All posts →