Lorenz Butterfly Screensaver
Lorenz Butterfly is a free, in-browser screensaver in which every particle carries its own three-dimensional state and integrates the Lorenz equations for itself. Thousands of independent trajectories, each starting somewhere different, all fall onto the same two-lobed attractor, so the butterfly appears as a cloud of smooth ribbons rather than a single traced line. Nothing to download, and ESC exits at any time.
How the Lorenz Butterfly screensaver works
The Lorenz system is three coupled differential equations that Edward Lorenz derived from a model of convection in 1963. With the classic parameters σ = 10 and β = 8/3 and ρ around 28, every solution is drawn onto a strange attractor with two lobes, and trajectories hop between the lobes unpredictably.
Most Lorenz visualisations integrate one trajectory and draw its path. This saver gives each of thousands of particles its own state (x, y, z), starts them at random, and steps each one with a small fixed timestep, four substeps per frame. Since the system is continuous, the paths are smooth and the ordinary segment renderer draws them faithfully.
The 3D state is projected onto the canvas using x and z, the classic butterfly view, centred and scaled to the screen. The parameter ρ is seeded in a range around 28, so different seeds give slightly different butterflies.
Because every particle piles onto the same structure, the stroke alpha is reduced to about a fifth of the other fields’ value, or the lobes would saturate to white in seconds. Speed scales the timestep; Trail sets how much of each ribbon lingers.
Convection, chaos and a famous butterfly
Edward Lorenz was a meteorologist who earned his doctorate at MIT and taught there. He published his three equations in 1963 in the Journal of the Atmospheric Sciences, in a paper titled “Deterministic Nonperiodic Flow”, as a drastically simplified model of convection in a layer of fluid heated from below. The variables describe the intensity of convection, a temperature difference between rising and falling currents, and how far the vertical temperature profile departs from a straight line. They are not a position in space, so the paths on screen are trajectories through an abstract state space, not particles moving through air.
Nearly every trajectory ends up on the same two-winged shape, but where exactly a particle sits on it becomes impossible to predict after a while. Start two points almost together and they soon end up in different places, even though the rules are completely deterministic. This sensitivity to initial conditions is the property later popularised as the butterfly effect, the idea that tiny causes can have large effects.
Lorenz’s paper closed by considering very-long-range weather prediction, and its central finding was that nonperiodic solutions are ordinarily unstable to small modifications, so imperfect measurements limit forecasts. The attractor itself has a fractal structure: more than a surface but less than a solid, with an estimated dimension of about 2.06.
A worked example
At the defaults — Monochrome palette, 2200 particles, Speed 1, Trail 62 — a silver butterfly assembles within seconds from thousands of pale threads, its two lobes brightest along the dense central bands, with individual particles visible switching from one wing to the other. Switch to Ultraviolet for a neon version, or set Trail to 100 to let the wings fill in solid.
Settings & tips
- Trail 100 fills the wings in completely; Trail 30 shows the individual trajectories racing around them.
- Reseed to vary ρ and change the proportions of the two lobes.
- A few hundred particles at Speed 2 makes the lobe-switching visible as individual moments of decision.
Frequently asked questions
- What is the Lorenz attractor?
- The set that all solutions of the Lorenz equations settle onto: a two-lobed, butterfly-shaped surface. Trajectories on it never repeat and are extremely sensitive to their starting point, which is where the phrase “the butterfly effect” comes from.
- How is this different from the Strange Attractor screensaver?
- Strange Attractor draws one trajectory as a continuous line and rotates it. This saver runs thousands of trajectories at once as independent particles, in the Driftfield palettes and trail system, so the attractor appears as a cloud of ribbons and you can watch many paths diverge together.
- Is the Lorenz Butterfly screensaver free?
- Yes. It runs free in your browser with nothing to download or install, and it works offline once the page has loaded.
- What does the Seed setting do?
- Everything is deterministic from the seed: the noise table, where the field’s features land and the order particles spawn in. Leave it blank for a fresh random layout on every run, or type any short word or number to get the same layout back each time.
- How do I exit the Lorenz Butterfly screensaver?
- Press the ESC key at any time to leave fullscreen and return to the page.
- Does this predict the weather?
- No. It is a toy model of fluid convection, and Lorenz used it to show why accurate long-range forecasts are limited. Real forecasts use far larger models.
- Why are the two wings never visited in a regular order?
- Switching between lobes follows no repeating pattern. The number of loops on one wing before crossing to the other varies irregularly, which is a hallmark of chaos.
- Why do thousands of particles end up on the same shape?
- The system is dissipative, so starting points are drawn toward the attractor. Where each particle sits on it varies, but the shape is the same for all.