This ripple tank numerically solves the 2D wave equation ∂²h/∂t² = c²∇²h on a 180×160 grid using a leapfrog (current/previous/next) finite-difference scheme with a CFL-stable coefficient of 0.49. A single continuous oscillator drives one, two, or a full plane-front of source cells, and the same grid model reproduces every classic wave behaviour — interference, diffraction and refraction — just by changing where energy enters and how the local wave speed varies.
Wave height is rendered as colour (bright cyan crests, dark troughs) sweeping across the grid in real time. Two sources create interference fringes, a barrier with one or two slits produces diffraction patterns behind it, and a depth gradient slows the wave on one side so wavefronts visibly bend — refraction — toward the shallows.
Choose Point, Two-source or Plane source mode, then adjust Frequency, Two-source spacing, Damping and the Depth gradient (refraction) slider. Toggle the Barrier wall checkbox and set the Slits count (0-2) for diffraction, or jump straight to a ready-made setup with the Two-source, Double slit, Refraction or Reflection presets, and use Pause/Clear to control the run.
The Fringes stat estimates the maximum number of interference bright fringes from two sources using N ≈ 2·D/λ, where D is the source spacing and λ the wavelength — the exact same formula physicists use for Young's double-slit light experiment, because both are governed by the identical wave equation.
It solves the classic 2D wave equation ∂²h/∂t² = c²∇²h on a grid, where h is surface height and c is the local wave speed. Each cell's next value comes from a leapfrog update combining its current and previous height plus the Laplacian (sum of neighbour heights minus 4× the centre) scaled by c².
Selecting Two-source mode drives two grid cells with the same oscillating amplitude. Their circular wavefronts overlap, reinforcing in some directions and cancelling in others, producing the bright/dark fringe pattern predicted by N ≈ 2·D/λ where D is the source spacing shown by the gap slider.
Enabling the Barrier wall marks a column of grid cells as reflecting, except for openings sized by the Slits slider. Waves passing through a narrow opening spread out on the far side in circular arcs rather than continuing straight, which is diffraction, most visible with the Double slit preset.
The depth gradient slider lowers cmap, the local wave-speed-squared value, toward one side of the tank, mimicking a sloping seabed since real wave speed follows c = √(g·depth). Waves travel slower in the shallow region, so wavefronts that hit the slope at an angle rotate to point more directly at the shore — refraction.
Damping multiplies every cell's height by a factor just under 1 (typically 0.985-1.0) each step, gradually removing energy so old ripples fade rather than reflecting forever off the grid edges. Lower values make waves die out faster; a value of exactly 1 would let energy build up indefinitely.