Wave Interference StudioBeta

Color each wave source and explore interference, diffraction and refraction

This tool is a beta version still being stabilized. Please let us know if a result looks off.

Click/drag

Loading the simulation engine (WebAssembly)…

Drag a source (○) to move it. Draw walls and shallow water to try reflection and refraction. Switch to Intensity to see bright and dark interference fringes clearly. In Open space, ripples leave through the edges, and a wall drawn touching an edge continues forever beyond it. Sources and walls go anywhere; hold still near a grid point for a moment and they stick to it. With Snap on, walls and shallow water are drawn as straight lines. Turn on Color by source to see where each source's ripples mix and collide. The grid can't show a wave shorter than 4 cells, so shortening the wavelength raises the lowest allowed shallow-water speed ratio to keep the wavelength in shallow water at 4 cells or more.

About Wave Interference Studio

A ripple tank is the classic classroom apparatus: a shallow tray of water, a vibrating dipper, and a lamp underneath so that crests and troughs project as bright and dark bands. This tool moves that tank onto a 320×200 grid and solves the two-dimensional wave equation cell by cell with finite differences. Each time step, a wave in deep water advances half a cell (Courant number 0.5), and every source drives a small disk of radius two cells up and down at the period that matches the chosen wavelength.

Wall cells are pinned to zero displacement, so waves reflect off them. Shallow cells slow the wave by the factor set in the shallow-water speed slider. Each source is computed in its own channel and the channels are summed at the end. Because the wave equation is linear, the sum is identical to solving everything at once, and it lets the tool color each ripple by the source it came from.

Seeing Huygens' principle on a grid

In his 1690 Treatise on Light, Christiaan Huygens proposed that every point on a wavefront acts as a source of secondary wavelets, and that the next wavefront is the envelope of those wavelets. A finite-difference grid is almost a literal version of the idea: the next value in each cell depends only on the current values of its four neighbors, so disturbances can only travel by being handed from cell to cell.

In the single-slit preset the opening is 21 cells wide and the default wavelength is 16 cells. With a gap that close to one wavelength, the transmitted wave fans out into nearly a half circle. Repaint the barrier so the gap is only 4 or 5 cells and the opening behaves like a point source: the region behind it fills with clean semicircles. Widen the gap to 80 cells or more and the middle of the beam goes straight through, bending only at the edges. The amount of diffraction is set by the ratio of gap width to wavelength, and this is the quickest way to see that ratio at work.

Why shallow water bends waves

In a real tank, when the water depth h is much smaller than the wavelength, wave speed is v = √(gh) and depends on depth alone. Laying a glass plate on the tank floor makes the water above it shallower, so waves slow down there; the frequency is fixed by the dipper, so the wavelength shrinks. The shallow cells in this tool borrow exactly that result. At the default speed ratio of 0.5, a 16-cell wavelength becomes 8 cells inside the shallow region.

A wave that meets the boundary at an angle obeys Snell's law, sin θ₂ / sin θ₁ = v₂ / v₁, and bends toward the normal. With a speed ratio of 0.5 and a 30° angle of incidence, sin θ₂ = 0.25 and the refracted angle is about 14.5°. Going the other way, from shallow to deep, any angle above arcsin 0.5 = 30° cannot escape and is totally reflected. Drag the source in the refraction preset into the shallow side near the boundary to watch this happen.

The lens preset is a patch of shallow water shaped like a biconvex lens. The part of the wave passing through the thick middle spends longer in slow water, so the wavefront curves inward and converges on a focus, the same mechanism as a glass lens. The mirror preset runs the idea in reverse: a source placed at the focus of a parabolic wall sends out a plane wave after reflection, which is how satellite dishes and car headlights are laid out.

Where it differs from a real tank: dispersion

Real water waves are dispersive, meaning their speed depends on wavelength. In deep enough water, long waves outrun short ones. Below about 2 cm, surface tension takes over as the restoring force and short waves become faster again. The two effects meet near a wavelength of roughly 1.7 cm, where the phase speed bottoms out at about 23 cm/s. Classroom ripples tend to sit close to that size, which is why changing the dipper frequency in a real tank also changes the wave speed a little.

The equation in this tool has no physical dispersion. It does have a small numerical one that comes from the grid. At Courant number 0.5 and a 16-cell wavelength, a wave traveling along a grid axis runs about 0.5% slower than it should, and one traveling diagonally about 0.2% slower. Inside default shallow water (speed 0.5, 8-cell wavelength) the axial lag grows to about 2.4%. None of this is visible across one screen. But a 6-cell wavelength combined with a shallow speed of 0.2 would put the wavelength inside the shallow region at 1.2 cells, below what the grid can represent, and you would see numerical noise instead of refraction. The tool therefore raises the lowest allowed shallow speed to 4 ÷ wavelength so the shallow-water wavelength never drops below 4 cells (0.67 at a 6-cell wavelength, 0.25 at 16 cells, and the slider's own 0.2 floor from 20 cells up). Even at 4 cells the axial numerical lag is several percent, so the shorter the wavelength in shallow water, the more the refraction angle drifts from theory.

What the intensity view shows

Displacement view is the water height at one instant. Intensity view is the square root of a running average of u² in each cell, with a time constant of about 100 steps. In two-source interference, the nodal lines (places that stay calm) hide among flickering bands in displacement view but stand out as fixed dark curves in intensity view. After moving a source, the average needs a few hundred steps to catch up with the new layout.

Worked examples

Counting nodal lines between two sources

Input
Two-sources preset: separation 32 cells, wavelength 16 cells, zero phase difference
Output
Path difference ranges from 0 to 32 cells, so nodal lines appear where it equals 8 and 24 cells: two hyperbolas on each side of the axis, four in total

The nodal condition is path difference = (m + ½)λ. The path difference can never exceed the 32-cell separation, so only m = 0 and 1 fit. Drop the wavelength to 10 cells and path differences of 5, 15 and 25 become possible, giving three per side and six in total.

Refraction angle at a shallow boundary

Input
Shallow-water speed 0.5, angle of incidence 45°
Output
sin θ₂ = 0.707 × 0.5 = 0.354, so the refracted angle is about 20.7°; the wavelength inside is 8 cells

Raise the speed to 0.8 and sin θ₂ = 0.566, about 34.4°: less bending. As the speed ratio approaches 1 the boundary disappears.

How to use it

  1. Pick a preset, or start from an empty tank and place sources, walls and shallow regions.
  2. Adjust wavelength, phase difference between sources, and shallow-water speed.
  3. Switch between displacement and intensity to read interference bands and nodal lines.
  4. Toggle the edges between open space and reflecting walls to see what tank-wall echoes do.

Frequently asked questions

Why do waves slow down over shallow water in a real ripple tank?

When the water is shallower than the wavelength, the whole column down to the floor has to move, and the speed becomes √(gh). Cut the depth to a quarter and the speed halves.

What is the phase-difference slider for?

Source number i gets a phase of i times the setting. Line several sources up and add a phase step, and the combined wavefront tilts. That is the principle behind phased-array radar and ultrasound probes that steer a beam without moving.

Why does the pattern get messy in reflecting-wall mode?

Waves come back from the tank walls and interfere with the original ones. Real tanks put sloped absorbers around the edge for this reason. Open-space mode does the same job with an invisible 48-cell border where waves are gradually damped.

Does this apply to sound and light too?

It solves a scalar wave equation, so the geometry of interference, diffraction and refraction carries over. Properties specific to a medium, such as polarization of light or the dispersion of water waves, are not included.

Related guides

Sources

Last reviewed:

Privacy and how data is handled