The repository wave-disp-equation.py represents a computational suite engineered to solve this specific physical relationship through a spectrum of methodologies, ranging from exact numerical iteration to state-of-the-art analytical approximations. Because the fundamental relationship governing surface gravity waves is transcendental, the extraction of the wavenumber from a known wave period and water depth introduces a significant computational bottleneck in large-scale phase-resolving and spectral wave models.
This documentation serves as a comprehensive theoretical and mathematical companion to the wave-disp-equation.py module. It systematically deconstructs every algorithm, explicit formulation, and Padé approximant codified within the repository, explaining the hydrodynamic origins, mathematical derivations, and computational optimization strategies. The analysis traverses classical historical approximations, nested minimax optimizations, restricted domain expansions, and the highly advanced half-integer fractional Padé approximants.
To fully contextualize the algorithms within the wave-disp-equation.py repository, it is imperative to establish the fluid dynamic principles from which the governing equations are derived.
Airy wave theory, formally recognized as linear wave theory, provides the foundational mathematical description of surface gravity wave propagation over a homogeneous fluid layer.
The derivation of the linear dispersion relation begins with the Navier-Stokes equations, subjected to a specific set of simplifying assumptions. The fluid is assumed to be inviscid (frictionless), incompressible (constant density), and undergoing irrotational flow. The assumption of irrotationality (
While potential flow theory typically fails in boundary-dominated fluid mechanics, it succeeds exceptionally well for surface gravity waves because wave-induced vorticity is strictly confined to microscopic oscillatory Stokes boundary layers at the seabed and the free surface, leaving the vast majority of the water column irrotational.
The Laplace equation is a linear, elliptic partial differential equation that requires strict boundary conditions to close the system. The fluid domain is bounded horizontally but vertically constrained by an impermeable flat seabed at
-
Kinematic Bed Boundary Condition: Fluid particles cannot penetrate the solid seabed. Therefore, the vertical velocity at the bottom must be zero:
$$\left. \frac{\partial \Phi}{\partial z} \right|_{z = -h} = 0$$ -
Kinematic Free-Surface Boundary Condition: A fluid particle that is on the free surface must remain on the free surface. The vertical velocity of the surface dictates the vertical velocity of the fluid:
$$\frac{\partial \eta}{\partial t} + \frac{\partial \Phi}{\partial x}\frac{\partial \eta}{\partial x} = \frac{\partial \Phi}{\partial z} \quad \text{at} \quad z = \eta(x,t)$$ -
Dynamic Free-Surface Boundary Condition: The pressure at the free surface must equal the uniform atmospheric pressure. AApplying the unsteady Bernoulli equation yields:
$$\frac{\partial \Phi}{\partial t} + \frac{1}{2}\left[ \left(\frac{\partial \Phi}{\partial x}\right)^2 + \left(\frac{\partial \Phi}{\partial z}\right)^2 \right] + g\eta = 0 \quad \text{at} \quad z = \eta(x,t)$$
Because the free-surface conditions are evaluated at an unknown moving boundary
Assuming a monochromatic, progressive harmonic wave, the free surface elevation is defined as:
Where
Applying separation of variables to the Laplace equation and enforcing the kinematic bed condition yields a velocity potential of the form:
Substituting this potential and the surface elevation into the linearized dynamic and kinematic free-surface boundary conditions establishes an eigenvalue problem. For a non-trivial solution to exist, the relationship between the temporal parameter (
This equation explicitly states that surface gravity waves are dispersive media; waves of different lengths travel at different speeds.
The phase velocity (wave-disp-equation.py module.
In virtually all practical applications spanning oceanography and coastal engineering, the wave period
However, the fundamental equation
To computationally attack the problem, the wave-disp-equation.py repository first standardizes the equation into a universally applicable dimensionless form. By defining the deep-water wavenumber
To simplify the mathematical notation utilized throughout the module's algorithms, the independent dimensionless deep-water parameter is defined as
The entire algorithmic architecture of wave-disp-equation.py is singularly dedicated to mapping the known input
The design of the computational algorithms relies heavily on the asymptotic behavior of the hyperbolic tangent function (
-
Deep Water Limit (
$\alpha \rightarrow \infty$ ): Physically, this hydrodynamic regime occurs when the water depth is significantly greater than half the wavelength ($h/L_0 > 0.5$ ). In this domain, the sub-surface wave orbital motions decay exponentially with depth and dissipate entirely before interacting with the seabed. Mathematically, as the argument$\beta \rightarrow \infty$ , the hyperbolic tangent geometrically flattens and approaches unity ($\tanh \beta \rightarrow 1$ ). The canonical dispersion equation thus reduces to:$$\Large \beta \approx \alpha$$ This strict equality implies that
$kh \approx k_0h$ , meaning the local wavenumber$k$ converges entirely to the deep-water wavenumber$k_0$ , and the local wavelength$L$ exactly equals$L_0$ . By substituting$k = \omega^2/g$ , the phase speed becomes:$$\Large c_p = \frac{\omega}{k} \approx \frac{\omega}{k_0} = \frac{\omega}{\omega^2 / g} = \frac{g}{\omega} = \frac{g}{2\pi}T$$ In the deep-water limit, the phase speed is directly proportional to the wave period
$T$ and completely independent of the bathymetric depth$h$ . This frequency-dependent velocity represents pure dispersion and explains why long-period ocean swells outrun short-period wind chop across open ocean basins. -
Shallow Water Limit (
$\alpha \rightarrow 0$ ): Physically, this regime occurs when waves propagate into very thin nearshore water layers ($h/L_0 < 0.05$ ). Here, the wave orbital motions become highly compressed and elliptical, dragging heavily against the solid seabed. Mathematically, by applying a Maclaurin series expansion for small arguments,$\tanh(\beta) \approx \beta - \beta^3/3 + \dots \approx \beta$ . Substituting this linear approximation into the canonical dispersion relation yields:$$\Large \alpha \approx \beta \cdot (\beta) = \beta^2$$ Taking the square root mathematically isolates the dependent variable:
$$\Large \beta \approx \sqrt{\alpha}$$ By unpacking the dimensional parameters (
$k \cdot h \approx \sqrt{\frac{\omega^2}{g} \cdot h}$ ), we extract the shallow-water wavenumber. In this regime, phase speed becomes:$$\Large c_p = \frac{\omega}{k} = \frac{\omega}{\frac{\omega}{\sqrt{gh}}} = \sqrt{gh}$$ Crucially, this phase speed is entirely dictated by depth (
$h$ ) and is completely independent of wavelength or frequency, resulting in a strictly non-dispersive wave profile. In shallow water, all waves (regardless of their period) travel at the exact same velocity, which is the fundamental mechanism driving wave shoaling and forcing the uniform parallel alignment of wave crests to the coastline via refraction.
The module establishes its baseline of mathematical truth through the kh_numeric(k0h, tol=1e-15, max_iter=100) function, which utilizes the Newton-Raphson iterative root-finding algorithm to converge upon a numerically exact solution.
The Newton-Raphson method isolates the root of an objective function
To apply the Newton-Raphson update, the analytical derivative (Jacobian) of the residual function with respect to the unknown
Within wave-disp-equation.py, this derivative is computationally implemented utilizing the fundamental identity
df = -math.tanh(kh) - kh / math.cosh(kh)**2The iterative scheme advances by projecting the tangent line of the current guess to the zero intercept:
The iteration loop rigorously evaluates the relative step size tol=1e-15, the loop terminates, having achieved double-precision floating-point exactness. A safety break is enforced via max_iter=100 to prevent infinite looping in the event of pathological input data.
The standard residual function wave-disp-equation.py repository circumvents this geometrical hazard entirely by supplying an exceptionally sophisticated initial guess
This specific formula was developed by R. Carvalho in 2006 using Gene Expression Programming (GEP), a high-performance evolutionary algorithm. GEP differs from traditional genetic algorithms by using linear chromosomes (the genotype) that are expressed as branched expression trees (the phenotype), allowing the system to discover complex nonlinear algebraic relationships that human derivation might overlook. Carvalho’s GEP-derived seed represents a breakthrough in performance engineering, achieving superior precision (0.27% maximum error) compared to traditional explicit bridges.
This specific seed algorithm is a masterclass in asymptotic matching.
In the shallow limit (
While the kh_numeric function provides flawless mathematical precision, the repetitive evaluation of expensive transcendental functions (while loop is highly deleterious to the performance of large-scale, phase-resolving coastal models and global spectral grids, which evaluate the dispersion relation millions of times per temporal step. To alleviate this computational burden, scientists have engineered explicit, non-iterative approximations.
The repository categorizes its explicit formulas into specific groups. Group I1 details analytical solutions valid across the entire physical domain (
1. The Eckart Solution (1951) Carl Eckart formulated the foundational explicit approximation by recognizing that multiplying the deep water linear limit by a hyperbolic tangent containing the shallow water limit generates a globally continuous curve:
Equivalently expressed in terms of wavelength:
This pioneering equation guarantees boundary compliance. However, its rigid geometrical structure lacks tunable degrees of freedom in intermediate depths.
Consequently, the approximation bows away from the exact solution, producing a maximum positive error of
2. The Iwagaki Solution To constrain the intermediate depth error, Iwagaki injected a corrective linear growth term into the hyperbolic argument:
The added internal degrees of freedom force the curve closer to the exact solution, producing an oscillatory error bound.
The error spans from a negative maximum of
3. Yamaguchi's 4th Solution (Yamaguchi(2007)_4) Yamaguchi and Nonaka identified that eliminating transcendental functions entirely could vastly accelerate processing times on legacy hardware. This explicit solution operates solely on algebraic fractions and roots:
Despite bypassing hyperbolic geometry entirely, the formula manages to restrict the maximum relative error to 3.177% (occurring at
4. Fenton and MacKee (FM) Solution (1990)
Fenton and MacKee revolutionized explicit modeling by generalizing Eckart's static
Through minimax error optimization, they deduced that setting
5. Yamaguchi and Nonaka Modifications (YN1 and YN2) Yamaguchi and Nonaka (2007) observed that the FM solution produced an asymmetrical error domain.
-
YN1 Solution: By perturbing the exponent to
$m = 1.485$ , Yamaguchi and Nonaka perfectly balanced the positive and negative maximum errors, resulting in an error band strictly bounded by$\pm 1.55%$ . -
YN2 Solution: To achieve sub-1% accuracy, they proposed nesting the YN1 explicit estimate directly back into a rearranged form of the analytical dispersion relation. By calculating a temporary variable
$\beta_F = \alpha(\coth \alpha^{m/2})^{1/m}$ with a customized parameter$m = 1.378$ , the final wavenumber is extracted via:$$k_a h = \alpha \coth \beta_F$$ This nested architecture simulates a single quasi-Newton corrective step, halving the maximum error to a symmetrical$\pm 0.73%$ .
6. The Guo Solution (2002) Jie Guo engineered a fundamentally different geometric approach, abandoning the hyperbolic cotangent in favor of a standard exponential decay function:
Utilizing a highly optimized parameter
7. Carvalho's 18th, 10th, and 9th Solutions The module addresses a spectrum of formulas derived by Carvalho utilizing a variety of mathematical structures, ranging from simple dual-nested hyperbolic functions to exponential asymptotic geometries.
-
Carvalho(2025)_18:
$k_a h = \alpha \coth(\sinh \alpha^{1/2})$ . By cleanly nesting a single hyperbolic sine inside a hyperbolic cotangent, this configuration yields a strictly negative error profile, bounding the maximum relative error to 1.129% (occurring at$\alpha = 1.4912$ ). -
Carvalho(2025)_10:
$k_a h = \alpha \coth((6/5)^\alpha \cdot \alpha^{1/2})$ . This formula provides excellent precision, with the maximum relative error constrained to 0.271% (occurring at$\alpha = 0.3941$ ). As previously discussed, this specific$1.2^\alpha$ (or$(6/5)^\alpha$ ) geometry leverages an exponential fractional base rather than deep nesting. It is precisely what powers the highly stable initial guess for thekh_numericNewton solver. -
Carvalho(2025)_9:
$$k_a h = \frac{\alpha}{(\tanh \alpha)^{1/4} [\tanh { (\sinh \alpha)^{1/2} }]^{1/2}}$$ Unlike the simpler configurations above, this specific formula aggressively triply nests hyperbolic functions alongside radical roots. This deep topological nesting suppresses the maximum relative error down to 0.204% (occurring at$\alpha = 2.6569$ ). However, the computational latency induced by evaluating three separate transcendental instructions renders this particular formula inefficient compared to fractional Padé alternatives.
8. Carvalho's Evolutionary GEP Solutions (2025) and Yamaguchi Modifications The module includes a vast array of explicit formulas derived via Gene Expression Programming (GEP) by Carvalho, alongside modifications detailed by Yamaguchi & Nonaka. By strictly analyzing the wave-disp-equation.py Python array outputs, the most notable mathematically distinct explicit formulas are deconstructed below:
The Deeply Nested Fraction (Carvalho(2025)_4):
The Optimized Exponential (Carvalho(2025)_5):
The Triple Nested Root (Carvalho(2025)_9):
The Asymptotic Seed (Carvalho(2025)_10): kh_numeric Newton solver. It seamlessly connects shallow and deep asymptotes, limiting the maximum relative error across all depths to
-
The Hyperbolic Sine Root (
Carvalho(2025)_18):$$\Large k_a h = \frac{\alpha}{\tanh(\sinh \sqrt{\alpha})}$$ This configuration eliminates positive error overshoot, yielding a strictly negative error profile bounded by a maximum relative error of$1.129%$ (occurring at$\alpha = 1.4912$ ). -
The Algebraic Solution (
Yamaguchi(2007)_4):$$\Large k_a h = \alpha(1 + \alpha^{-2})^{1/4}$$ This lightweight equation bypasses hyperbolic geometry entirely. It operates strictly on algebraic fractions and roots, achieving a maximum relative error of$3.177%$ (occurring at$\alpha = 0.4268$ ). It is ideal for legacy systems where hardware ALUs execute simple roots faster than transcendentals.
| Model Name | Equation Format | MaxErr |
|---|---|---|
| Carvalho(2025)_4 | Deep continuous fraction | |
| Carvalho(2025)_5 | ||
| Carvalho(2025)_9 | ||
| Carvalho(2025)_10 (Seed) | ||
| Yamaguchi(2007)_2 (YN2) | Nested FM substitution |
|
| Guo(2002) | ||
| Carvalho(2025)_18 | ||
| Yamaguchi(2007)_1 (YN1) | ||
| Fenton&McKee(1990)_2 | ||
| Iwagaki(2007) | ||
| Yamaguchi(2007)_4 | ||
| Eckart(1951) |
When resolving complex nearshore wave-current interactions or phase-resolving Boussinesq hydrodynamics, standard explicit bounds of
J.N. Hunt published the definitive early application of Padé approximants for wave dispersion, expanding the squared dimensionless wavenumber
-
Hunt's 5th Order Approximant (Hunt1):
$$(k_a h)^2 = \alpha^2 + \frac{\alpha}{1 + 0.6522\alpha + 0.4622\alpha^2 + 0.0864\alpha^4 + 0.0675\alpha^5}$$ Notice the deliberate mathematical omission of the cubic parameter ($\alpha^3$ ); this forces the polynomial to warp across the transitional intermediate depths smoothly, achieving an impressive error boundary between$-0.070%$ and$+0.078%$ . -
Hunt's 9th Order Approximant (Hunt2): To push precision to the extreme, Hunt formulated a 9th order denominator polynomial:
$$(k_a h)^2 = \alpha^2 + \frac{\alpha}{1 + \sum_{n=1}^9 d_n \alpha^n}$$ Where the precisely tuned coefficients are:$d_1 = 0.66667$ ,$d_2 = 0.35550$ ,$d_3 = 0.16084$ ,$d_4 = 0.06320$ ,$d_5 = 0.02174$ ,$d_6 = 0.00654$ ,$d_7 = 0.00170$ ,$d_8 = 0.00039$ , and$d_9 = 0.00010$ . This expansion compresses the relative error to an exceptionally tight margin of$-0.0082%$ to$+0.0054%$ . Despite the high degree, evaluating a 9th order polynomial using Horner's method requires only basic multiplication and addition, entirely eliminating CPU-intensive transcendental logic.
The repository wave-disp-equation.py deploys state-of-the-art fractional Padé approximants within the pade2025(k0h, formula) function, mapping formulas 1 through 13. Padé approximants are rational functions that approximate a given function by matching its Taylor series expansion up to a specified order. They use ratios of polynomials instead of solely polynomial expansions, offering vastly superior accuracy, particularly around singularities, asymptotes, and for functions exhibiting nonlinear saturation geometries like the hyperbolic tangent transition zone.
Derived utilizing gene expression programming and analytical minimax optimization, Carvalho's novel mathematical insight was constructing the Padé polynomials utilizing half-integer powers (
-
Formula 1 (
Pade(2025)_1):$$k_a h = \frac{n_1 \alpha^{0.5} + n_2 \alpha^{1.5} + n_3 \alpha^{2.5}}{1 + d_1 \alpha^{1.0} + d_2 \alpha^{2.0}}$$ Where the numerator coefficients are:
$n_1 = 1.00649052194019$ $n_2 = 0.423646282789217$ $n_3 = 0.175406661440005$
And the denominator coefficients are:
$d_1 = 0.306955955676234$ $d_2 = 0.0328975279727171$
As
$\alpha \rightarrow 0$ , the lowest-order terms dominate, collapsing the fraction to$1.006 \alpha^{0.5} / 1$ , correctly modeling the shallow limit. As$\alpha \rightarrow \infty$ , the highest-order terms dominate, balancing out to a linear$\alpha^{1.0}$ trajectory to flawlessly mirror the deep-water limit. This fundamental configuration provides an excellent baseline, yielding a maximum relative error of just$0.6485218%$ (occurring at$\alpha = 0.0001$ ). -
Formula 2 (
Pade(2025)_2):$$k_a h = \frac{n_1 \alpha^{0.5} + n_2 \alpha^{1.5} + n_3 \alpha^{2.5} + n_4 \alpha^{3.5}}{1 + d_1 \alpha^{1.0} + d_2 \alpha^{2.0} + d_3 \alpha^{3.0}}$$ Where the numerator coefficients are:
$n_1 = \phantom{-}0.998980252114366$ $n_2 = \phantom{-}0.0240176797055886$ $n_3 = \phantom{-}0.102524886754552$ $n_4 = \phantom{-}0.0317327085938995$
And the denominator coefficients are:
$d_1 = -0.150350405960952$ $d_2 = \phantom{-}0.112157962910113$ $d_3 = \phantom{-}0.00294483072586115$
The deliberate introduction of a negative linear coefficient (
$-0.15035...\alpha^{1.0}$ ) in the denominator acts as a topological inflection constraint, forcing the polynomial curve to hug the transcendental$\tanh$ geometry with supreme accuracy throughout intermediate depth transitions. This structural refinement dramatically constrains the maximum relative error down to a highly accurate$0.1018976%$ (occurring at$\alpha = 0.0001$ ). -
Formula 3 (
Pade(2025)_3):$$k_a h = \frac{n_1 \alpha^{0.5} + n_2 \alpha^{1.5} + n_3 \alpha^{2.5} + n_4 \alpha^{3.5} + n_5 \alpha^{4.5}}{1 + d_1 \alpha^{1.0} + d_2 \alpha^{2.0} + d_3 \alpha^{3.0} + d_4 \alpha^{4.0}}$$ Where the numerator coefficients are:
$n_1 = 1.00006668638419$ $n_2 = 0.322645945302282$ $n_3 = 0.0860384450810725$ $n_4 = 0.051143347041175$ $n_5 = 0.0153420957423937$
And the denominator coefficients are:
$d_1 = 0.157166943736625$ $d_2 = 0.0245168267924732$ $d_3 = 0.0462567432956417$ $d_4 = 0.00175392506101448$
This expansion achieves phenomenal numerical stability. By expanding the numerator to the 4.5-degree and the denominator to the 4.0-degree, this formulation pushes the precision even further, limiting the maximum relative error to an exceptional
$0.0066566%$ (occurring at$\alpha = 0.0001$ ). Because the mathematical operations rely exclusively on basic arithmetic and a single primitive square root, thepade2025function can be mapped directly onto highly parallelized tensor structures or GPU arrays without encountering the thread divergence issues caused by iterative conditional checking. Note that the programmatic array restrictsk0hinputs to between$0$ and$2\pi$ to prevent unbounded polynomial resonance.
For specialized oceanographic models that process hydrodynamics exclusively in the far open ocean (deep water) or exclusively in the nearshore surf zone (shallow water), computing a global explicit formula carries unnecessary mathematical overhead.
Groups II and III encompass solutions defined strictly by localized Taylor and asymptotic series centered around
These formulations leverage the Maclaurin series expansion of the fundamental transcendental equation, tailored for nearshore environments.
-
Nielsen's 1st Solution (Niell): By taking the first-order correction,
$k_a h = \alpha^{1/2} {1 + (5/8\pi)\alpha}$ . This limits the error to$\pm 0.74%$ , but mathematically diverges if applied past the surf zone bound of$h/L_0 \le 0.192$ . -
Nielsen's 2nd Solution (Niel2): Adding second-order terms extends the domain seaward:
$k_a h = \alpha^{1/2} {1 + (1/6)\alpha + (11/360)\alpha^2}$ . Error remains$\pm 0.44%$ out to$h/L_0 \le 0.401$ . -
Venezian's 1st Solution (Venel): Applies a simple rational denominator shift:
$k_a h = \alpha^{1/2} / (1 - \alpha/6)$ . Maintains a tight$\pm 0.048%$ error constraint up to$h/L_0 \le 0.165$ . -
Wu and Thornton 1st Solution (WT1):
$k_a h = \alpha^{1/2} {1 + \frac{\alpha}{6}(1 + \frac{\alpha}{5})}$ . Maintains precision out to$h/L_0 \le 0.219$ . -
Olson (1973) and You (2008): Olson aggressively pushed the polynomial to the 7th order:
$k_a h = \alpha^{1/2} {1 - \frac{1}{3}\alpha + \frac{1}{45}\alpha^2 + \frac{1}{189}\alpha^3 + 0.000776\alpha^4 - 0.000044\alpha^5 - 0.000071\alpha^6 - 0.000022\alpha^7 }^{-1/2}$ . This drives the error down to a microscopic$\pm 0.00003%$ within the shallow zone$h/L_0 \le 0.186$ . -
Venezian's 2nd Solution (Vene2): Employs a specific, highly optimized nearshore Padé rational fraction:
$$k_a h = \alpha^{1/2} \frac{1 - 0.428868\alpha + 0.093928\alpha^2 - 0.002694\alpha^3}{1 - 0.595534\alpha + 0.162628\alpha^2 - 0.014975\alpha^3}$$ This yields extreme sub-surface accuracy ($-0.0002%$ to$+0.000006%$ ), but suffers catastrophic divergence if pushed past$h/L_0 > 0.159$ .
As depth increases towards infinity,
-
Nielsen's 3rd Solution (Niel3):
$k_a h = \alpha {1 + 2\exp(-2\alpha)}$ . This effectively models the deep-water limit, maintaining an error of$-0.55%$ down to$h/L_0 \ge 0.300$ , but diverges into immense errors in shallow water. -
Wu and Thornton 2nd Solution (WT2): Integrates nested exponentials to force the curve to hug the transitional depths slightly closer to shore:
$k_a h = \alpha {1 + 2t(1+t)}$ , utilizing the dynamic variable$t = \exp{-2\alpha(1 + 1.26e^{-1.84\alpha})}$ . This restricts error to$\pm 0.025%$ for conditions where$h/L_0 \ge 0.195$ .
Algorithmic Warning: Modeling systems frequently attempt to merge a shallow formulation (like WT1) with a deep formulation (like WT2) via a piecewise conditional logic switch at a specific depth boundary (e.g.,
Recent theoretical advancements documented in the repository eschew the derivation of progressively complex polynomial expressions in favor of an elegant hybrid approach known as the "seed-and-step" method.
Serdar Beji established a highly accurate modification of Eckart's foundational equation. By proving that Eckart's basic square-root geometry fundamentally lacked the degrees of freedom necessary to mimic intermediate depth transitions, Beji injected a sophisticated empirical exponential correction function:
Through rigorous least-squares curve fitting across the operational domain, Beji determined the optimum constants to constrain the absolute maximum relative error to
Almost immediately following Beji's publication, researchers Vatankhah and Aghashariatmadari applied advanced geometric curve-fitting algorithms directly to Beji’s core exponential expression. By optimizing the exponent constants, they drove the maximum absolute error down to
- Single-Step Explicit Formula #1: This formulation directly refines Beji's exponent terms to smoothly approximate the intermediate depth transition.
This streamlined geometric equation strictly bounds the maximum relative error to
- Single-Step Explicit Formula #2: For scenarios demanding even tighter topological constraints, they split the approximation into a two-part expansion, introducing a sophisticated, high-order exponential corrective growth term:
This advanced split-form configuration aggressively suppresses the maximum relative error down to an exceptional
The pinnacle of contemporary optimization was realized by Simarro and Orfila. They postulated that pursuing mathematically convoluted explicit analytical formulas (such as Carvalho's triple-nested hyperbolic roots or Hunt's massive 9th-order fractions) to achieve near-exact accuracy was fundamentally inefficient.
Instead, they utilized Beji's robust
This singular mathematical maneuver plunges the relative error down to an astonishing
The standard Airy dispersion relation simulated in wave-disp-equation.py ($\omega^2 = gk \tanh(kh)$) defines the fundamental kinematic matrix.
However, highly complex ocean waves phenomena force crucial theoretical extensions to this core relationship, which modelers must integrate.
When wave trains propagate across an underlying mean fluid current characterized by a depth-averaged velocity vector
Where
At microscopic spatial domains (specifically wavelengths
Where
The Airy wave framework is strictly a first-order linearized analytical solution, fundamentally assuming that wave steepness (
This equation establishes the phenomenon of "amplitude dispersion." It mathematically proves that large-amplitude crests propagate tangibly faster than small-amplitude waves sharing the identical frequency. This
When evaluating stratified, multi-layered fluid bodies (such as a buoyant freshwater estuarine plume sliding over dense saline oceanic water), internal waves propagate silently along the subsurface pycnocline.
For two semi-infinite homogeneous layers with lower density
Because the physical density variation across the interface is extremely small (fractional percentages), the effective restoring force (reduced gravity) is weak. Consequently, internal waves propagate at a fraction of the speed of surface waves but can attain colossal vertical amplitudes spanning hundreds of meters.
The extraction of the wavenumber from the dispersion equation is not merely an exercise in theoretical math; the value of
To understand the immense physical weight of this mathematical inversion, one must recognize that every kinematic and dynamic property of a surface gravity wave is fundamentally downstream of the wavenumber
Furthermore,
Any fractional error introduced during the numerical estimation of
The extensive algorithmic landscape detailed within wave-disp-equation.py—from Eckart's elementary 1951 asymptotic bridge to the highly refined 2025 half-integer fractional Padé approximants by Carvalho—illustrates an evolutionary continuum of mathematical performance engineering. This evolution mirrors the historical progression of computational hardware: from the slide rules of the 1950s requiring simple algebraic bridges, to the single-core microprocessors of the 1990s optimizing minimax polynomials, and ultimately to the massively parallel Tensor and GPU architectures of the 2020s demanding strictly divergence-free, non-iterative logic.
By benchmarking these algorithms against a strict Newton-Raphson baseline, several distinct operational paradigms emerge for the modern oceanographer:
-
For pedagogical clarity or rapid generalized analysis, the purely algebraic Guo or Carv14 explicit formulations provide excellent computational velocity with minimal coding complexity.
-
The Guo (2002) formula relies entirely on standard exponential decay, evaluating millions of arrays in mere fractions of a second (approx. 0.73 seconds per million operations) while globally constraining its error to a remarkably symmetrical
$\pm 0.75%$ . -
YN4 Solution mathematically bypasses transcendentals (like
tanhorexp) entirely, operating strictly on algebraic fractions and roots to achieve a maximum relative error of 3.177%. These are ideal for legacy systems, lightweight embedded wave buoys, or rapid prototyping where hardware ALUs execute simple roots faster than complex hyperbolic geometry. -
For heavily constrained processing environments where iterative divergence poses a catastrophic failure risk, the Yamaguchi & Nonaka modifications or the robust Hunt Padé arrays guarantee strict topological bounds without requiring conditional looping logic.
-
In massively parallel GPU computing (CUDA/OpenCL), traditional iterative
whileloops cause severe "warp divergence"—where some threads finish early while others stall, bottlenecking the entire array. -
Hunt's 9th Order Approximant (Hunt2) circumvents this by utilizing a massive 9th-degree polynomial ratio. Executed via Horner's method, it compresses maximum error to an exceptionally tight margin of just
$0.00815%$ , utilizing only primitive multiplication and addition. -
Similarly, the Carvalho (2025) Fractional Padé Approximants completely rewrite the underlying polynomial basis vectors using half-integer powers (e.g.,
$\alpha^{0.5}, \alpha^{1.5}$ ). Formulas like Pade(2025)_8 and Pade(2025)_11 push the maximum relative error to absolute$0.0000000%$ (matching double-precision numeric exactness) without a single conditional check, offering a true 1:1 replacement for iterative solvers on tensor cores. -
For modern, state-of-the-art predictive ocean waves modeling requiring supreme accuracy, the hybridization of an empirically exact seed (such as the Beji equation or the Carvalho initial guess) inextricably linked to a deterministic, single-step Newton-Raphson update yields sub-machine-epsilon accuracy (
$< 10^{-7}%$ ), entirely eradicating wavenumber-induced phase lag over multi-decadal simulation timelines. -
This paradigm perfectly leverages Carvalho's 2006 Gene Expression Programming (GEP) derived seed, which elegantly maps the asymptotic limits to provide a geometrically perfect starting position:
- This is the computational "Holy Grail" realized by Simarro and Orfila (2013). By evaluating highly accurate explicit formulations not as an endpoint, but exclusively as a pre-calculated starting position (
$\beta_{\text{seed}}$ ), they place the algorithm so close to the true root that exactly one rigid Newton step drops the error down to an astonishing$0.0000082%$ .
-
Because ocean wave models (like SWAN, WaveWatch III, or Boussinesq phase-resolving grids) integrate phase celerity over millions of time-steps, even a
$0.1%$ error in$k$ accumulates into massive, non-physical phase shifts, completely destroying wave interference patterns and refraction corridors. This hybrid "seed-and-step" topology guarantees analytical exactness while retaining the vectorized speed necessary for global forecasting.
Through this suite of algorithms, hydrodynamical researchers are comprehensively equipped to balance processing execution latency against the uncompromising demands of numerical precision, ensuring robust wave phase and group celerity integration across every conceivable spectral forecasting environment. Whether modeling short-crested capillary chop in a coastal flume or resolving deep-ocean rogue wave non-linearities, the wave-disp-equation.py repository provides the exact mathematical key to unlocking the dispersion relation.
| Model Name | Equation Format | MaxErr |
|---|---|---|
| Pade(2025)_8 | High-order fractional Padé polynomial | |
| Pade(2025)_11 | High-order fractional Padé polynomial | |
| Simarro&Orfila(2013) | ||
| Vatankhah(2013)_1 | Split-form exponential corrective growth | |
| Pade(2025)_3 | ||
| Hunt(1979)_9 | ||
| Vatankhah(2013)_2 | ||
| Wu&Thornton(1986) | Piecewise shallow/deep bounds | |
| Beji(2013) | ||
| Carvalho(2025)_4 | Deep continuous fraction | |
| Carvalho(2025)_5 | ||
| Hunt(1979)_5 | ||
| Pade(2025)_2 | ||
| Carvalho(2025)_9 | ||
| Carvalho(2025)_10 (Seed) | ||
| Nielsen(1982) | Piecewise Taylor series / exponential | |
| You(2002) | Piecewise Taylor series / exponential | |
| Pade(2025)_1 | ||
| Yamaguchi(2007)_2 (YN2) | Nested FM substitution |
|
| Guo(2002) | ||
| Carvalho(2025)_18 | ||
| Yamaguchi(2007)_1 (YN1) | ||
| Fenton&McKee(1990)_2 | ||
| Iwagaki(2007) | ||
| Yamaguchi(2007)_4 | ||
| Eckart(1951) |
This glossary lists physical variables, mathematical parameters, algorithmic concepts, and theoretical terms used in this document.
-
$x$ : The primary horizontal spatial coordinate. It defines the geographic direction of progressive wave propagation across the fluid domain. -
$z$ : The vertical spatial coordinate. It is constrained by the flat impermeable seabed at the bottom and the moving fluid free-surface at the top, with the origin ($z = 0$ ) strictly locked to the mean water level. -
$t$ : The temporal parameter (time). It is essential for evaluating the unsteady, transient kinematics of surface gravity waves and computing angular frequencies. -
$h$ : The bathymetric water depth. It represents the absolute vertical distance from the mean water level ($z = 0$ ) to the solid seabed ($z = -h$ ). It is typically acquired via physical hydrographic surveys and dictates the precise depth-regime of the wave. -
$\eta(x,t)$ : The free-surface elevation. It represents the instantaneous vertical displacement of the fluid boundary. For a monochromatic harmonic wave, it is defined mathematically as$\eta(x,t) = a \cos(kx - \omega t)$ . -
$a$ : The wave amplitude. It defines the maximum vertical elevation of the wave crest above the mean water level. Under linear Airy theory, it is assumed to be infinitesimally small compared to the wavelength and depth. -
$T$ : The wave period. It measures the time required for one complete wave cycle to pass a stationary reference point. It is typically empirical, gathered via offshore wave buoys or global spectral wind-wave models. -
$\lambda$ (or$L$ ): The physical wavelength. It is the spatial distance between two consecutive wave crests. -
$L_0$ : The deep-water wavelength. Defined exclusively by the wave period and gravity as$L_0 = gT^2/2\pi$ , representing the unshoaled length of a wave in the open ocean. -
$g$ : The constant of gravitational acceleration. It acts as the primary downward hydrostatic restoring force that propagates surface gravity waves. -
$\rho$ : The primary fluid density (typically seawater). It is assumed to be constant under the Navier-Stokes incompressibility constraint. -
$\rho'$ : The density of a secondary, usually lighter, fluid layer (e.g., a buoyant freshwater estuarine plume). The density gradient between$\rho$ and$\rho'$ drives the propagation of internal interfacial waves. -
$\gamma$ (or$\sigma_t$ ): Fluid surface tension. A cohesive microscopic force that supersedes gravity at wavelengths shorter than 0.07 meters, altering the dispersion relation for capillary waves.
-
$\Phi(x, z, t)$ : The scalar velocity potential. Enabled by the assumption of irrotational flow, it is a single mathematical scalar field whose gradient yields the entire fluid velocity vector. -
$\mathbf{u} = (u, w)$ : The two-dimensional fluid velocity vector. It is composed of the horizontal velocity component$u$ and the vertical velocity component$w$ , calculated as$\mathbf{u} = \nabla \Phi$ . -
$k$ : The angular wavenumber. Mathematically defined as$k = 2\pi/\lambda$ , it is the spatial frequency parameter that must be solved for. It completely dictates all downstream dynamics, including wave energy density, momentum flux, and refraction coefficients. -
$k_0$ : The deep-water angular wavenumber. Defined explicitly as$k_0 = \omega^2/g$ , it represents the wavenumber strictly in the asymptotic deep-water limit. -
$\omega$ : The absolute angular frequency. Defined as$\omega = 2\pi/T$ , it is the temporal driving parameter of the wave system observed from a stationary geographic frame. -
$c_p$ : The phase velocity or celerity. Calculated as$c_p = \omega/k$ , it is the speed at which the physical shape of the wave (the crest) propagates through the domain. -
$c_g$ : The group velocity. Calculated as the derivative$c_g = \partial\omega/\partial k$ , it is the physical speed at which wave energy and macroscopic wave packages travel across the ocean surface. -
$\mathbf{V}$ : The depth-averaged velocity vector of an ambient mean fluid current. It is required to compute Galilean transformations in wave-current interaction fields. -
$\sigma$ : The intrinsic relative frequency. It represents the Doppler-shifted wave frequency observed by an entity floating along with the underlying mean fluid current$\mathbf{V}$ . -
$E$ : Wave energy density. Calculated as$E = \frac{1}{2}\rho g a^2$ , it dictates the raw kinetic and potential energy carried by the wave.
-
$\alpha$ : The independent dimensionless deep-water parameter. It is defined strictly as$\alpha = k_0h$ and serves as the primary standardized input argument for every explicit algorithm in the repository. -
$\beta$ : The dependent dimensionless local wavenumber. It is defined as$\beta = kh$ and represents the target output variable that algorithms map from$\alpha$ . -
$\beta_n, \beta_{n+1}$ : Iterative states. They represent the current ($\beta_n$ ) and subsequently updated ($\beta_{n+1}$ ) estimations of the root during a Newton-Raphson loop. -
$\beta_0$ (or$\beta_{\text{seed}}$ ): The initial algorithmic guess. It is the starting position provided to the Newton-Raphson solver to bypass geometric instability. -
$\beta_{\text{Beji}}$ : A specific, highly accurate explicit estimate calculated using the Beji (2013) formula, utilized purely as the$\beta_0$ seed for the Simarro and Orfila single-step update. -
$m$ : A tunable generalized exponent. Extensively utilized in minimax error optimizations by Fenton & MacKee ($m=1.5$ ), Yamaguchi & Nonaka ($m=1.485$ ), and Guo ($m=2.4901$ ) to tighten algebraic curves across transitional depths. -
$\beta_F$ : A temporary nested variable utilized exclusively in the Yamaguchi and Nonaka (YN2) modification to simulate a quasi-Newton corrective step. -
$d_n$ ($d_1$ through$d_9$ ): Precisely tuned analytical coefficients utilized within Hunt's 9th Order Padé denominator polynomial expansion. -
$N_3(\alpha), D_3(\alpha)$ : The distinct fractional polynomial numerator and denominator arrays formulated in Carvalho's 2025 Padé functions.
-
Linear Wave Theory (Airy Theory): The fundamental mathematical framework describing wave propagation over a fluid layer. It relies on linearizing boundary conditions by assuming infinitesimal wave steepness (
$ak \ll 1$ ). -
Laplace Equation (
$\nabla^2 \Phi = 0$ ): The core linear elliptic partial differential equation derived from mass conservation (incompressibility) that the velocity potential must satisfy globally. -
Irrotational Flow (
$\nabla \times \mathbf{u} = 0$ ): A simplifying fluid dynamic assumption asserting the absence of macroscopic vorticity within the water column, allowing velocity to be mapped from a scalar potential. - Kinematic Bed/Free-Surface Boundary Conditions: Strict bounding rules. The bed condition dictates zero vertical fluid penetration at the seabed, while the free-surface condition dictates that a particle on the surface must track with the surface's movement.
- Dynamic Free-Surface Boundary Condition: A pressure constraint applying the unsteady Bernoulli equation to ensure fluid surface pressure precisely matches atmospheric pressure.
-
Transcendental Equation: An equation (like
$\alpha = \beta \tanh \beta$ ) that cannot be resolved for a specific variable using standard inverse algebra, because the variable acts both as a linear multiplier and the argument of a non-algebraic function. -
Deep Water Limit (
$\alpha \rightarrow \infty$ ): The physical asymptotic boundary where depth greatly exceeds wavelength, causing$\tanh \beta \rightarrow 1$ . Waves become purely dispersive, and speed is completely independent of depth. -
Shallow Water Limit (
$\alpha \rightarrow 0$ ): The physical asymptotic boundary where waves drag heavily on the seabed, causing$\tanh \beta \rightarrow \beta$ . Waves become completely non-dispersive, and speed is strictly dependent on depth ($c_p = \sqrt{gh}$ ). -
Amplitude Dispersion: A third-order non-linear phenomenon where phase celerity becomes dependent on wave steepness via a
$[1 + (ka)^2]$ multiplier, causing large crests to travel faster than small ones. - Benjamin-Feir Modulational Instability: A direct chaotic consequence of amplitude dispersion driving nonlinear wave-wave interactions, precipitating extreme open-ocean rogue waves.
- Hydrodynamic Doppler Shifting: The Galilean phase shift observed when wave trains propagate across a moving background current, compressing or expanding the intrinsic frequency.
- Wave Blocking: A catastrophic energy accumulation event occurring when an adverse fluid current flows at a velocity strong enough to physically prevent the forward propagation of wave energy.
- Pycnocline: A subsurface density interface separating distinct fluid layers, across which internal waves slowly propagate with colossal vertical amplitudes.
- Newton-Raphson Implementation: A standard iterative root-finding numerical method utilized to converge upon double-precision "mathematical truth" by advancing via tangent line projections.
-
Residual Function ($f(\beta)$): The objective equation rearranged to equal zero. In this module, it is defined as
$f(\beta) = \alpha - \beta \tanh \beta$ . -
Jacobian ($f'(\beta)$): The analytical first derivative of the residual function with respect to
$\beta$ , used as the denominator in the Newton-Raphson step. -
Stability Topography & Inflection Point: A geometric hazard in the residual function occurring specifically at
$\beta \approx 1.200$ (where$f''(\beta) = 0$ ). Tangent slopes here become momentarily flat, throwing subsequent estimates into divergence. -
Asymptotic Matching: An advanced mathematical technique used to engineer formulas that flawlessly decay into the exact theoretical boundaries of both the shallow water limit (
$\sqrt{\alpha}$ ) and deep water limit ($\alpha$ ). - Gene Expression Programming (GEP): A high-performance evolutionary artificial intelligence algorithm utilizing linear chromosomes and branched expression trees to discover highly complex, non-intuitive algebraic relationships.
- Padé Approximant: A highly robust rational function built from the ratio of two separate polynomials. It is mathematically superior to Taylor expansions for simulating poles, asymptotes, and hyperbolic tangent saturation geometries.
- Minimax Error Optimization: A computational curve-fitting strategy designed to equally balance and minimize the absolute maximum positive and negative relative errors across a formula's domain.
- Seed-and-Step Paradigm: A contemporary optimization topology. It evaluates a highly accurate explicit formulation to place the algorithmic state geometrically close to the root, followed by exactly one deterministic Newton update to achieve sub-machine-epsilon precision without looping.
-
Warp Divergence: A severe computational thread-stalling penalty occurring on highly parallelized GPU tensor architectures (CUDA/OpenCL) caused by evaluating iterative conditional logic (like
whileloops). - Piecewise Conditional Logic: The practice of splitting the domain into multiple formulas (e.g., one for shallow, one for deep). It introduces dangerous mathematical discontinuities ("jumps") at the boundary that corrupt phase speed grids.
- Maclaurin Series Expansion: A specific mathematical Taylor series expansion centered at zero, leveraged primarily to derive restricted-domain approximations for the nearshore shallow water zone.
- Wikipedia. "Airy wave theory". Wikipedia.
- Wikipedia. "Dispersion (water waves)". Wikipedia.
- Yu, J. (2014). "A Note on Approximations of the Dispersion Relationship of Water Waves", Journal of Engineering Mechanics (ASCE), 140(1), 233–237.
- Simarro, G. & Orfila, A. (2013). "Improved explicit approximation of linear dispersion relationship for gravity waves: Another discussion", Coastal Engineering, 80, 15–16.
- Vatankhah, A.R. & Aghashariatmadari, Z. (2013). "Improved explicit approximation of linear dispersion relationship for gravity waves: a discussion", Coastal Engineering, 78, 21–22.
- Beji, S. (2013). "Improved explicit approximation of linear dispersion relationship for gravity waves", Coastal Engineering, 73, 11–12.
- You, Z.J. (2008). "A close approximation of wave dispersion relation for direct calculations", Applied Ocean Research, 30(2), 141–143.
- Yamaguchi, M. & Nonaka, H. (2007). "Comparative Study of Explicit Solutions to Wave Dispersion Equation", Journal of JSCE (Ocean Engineering), 63(1), 53–66.
- Yamaguchi, M. and H. Nonaka. Comparative study of explicit solutions to wave dispersion equation, Annu. Jour. Eng., Ehime Univ., Vol. 6, 2007 in CD-ROM.
- Carvalho, R. (2006). Unpublished work based on gene expression programming for wave dispersion equations.
- You, Z.J. "Discussion of 'Simple and explicit solution to the wave dispersion equation'", Coastal Engineering 45 (2002) 71-74, Coastal Eng., Vol. 48, pp. 133-135, 2003.
- Guo, J. (2002). "Simple and explicit solution of the wave dispersion equation", Coastal Engineering, 45, 71–74.
- Fenton, J.D. & McKee, W.D. (1990). "On calculating the lengths of water waves", Coastal Engineering, 14, 499–513.
- Fenton, J.D. "The numerical solution of steady water wave problems", Computers & Geosciences, Vol. 4, No. 3, pp. 357–368, 1988.
- Fenton, J.D. (1972). "A ninth-order solution for the solitary wave", Journal of Fluid Mechanics, 53, 257–271.
- Wu, C. S. and E. B. Thornton. "Wave numbers of linear progressive waves", Journal of Waterway, Port, Coastal and Ocean Engineering, ASCE, Vol. 112, No. 4, pp. 536–540, 1986.
- Nielsen, P. "Explicit solutions to practical wave problems", Proc. 19th ICCE, Vol. 1, pp. 968–982, 1984.
- Nielsen, P. "Explicit formulae for practical wave calculations", Coastal Eng., No. 6, pp. 389–398, 1982.
- Hunt, J.N. (1979). "A simple approximation for the dispersion relation of water waves", Journal of Waterway, Port, Coastal and Ocean Engineering, 105(4), 457–459.
- Hunt, J. N. "Direct solution of wave dispersion equation", J. Waterway, Port, Coastal and Ocean Div., Proc. ASCE, Vol. 105, No. WW4, pp. 457–459, 1979.
- Eckart, C. (1951). "The propagation of gravity waves from deep to shallow water", U.S. Department of Commerce, National Bureau of Standards Circular 521.
These references span classical methods (e.g., Eckart, 1951; Hunt, 1979), modern explicit approximations (e.g., Guo, 2002; Beji, 2013; Vatankhah & Aghashariatmadari, 2013; Simarro & Orfila, 2013; Yu, 2014), pivotal contributions from Fenton and colleagues (Fenton & McKee, 1990; Fenton, 1972), and innovative computational approaches (Carvalho, 2006 & 2025) to improve the dispersion relation accuracy.