Click ocean to trigger earthquake · Drag to add energy

About this simulation

Written by MySimulator Team · Reviewed by MySimulator Editorial Review

Last updated: 7 July 2026

This simulator numerically integrates the 2D linearised Shallow Water Equations on a 220×220 grid, using an explicit leapfrog (Störmer–Verlet) finite-difference stencil: η_next = damp·(2η − η_prev) + dt²·∇·(c²∇η), where c² = gH is the local squared wave speed set by the chosen bathymetry preset (continent, island, basin, or trench). Clicking the ocean adds a Gaussian seafloor uplift to both η and η_prev, mimicking how a submarine earthquake displaces the water column above it. Because c depends on depth, waves cross the 4 km-deep ocean near 200 m/s and slow to about 10 m/s on the shelf, compressing wavelength and amplifying height — shoaling, or Green's Law — while absorbing boundaries let energy leave the grid rather than reflect.

What it shows

Two coupled state fields — surface elevation η and the depth-dependent wave speed c=√(gH) — evolving under the linear shallow-water wave equation on a grid painted with your chosen bathymetry: deep blue open ocean, a shoaling shelf, and green land, with live Step / Max η / Speed / Energy readouts.

How to use it

Pick a bathymetry preset, then click or drag on the ocean to trigger a Gaussian seafloor uplift (the "earthquake"). Adjust uplift height and source radius to change the initial energy, tune Absorption to control how fast the leapfrog integrator bleeds off energy at the open boundaries, and use Pause/Reset to freeze or restart the run.

Did you know?

In the open ocean this simulated wave is barely visible — under a metre tall over hundreds of grid cells — because wavelength vastly exceeds depth; only Green's Law shoaling near the coast compresses that same energy into the metres-tall run-up real tsunami warning systems are built to forecast.

Frequently Asked Questions

What equations does this simulator actually solve?

It solves the 2D linear shallow-water wave equation for surface elevation η: η_next = damp·(2η − η_prev) + dt²·∇·(c²∇η), where c² = gH is set by local water depth H. This is integrated with an explicit leapfrog (Störmer–Verlet) finite-difference stencil on a 220×220 grid, using half-step averaged c² values at each cell face so the wave speed varies smoothly with the underlying bathymetry.

Why does the wave slow down and grow taller near the coast?

Wave speed is c = √(gH), so it drops from about 200 m/s in 4 km-deep water to roughly 10 m/s on the shallow shelf. As the wave decelerates its wavelength compresses while its energy flux is conserved, forcing the amplitude up — the shoaling effect known as Green's Law, the same mechanism real tsunamis use to grow from a barely-noticeable open-ocean swell into a destructive coastal wave.

What triggers a wave — how does clicking the ocean work?

Clicking or dragging on the canvas adds a Gaussian-shaped bump of height "amplitude" and radius "source radius" to both the current and previous elevation arrays at that grid location (skipping land and very shallow cells), which the leapfrog scheme reads as an instantaneous seafloor uplift — mimicking the vertical displacement a submarine earthquake gives the water column directly above the rupture.

Why do the bathymetry presets (continent, island, basin, trench) look so different?

Each preset simply fills the depth array H(x,y) with a different function before the simulation starts: Continent slopes from a 4000 m abyssal plain down through a shelf to dry land; Island is a submerged volcanic cone; Basin is an enclosed deep bowl with a shallow rim; Trench cuts an 8000 m parabolic trough near one edge with a coastline on the other. Since c² = gH, these shapes directly control how fast and how strongly waves travel and refract.

Is this simulation physically accurate enough to model a real tsunami?

It captures the core physics correctly — variable-speed long-wave propagation, shoaling amplification, and energy conservation via a symplectic-style leapfrog scheme — which is exactly the family of equations real tsunami-warning centres use. It's a simplification, though: it ignores wave breaking, Coriolis effects, dispersion, and 3D water-column dynamics, so treat run-up heights here as illustrative, not as engineering-grade coastal forecasts.