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
- Mouse: pick a tool, then click or drag in the tank. With Wall, Slow or Erase, hold Shift or switch to Line to draw a straight stroke.
- Touch: tap a tool, then tap or drag in the tank. The page does not scroll while your finger is on the tank, so scroll with the area around it.
- Keyboard: Space plays or pauses, S steps, C clears the waves, R reloads the preset, 1–6 pick a tool, L toggles straight lines, I toggles intensity, Delete removes the selected source.
- Source tool: tap empty water to add a source, tap a source to select it, drag to move it. Its frequency, amplitude, phase and motion are set in the Source panel.
- Probe: the yellow diamond records the water height at one point, so you can read amplitude and period from its chart.
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
- In Two-source interference, set the phase of one source to 180°. The nodal lines and the bright lines swap places.
- Load Double slit, turn on intensity and compare the fringe angles with d · sin θ = nλ. Then paint one slit shut.
- Switch between the narrow and the wide single slit and see which beam spreads more.
- In Refraction, change the slow medium speed and watch the wavefronts turn by a different angle.
- In Doppler effect, put the probe ahead of the source and read the period as it approaches and after it has passed. Then push its motion above 1.
- In Standing wave, detune the frequency a little. The pattern weakens because the box no longer resonates.
- Clear all, add a plane wave and paint your own lens or curved mirror.
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.