Clever Quest Lab ← Labs

Wave Simulator

A virtual ripple tank. Make waves, then watch them interfere, spread through slits, bounce off walls and bend where the water gets slow.

Tap for a ripple, drag for a wake.

Time 0.0 s λ – Grid – 0 fps

Probe

Pick the Probe tool and tap the tank to move the yellow diamond.

Source

No source selected

How to play

This is a ripple tank: a shallow tray of water seen from above, where red is a crest, blue is a trough and white is flat water. A preset starts as soon as the page loads. Choose another one to see interference, diffraction, reflection, refraction or the Doppler effect, then change it with the tools: poke the water, add oscillating sources, paint walls and patches of slow medium. There is no goal and no score: it is a sandbox.

Controls

How the simulation works

The tank is a grid of small cells, and each cell stores the water height u. The program solves the two-dimensional wave equation

∂²u/∂t² = c² · (∂²u/∂x² + ∂²u/∂y²)

with a standard leapfrog finite-difference scheme: the next height of a cell comes from its present height, its previous height and its four neighbours. The time step is kept below the stability limit c·Δt/Δx ≤ 1/√2, in the slow medium as well.

Here c is the wave speed. A source moves up and down f times per second (its frequency), and the distance between two crests is the wavelength λ = c / f. The Source panel shows λ for the selected source.

Superposition and interference. Where two waves meet, their heights simply add. Two sources in step reinforce each other wherever the path difference is a whole number of wavelengths (nλ) and cancel where it is (n + ½)λ. Those quiet curves are nodal lines. Turn on Show intensity, the time average of u², to see them clearly.

Diffraction. A wave that passes through a gap spreads out. The narrower the slit compared with λ, the wider the spreading: a slit about one wavelength wide acts like a point source, and a wide slit lets a beam through. Behind two slits the bright directions follow d · sin θ = nλ, where d is the slit spacing.

Reflection. Walls are rigid. A wave leaves a flat wall at the same angle at which it arrived, and a parabola sends a plane wave to its focus.

Refraction. In the tinted slow medium the frequency stays the same, so the wavelength shrinks and the wavefronts turn. The angles to the boundary normal obey Snell's law:

sin θ₁ / sin θ₂ = c₁ / c₂

Doppler effect. A source moving at speed v squeezes the crests ahead of it to λ(1 − v/c) and stretches those behind to λ(1 + v/c). Faster than the waves, the crests pile up into a V-shaped shock front.

What is simplified. These are ideal linear waves: every wavelength travels at the same speed and large waves behave like small ones. Real water ripples are dispersive, so their speed depends on wavelength and depth. The grid cannot show details smaller than a few cells, and the absorbing edge is a damping layer that still reflects a few per cent. Centimetres and seconds are the scale of the model, not a measurement of real water.

Things to try

Frequently asked questions

What do the colours mean?

Red is water above its rest level, blue is below and white is level. Dark blocks are walls and the green tint marks the slow medium. You can switch to greyscale or to a lit water surface in Settings.

Why do waves vanish at the edges?

With absorbing edges a hidden damping layer swallows outgoing waves, as if the tank were much larger. Choose reflecting edges to turn the rim into a wall.

Why do short waves look blocky?

A wavelength needs about eight grid cells to be drawn accurately. If it gets shorter, lower the frequency or raise the wave speed. The Source panel warns you when that happens.

Is this how real water behaves?

Only roughly. Interference, diffraction, reflection and refraction look the same, but real ripples change speed with wavelength and lose energy to friction.

Are my scenes saved?

Your settings and the scene you drew are stored in this browser only. Nothing is sent anywhere, and the page works offline.

More free games