Computing the Edge of Chaos

Computing the Edge of Chaos

I’ve been thinking a lot about the border between predictability and total disorder. We usually treat these as binary states: a system is either stable, or it is broken. But nature rarely deals in binaries.

The double pendulum is the perfect mechanical metaphor for this misalignment. It is deceptively simple: just two rods and two weights governed by the rigid, deterministic laws of classical physics. There is no randomness in the equation. Yet, if you push it just hard enough, it creates behavior so complex that it becomes indistinguishable from magic.

I recently watched a breakdown of the Butterfly Effect in these systems: change the starting angle by 0.000001 degrees, and the outcome changes entirely. But I didn't just want to understand the theory; I wanted to see the architecture of it.

So, I built a tool to map it.

The Phase Space Fractal

Asked LLMs to build a WebGL simulation that renders any number of double pendulums simultaneously. The app calculates a specific metric for every single pixel in real-time: the "Time to Flip."

The visualization maps this time directly to color. In the chaotic zones, the pendulums flip almost immediately, causing the pixels to cycle through colors rapidly. In the stable zones, the so called "Islands of Stability," the pendulums never generate enough energy to invert, remaining a single, solid color.

Visually, this creates a fractal. It reveals that the boundary between order and chaos isn't a blurry line but an infinite, self-similar structure defined by precise mathematics.

It’s a reminder that complexity isn’t always random. Sometimes, it’s just a kind order that we haven't understood properly yet.

Explore the app here: https://pendulum.cosimomiccol.is