Everything this page computes, term by term —
with the equation behind each and where it shows up on screen.
Surface elevation is \(\eta\), wavenumber \(k\), angular frequency
\(\omega\), water depth \(h\), gravity \(g\), wave height \(H\),
phase speed \(c\), and particle velocity components \(u\) (horizontal)
and \(w\) (vertical), with \(z\) measured from still water level down
to the seabed at \(z=-h\).
Linear (Airy) wave theory
Linear theory assumes the wave height is small compared to both
the wavelength and the depth, which lets the free-surface boundary
conditions be linearized:
$$\eta(x,t) = \frac{H}{2}\cos(kx - \omega t)$$
That's the wave drawn above when "Linear (Airy)" is selected.
The dispersion relation
Linear theory's boundary-value problem reduces to one equation
linking frequency, wavenumber, and depth — the dispersion
relation:
$$\omega^2 = gk\tanh(kh)$$
In deep water (\(kh\gg1\), \(\tanh\to1\)) this simplifies to
\(\omega^2\approx gk\); in shallow water (\(kh\ll1\),
\(\tanh(kh)\approx kh\)) it becomes \(\omega^2\approx ghk^2\).
There's no closed form for \(k(\omega)\) in between — this
page solves it numerically with Newton–Raphson, every time
the period or depth slider moves.
Particle orbits and depth attenuation
Linear potential-flow theory gives the horizontal and vertical
particle velocity at any depth as:
$$u(x,z,t)=\frac{H\omega}{2}\cdot\frac{\cosh(k(z+h))}{\sinh(kh)}\cos\theta,\qquad
w(x,z,t)=\frac{H\omega}{2}\cdot\frac{\sinh(k(z+h))}{\sinh(kh)}\sin\theta$$
with \(\theta=kx-\omega t\). The depth-attenuation factor
\(\cosh(k(z+h))/\sinh(kh)\) is what the arrows above are showing:
in deep water it collapses to \(e^{kz}\) — orbits shrink
exponentially within about one wavelength of the surface —
while in shallow water (\(kh\ll1\)) it flattens out toward 1, so
orbits barely shrink at all between the surface and the seabed.
That contrast is exactly why the arrows under a deep-water theory
(Linear, Stokes, Trochoidal) taper sharply, while the arrows under
a shallow-water theory (Cnoidal, Solitary) stay almost the same
length all the way down.
Beyond linear: Stokes 2nd- and 5th-order
Real waves aren't perfectly sinusoidal: crests are sharper and
troughs are flatter than \(\cos\) allows. Stokes expansion adds
higher-frequency corrections on top of the linear term. The
2nd-order correction, at twice the wavenumber and frequency:
$$\eta_{\text{Stokes-2}}=\frac{H}{2}\cos\theta+\frac{\pi H}{8}\cdot\frac{H}{\lambda}\coth(kh)\left[3\coth^2(kh)-1\right]\cos(2\theta)$$
This page's "Stokes 5th-order" extends that pattern with three
further harmonics (\(3\theta\), \(4\theta\), \(5\theta\)), each
one's amplitude a fixed fraction of the one before it. This is
a simplified, illustrative truncation, not the full closed-form
Fenton (1985) fifth-order coefficient set — it produces
a visibly sharper, more peaked crest than 2nd-order, in the right
qualitative direction, but isn't engineering-grade. Velocities for
both follow the same depth-attenuation pattern as linear theory,
applied separately to each harmonic (each one decays with depth
using its own wavenumber, \(\cosh(nk(z+h))/\sinh(nkh)\)).
Shallow water: cnoidal and solitary waves
In shallow water, nonlinearity reshapes a wave into tall, narrow
crests separated by long, flat troughs — the cnoidal wave,
built from the Jacobi elliptic function \(\mathrm{cn}\):
$$\eta(x,t)=\eta_{\text{trough}}+H\,\mathrm{cn}^2\!\left(\frac{2K(m)}{\lambda}(x-ct),\,m\right)$$
where \(K(m)\) is the complete elliptic integral of the first
kind. This page maps the wave's Ursell number to \(m\) with a
simple monotonic approximation tuned for the right qualitative
shape, not the full cnoidal/KdV dispersion closure — see
the caveats below. The "Solitary" option pins \(m\) close to its
\(m\to1\) limit: a single tall, isolated hump with long flat
stretches on either side, the cnoidal wave's solitary-wave limit.
Both use the long-wave (Boussinesq) approximation for particle
velocity, valid when \(kh\ll1\): horizontal velocity is nearly
uniform with depth, \(u(x,z,t)\approx c\,\eta(x,t)/h\), with the
small vertical velocity \(w\) recovered from continuity. This is
why the arrows under these two theories barely taper toward the
seabed — the direct contrast with the deep-water theories
above.
Trochoidal (Gerstner) waves
The Gerstner wave is an exact nonlinear solution for deep water,
first found by Gerstner (1809). Each particle, labeled by its mean
position \((x_0,z_0)\), traces a perfect circle:
$$x(x_0,t)=x_0-\frac{H}{2}e^{kz_0}\sin\varphi,\qquad
z(x_0,t)=z_0+\frac{H}{2}e^{kz_0}\cos\varphi,\qquad\varphi=kx_0-\omega t$$
The free surface (\(z_0=0\)) traced by this family of circles is
a trochoid — peaked crests, broad troughs, with no
small-amplitude assumption needed. Differentiating gives the
orbital velocity directly: \(u=\frac{H\omega}{2}e^{kz_0}\cos\varphi\),
\(w=\frac{H\omega}{2}e^{kz_0}\sin\varphi\) — the same
\(e^{kz}\) deep-water decay as linear theory's limit, but exact
rather than approximate. This page draws the Gerstner wave at
whatever depth is set on the slider, even though the solution is
strictly valid only for deep water; accuracy degrades as \(kh\)
drops into the shallow/intermediate regime.
Irregular seas and the JONSWAP spectrum
Every theory above is a regular sea: one wave height and
period. Real seas are irregular — many frequencies
superposed with random phases. The JONSWAP spectrum describes how
much energy sits at each frequency \(f\), peaking at \(f_p=1/T_p\):
$$S_0(f)=\frac{\alpha g^2}{(2\pi)^4f^5}\exp\!\left[-1.25\left(\frac{f_p}{f}\right)^4\right]\gamma^{\,r(f)},\qquad
r(f)=\exp\!\left[-\frac{(f-f_p)^2}{2\sigma^2f_p^2}\right]
with \(\sigma=0.07\) below \(f_p\) and \(0.09\) above it. The
peakedness \(\gamma\) sharpens the spectrum around \(f_p\) for a
developing sea; \(\gamma=1\) flattens it back into the
Pierson-Moskowitz spectrum for a fully developed sea. Rather than
transcribe the usual approximate formula relating \(\alpha\) to
\(H_s\) and \(T_p\), this page numerically integrates \(S_0(f)\)
and rescales it so the resulting significant height comes out
exactly \(H_s\) by construction — shown live in the corner of
the panel as a cross-check.
The sea below is built from \(N\!\approx\!56\) frequency bins,
each a tiny linear wave with amplitude
\(a_i=\sqrt{2S(f_i)\Delta f}\), wavenumber \(k_i\) solved from
\(\omega_i\) by the same dispersion solver used everywhere else on
this page, and a fixed random phase \(\varphi_i\):
$$\eta(x,t)=\sum_i a_i\cos(k_ix-\omega_it+\varphi_i)$$
"Randomize sea" redraws a fresh set of phases; moving the
\(H_s\)/\(T_p\)/\(\gamma\) sliders reuses the same phases so the
sea reshapes smoothly instead of jumping. This is a single,
one-directional snapshot — no directional spreading, a finite
(not continuous) set of components, and phases that are
pseudo-random rather than statistically faithful over long runs.
What's simplified
The dispersion solver and the Linear/Stokes-2nd-order/cnoidal
elevation formulas are established results, each checked against
a standard reference during implementation (Dean & Dalrymple,
Water Wave Mechanics for Engineers and Scientists, for the
Stokes terms). Stokes 5th-order here is a deliberately simplified
harmonic truncation rather than the full Fenton (1985)
coefficients. The cnoidal/solitary elliptic parameter \(m\) is fit
with an approximate Ursell-number mapping rather than solved from
the full KdV dispersion relation. Cnoidal/solitary particle
velocities use the leading-order long-wave (Boussinesq)
approximation, not exact potential flow. The Gerstner wave is
shown regardless of depth, though it's only exact in deep water.
None of these theories are valid to add together the way linear
waves are — each one describes a single monochromatic wave
train on its own, which is why this page always shows one theory
at a time driving the wave-and-arrows view, and shows all six only
as separate overlaid curves below, never summed.
The seabed is assumed flat and uniform, the sea is unidirectional
(no directional spreading), and there's no wave breaking, wind
input, or dissipation modeled anywhere on this page. The wave's
vertical scale in the top panel is exaggerated relative to the
depth axis for visibility — the exaggeration factor in use
is shown in the corner of that panel.