🫧 Soap Bubble — Thin-Film Drainage & Iridescence
Interactive thin-film interference model of a draining soap bubble. Gravity drainage and evaporation thin the film over time; watch interference colours cycle through the visible spectrum until the film ruptures near a critical thickness.
About this simulation
A soap film is a wafer-thin layer of water sandwiched between two surfactant monolayers, and its ever-shifting rainbow colours are a textbook case of thin-film interference. This simulation drains the film exponentially — faster at the top, where gravity pulls liquid down into the surrounding frame, than at the bottom — while evaporation thins it everywhere at once, until the thinnest point crosses a rupture threshold and the bubble pops.
🔬 What it shows
A bubble coloured in horizontal interference bands that shift and cycle as thickness falls, alongside a live thickness-vs-time chart for both the top and bottom of the film, with a marked rupture line.
🎮 How to use
Set the Initial Thickness, Gravity Drainage Rate and Evaporation Rate, then watch the top and bottom thickness curves fall until one crosses the rupture line and the bubble pops. Click New Bubble to start again.
💡 Did you know?
Because gravity drains the top of a hanging film faster than the bottom, real soap bubbles often show a dark "black film" patch near the top just before popping — the top has drained down to just a couple of surfactant-bilayer thicknesses, too thin to reflect visible light at all.
Frequently asked questions
Why do soap bubbles show rainbow colours?
Light reflecting off the front and back surfaces of the thin film interferes constructively or destructively depending on the film's thickness and the light's wavelength, so different thicknesses reflect different colours strongly — the classic thin-film interference effect.
Why does the top of a soap film thin faster than the bottom?
Gravity continuously pulls liquid down out of the film into the thicker border where it meets the surrounding frame, so the top of a vertical film loses liquid to drainage fastest, while the bottom is topped up by that same draining flow for a while.
What makes a bubble pop?
Once drainage and evaporation thin part of the film down to only a few nanometres — roughly the thickness of the two surfactant monolayers with almost no water left between them — that patch becomes mechanically unstable and ruptures, and the tear propagates almost instantly across the whole film.
Is this a full optical calculation?
No — it uses a simplified interference-intensity approximation for three representative wavelengths (red, green, blue) rather than integrating the full visible spectrum, which is enough to reproduce the characteristic colour-cycling pattern without the computational cost of a full spectral model.
Simulate a soap film thinning under gravity drainage and evaporation. Watch thin-film interference colours shift and cycle as the film thickness falls through visible-light order, until the film crosses a critical thickness and the bubble pops.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install