Numerical methods
GeoStack · lens 2 of 5 · 1 December 2026
Abstract¶
A curriculum in three parts and thirty chapters, read as primitives, then the forward model, then the forward model run backwards. Its starting point is Xin-She Yang’s Mathematical Modelling for Earth Sciences, resplit for this stack: inverse problems become a part of their own, random fields join the foundations, and discretisation splits into the equation, geometry, space, other coordinates, time, stepping, and solve-and-verify. The applications have their own page.
I · Foundations
Calculus, autodiffchanges of variablesjax · functaxdiffops · geometry
Linear algebragaussxlineax (inh.)
Approximationfunctaxkernellib
Quadraturefunctaxintegrix
TransformsfunctaxChebyshev, SHT
Probabilitypyrox-gaussgaussx
Random fieldsover space, time, parameters, featureskernellib · pyrox-gp · pyrox-lgm
II · Discretisation
A · The equation
Equations and termsadvection, diffusion, waves, sourcesgridax operators · geophysix
Variables, scales, constraintsunits, positivity, balance, change of variablesgeophysix EOS · gauss_flows warping
B · Geometry
Points, structurelevels and groupsGeoPoints · GeoSwathgraphs · gridax
Fieldswhere values livegridax C, A gridstangent bases
C · Space
Finite diff.point valuesgridax Difference
Finite volumescell averages, fluxesgridax.schemes
Spectralmodesspectraldiffx
FEweak formno home
Particlesmoving points, Lagrangiantracerax
D · Other coordinates
Spectral, angular, sizewavelength , direction , particle sizeradtrax tables · radiomax responseangle and size: no home
E · Time
Samplingevents, calendarspyrox_xtremeTemporalPatcher
Frequencycycles, spectra, aliasingCyclicEncoderspectra: no home
F · Stepping
Steppersstability, CFLintegrix.marchdiffrax (inh.)
SplittingIMEX, split-explicitintegrix.march
Stochastic steppingdiffrax SDEs (inh.) · gaussx linear SDEs
G · Solve and verify
Elliptic solvesgaussx: algorithmgridax: operatorspectraldiffx: FFT
Verificationsympysympy2jax · test
III · Inverse problems
A · Tools
Optimisationargminaxoptimistix (inh.)
Adjointsintegrix.adjointdiffrax · vardax
B · The state
Variational DAvardax
Sequential DAfilteraxpyrox-ssm
C · The parameters
Forward UQpropagate, sensitivityintegrix.expectkernellib hsic
Calibrationinvert for argminax · pyroxgauss_flows
P marks a chapter with a probabilistic-numerics counterpart, after Hennig, Osborne and Kersting. Read top to bottom, the parts are the layers: foundations in mathax and the fit shelf, discretisation in GeoNumerics with integrix for time, inverse problems in inferax and pyrox. Letters mark the sub-parts.
Each chapter below gets a sentence, its key equation and where it lives in the stack. The full equations, the code and the proposal for every gap are in the doc GeoStack numerical methods.
I · Foundations¶
The operations every later chapter calls: differentiate and change variables, solve, approximate, integrate, transform, and describe uncertainty, each with one library that does it. After Part I no later chapter needs a new primitive.
1 · Calculus, autodiff, changes of variables¶
The Jacobian of a change of variables, used for derivatives, integrals, densities and vectors, and applied by JVP and VJP without forming it.
where maps the reference domain onto and is its Jacobian. The same factor turns up in a density, a flux and a vector’s components.
In the stack: jax, functax. Shelf: describe.
2 · Linear algebra¶
Solves and log-determinants from matrix–vector products and operator tags, never a grid.
where the -th Krylov iterate for , with , needs only the products ; a tag such as symmetric or banded picks the method.
In the stack: gaussx, lineax. P Probabilistic counterpart: BayesCG, proposed. Shelf: describe.
3 · Approximation, interpolation¶
A function from finite data: a basis, an interpolant or a kernel.
where the basis functions are fixed and the coefficients are chosen to match the data at the points .
In the stack: functax, kernellib. P Probabilistic counterpart: GP interpolation, today. Shelf: describe.
4 · Quadrature¶
An integral as a weighted sum; on a mapped domain each weight takes the Jacobian factor of chapter 1.
where the nodes and weights belong to a rule on the reference domain.
In the stack: functax, integrix. P Probabilistic counterpart: Bayesian quadrature, proposed. Shelf: describe.
5 · Transforms¶
Coefficients in a global basis: Chebyshev, spherical harmonics, wavelets, the non-uniform FFT.
where the are orthonormal over the whole domain, so each coefficient is one projection, and a fast transform computes all of them at once.
In the stack: functax. Shelf: describe.
6 · Probability¶
Densities on linear operators, and how a density changes with its variables.
where is invertible and maps to : chapter 1’s factor, now on a density.
In the stack: pyrox-gauss, gauss_flows. Shelf: fit.
7 · Random fields, covariance modelling¶
A random function over any index set: space, time, the sphere, graphs, parameters, features.
where is the mean function and the kernel the covariance between any two indices and .
In the stack: kernellib, pyrox-gp, pyrox-lgm. Shelf: fit.
II · Discretisation¶
Build the forward model: turn continuous physics into a finite computation that is stable, converges, and conserves what the physics conserves. The equation and its variables decide the method; space, the other coordinates (spectral, angle, size) and time are discretised separately (the method of lines); a solve and a check close the part.
A · The equation¶
What is being solved, before any grid: the terms of the equation and the variables they are written in.
8 · Equations and terms¶
Advection, diffusion, waves and sources, and the boundary conditions each needs.
where a concentration is carried by the velocity (m s⁻¹), spread by the diffusivity (m² s⁻¹) and fed by the source ; each term asks for its own boundary condition.
In the stack: gridax, geophysix. Shelf: physics.
9 · Variables, scales, constraints¶
Scales that say which terms matter, the choice of variables, and the constraints a scheme keeps.
where and are a typical speed and length: a Péclet number far above one says advection dominates chapter 8’s equation and diffusion can be dropped or parameterised.
In the stack: geophysix. Gap: units and dimensional analysis. Shelf: physics.
B · Geometry¶
Where the unknowns live: points, cells or a grid, and what sits on each.
10 · Points, structure, groups¶
Points, meshes and structured grids, how much each says about neighbours, and how places are grouped.
where the tiles partition the domain; points know no neighbours, a mesh lists them, and a structured grid computes them from an index.
In the stack: geoarray, kernellib, gridax. Gap: the mesh level, curvilinear metrics, vertical coordinates. Shelf: physics.
11 · Fields on a geometry¶
What lives on nodes, edges, faces and cells, and why grids are staggered.
where the velocity components and sit on the cell faces and the divergence at the centre: on a staggered (C) grid each difference spans one cell, not two.
In the stack: gridax, functax. Gap: field locations on a mesh. Shelf: physics.
C · Space¶
Four ways to turn a spatial derivative into arithmetic, and one with moving points, ordered by what the unknown is.
12 · Finite differences¶
Point values and stencils from Taylor series; needs a structured grid, or points for meshfree stencils.
where on points spaced apart.
In the stack: gridax. P Probabilistic counterpart: probabilistic stencils, proposed. Shelf: physics.
13 · Finite volumes¶
Cell averages and face fluxes, conservative by construction; needs cells.
where is the average over cell , and the flux through face of area ; what leaves one cell enters its neighbour, so the total is conserved exactly.
In the stack: gridax. Shelf: physics.
14 · Spectral methods¶
Mode coefficients, so a derivative is a multiplication; needs a uniform or a special grid.
where is the Fourier transform and the wavenumber; on a uniform periodic grid the FFT gives every mode at once.
In the stack: spectraldiffx. Shelf: physics.
15 · Finite elements¶
The weak form on a mesh.
where and are written in the same local basis on the mesh, so the integral becomes a sparse system for the coefficients.
In the stack: no library yet, which is why the figure marks it ① and dashes its box.
16 · Particles¶
Moving points, with a random walk for diffusion; needs points only.
where particle is moved by the velocity of chapter 8 and a Brownian increment that stands in for the diffusion.
In the stack: tracerax. Shelf: physics.
D · Other coordinates¶
A field is also indexed by wavelength, angle and particle size, and those axes are discretised by quadrature.
17 · Spectral, angular, size¶
Quadrature and changes of variable along wavelength, angle and particle size.
where a band of an instrument sees the radiance through its spectral response , and the integral is a quadrature on a fine wavelength grid .
In the stack: radtrax, radiomax. Gap: correlated-k, scattering, size. Shelf: physics.
E · Time¶
Time as an index set: how it is sampled and grouped, and what cycles it carries.
18 · Sampling, calendars, windows¶
Events, regular steps and calendars, blocks and windows, and time’s arrow.
where the blocks cut the record without overlap, as a calendar year does for a block maximum; windows may overlap.
In the stack: pyrox-xtreme, pyrox-ssm, geopatcher. Shelf: describe.
19 · Frequency¶
Cycles, spectra and aliasing on the time axis.
where a series sampled every cannot tell an angular frequency above from one below it: a daily cycle sampled once a day aliases to zero.
In the stack: geonnax, pyrox-ssm. Gap: spectral and tidal analysis, climatology. Shelf: describe.
F · Stepping¶
Advancing the discretised system through time without leaving the stability limit.
20 · Steppers and stability¶
Advancing in time within a stability limit.
where is the scheme’s amplification factor, so the time step is limited by the fastest mode.
In the stack: integrix.march. P Probabilistic counterpart: ODE filter, proposed (its pieces exist). Shelf: describe.
21 · Splitting, multirate, semi-Lagrangian¶
Different speeds, different steps: IMEX, split-explicit, semi-Lagrangian.
where the slow part is stepped explicitly and the fast, stiff part implicitly, so the fast part no longer sets the step.
In the stack: integrix.march. Shelf: describe.
22 · Stochastic stepping¶
Steps with a random increment; the bridge to Part III’s filters.
where scales the Brownian increment (Euler–Maruyama).
In the stack: gaussx, diffrax. Shelf: describe.
G · Solve and verify¶
The linear systems the discretisation produces, and the checks that it converges to the right answer.
23 · Elliptic and implicit solves¶
The operator the discretisation produces, and the structure a solver uses.
where the streamfunction is recovered from the vorticity at every step of a quasi-geostrophic model: once discretised, a large sparse system whose structure (banded, periodic, separable) picks the solver.
In the stack: gaussx, gridax, spectraldiffx. Shelf: physics.
24 · Verification¶
Observed order, conservation and manufactured solutions.
where is the error against an exact or manufactured solution on a grid of spacing ; a second-order scheme should give 2.
In the stack: sympy, sympy2jax. A test dependency, not a shelf.
III · Inverse problems¶
Run the forward model backwards: from observations to the state and the parameters, with their uncertainty. The tools come first, then what is unknown; the parameters are propagated forward before they are inverted for. This part stops at classical estimation; learning is the scientific-ML lens.
A · Tools¶
The two tools every inversion uses: a minimiser, and the gradient that feeds it.
25 · Optimisation¶
Minimisers, Gauss–Newton, and the Laplace posterior at a minimum.
where is the negative log posterior and .
In the stack: argminax, optimistix. P Probabilistic counterpart: the Laplace posterior, today; Bayesian optimisation, proposed. Shelf: fit.
26 · Adjoints, calculus of variations¶
Gradients by running the model backwards, with checkpointing and implicit differentiation.
where is the model linearised at step : the gradient costs one backward run, whatever is.
In the stack: integrix.adjoint, pipekit-cycle. Shelf: fit.
B · The state¶
Estimating the state, all at once over a window or step by step.
27 · Variational DA¶
The state as the minimiser of a cost: OI, 3D-Var, 4D-Var.
where the sum runs over the observation times in the window, and are the background mean and covariance; 3D-Var is the case of a single observation time, with no model run.
In the stack: vardax. Shelf: fit.
28 · Sequential DA¶
The state step by step: Kalman and ensemble filters.
where the gain weighs the forecast against the observation ; an ensemble filter estimates the two covariances from members.
In the stack: filterax, pyrox-ssm. Shelf: fit.
C · The parameters¶
Propagating the parameters forward, then inverting for them.
29 · Forward UQ, sensitivity¶
Propagate the uncertainty of the parameters through the model and rank which parameters matter.
where is a model output and the share of its variance that parameter explains on its own (the first-order Sobol index).
In the stack: integrix.expect, kernellib. Gap: Sobol indices, polynomial chaos. Shelf: fit.
30 · Calibration¶
Invert for the parameters: point estimates and posteriors.
where are the model’s parameters and the observations; chapter 25 finds its mode, a sampler or a flow its shape.
In the stack: argminax, pyrox, gauss_flows. Shelf: fit.
What the structure settles¶
Optimisation belongs in inferax. With an inverse-problems part, argminax and optimistix sit beside data assimilation and calibration, where a reader of this lens looks for them.
Random fields, not spatial statistics. Geostatistics is the spatial case (variograms, kriging), but the same object, a random function with a covariance, indexes time (state-space GPs), the sphere and graphs, parameters (emulators) and learned features. Naming the chapter by the object keeps one chapter for all of them, and is why the fit shelf appears in this lens as well as in scientific ML.
Time gets as much room as space. Steppers, splitting and stochastic stepping are three chapters, and integrix already has a name for each: SSP and multistep schemes, IMEX and split-explicit, semi-Lagrangian. Only nonlinear SDE stepping is inherited from diffrax.
The quantity gets its own chapters. Space and time are only two of a field’s index sets, and its values have structure of their own: chapter 9 is the values (scales, variables, constraints), chapter 17 the other coordinates (spectral, angle, size), chapter 29 the parameters as a coordinate. Spectral and the quantity matter today, since the remote-sensing app runs on the spectral axis; angle and size arrive with scattering.
Solvers split at the grid. A solver that needs only matrix–vector products and operator tags is linear algebra (chapter 2, gaussx); one that needs the grid or the boundary conditions belongs to the discretisation (chapter 23, gridax and spectraldiffx), which hands its operators to gaussx. The duplicate multigrid and capacitance solvers break this rule: the algorithm belongs in gaussx, and gridax should keep only the hierarchy it builds.
Space is ordered by the unknown. Point values (finite differences), cell averages (finite volumes, which are discontinuous Galerkin of order zero), mode or basis coefficients (spectral, finite elements), moving points (particles). FD and FV share stencils on a uniform grid at second order, which is why they are often taught as one, but FV is the conservative, integral form. gridax is mostly FV that looks like FD, as C-grid ocean models are.
Analytic solutions are verification. sympy’s exact and manufactured solutions exist to check a discretisation, so they close Part II instead of sitting in the foundations.
Structure decides the method. Each method in space needs a minimum structure: kernels, meshfree stencils and particles need only points; finite volumes and finite elements need cells; fixed stencils need a structured grid, and the FFT a uniform periodic one. Forgetting structure is free; adding it is regridding, and costs error. Time has the same levels, plus an arrow (chapter 18).
Probabilistic numerics is a column, not a chapter. Each method marked P is its chapter’s classical method with a prior: the same evaluations, conditioned rather than combined with fixed weights, so the answer carries its own error. Solving (2), integrating (4), differentiating (12), stepping (20) and optimising (25) each get one beside the classical method, and integration and differentiation are one conditioning with a different operator, an integral or a derivative.
The parts are the layers. Foundations are Core, discretisation GeoNumerics, inverse problems inferax and pyrox. The applications that compose them are on their own page.
Where it doesn’t fit¶
[1] Finite elements have no home. meshax as drawn is an unstructured finite-volume cell (ICON, MPAS), not FE. Yang needs FE for elasticity and porous flow; none of your five applications does. Ice-sheet models (ISSM, Elmer/Ice) would. Proposed: Say on the layer map that FE is out of scope, and revisit if a solid-earth or ice model joins GeoModels.
[2] Probabilistic numerics is mostly missing. Of the six chapters with a probabilistic counterpart, two have one today: GP interpolation (pyrox-gp) and the Laplace posterior at a minimum (argminax). ODE filters have every piece in gaussx but nothing that joins them into a solver. Probabilistic linear solvers, Bayesian quadrature, probabilistic finite differences and Bayesian optimisation have no home. Proposed: geostack#353 puts each beside its classical method, with no tier change: BayesCG in gaussx, Bayesian quadrature in integrix.expect, the ODE filter in integrix.march, Bayesian optimisation in argminax, probabilistic stencils in gridax.stencils. Quadrature and finite differences share one conditioning, through gaussx’s
conditional. Probabilistic PDE solvers and the method of lines (probabilistic stencils in space under the ODE filter in time) wait for a model that needs them.
Quadrivium: what a quantity is indexed by¶
The quadrivium, the medieval arts of number, as a mental model for the chapters rather than new names: a quantity alone, then with space, with time, and with both. The trivium half of the same picture, which groups the lenses, is on the hub.
The fork and merge are the dimensional reading: geometry and music each add one axis to arithmetic, and astronomy needs both. Boethius cut it another way, discrete or continuous by at rest or in motion; the two readings agree on geometry and astronomy, and he placed music as number in ratio rather than in time. Frequency (chapter 19) is both readings at once: the tidal constituents are ratios of astronomical periods, which is where music hands over to astronomy.
| Index | Classical | Carrier | Chapters | Example |
|---|---|---|---|---|
| Quantity alone | Arithmetic: number in itself | a plain array, or a DimArray with no georeference | 1 Calculus · 2 Linear algebra · 4 Quadrature · 6 Probability · 9 Variables, scales, constraints | a constant (geophysix), a parameter , an emission rate, a column total |
| × space | Geometry: number at rest in space | GeoArray, GeoSwath; a CField at one time | 7 Random fields over space · 10 Grids · 11–15 space discretisation · 20 Elliptic solves | bathymetry, a methane enhancement map, a steady streamfunction |
| × time | Music: number in time | a time series: GeoPoints, a DimArray with a time dim | 5 Transforms · 7 Random fields over time · 16 the spectral axis, frequency in the literal sense · 17–19 time stepping | tidal constituents (harmonic analysis, music in the literal sense), a flux-tower record, an ENSO index |
| × space × time | Astronomy: number in motion | a CField state that evolves; an xarray cube at L3 and L4 | Part II joined by the method of lines · Part III, 22–27 | an ocean state through an assimilation window; Gauss recovering the orbit of Ceres in 1801, the problem least squares was invented for |
Reading it¶
The examples are datasets, not disciplines. A discipline spans axes: seismology is waves in space and time, stratigraphy reads depth as time. A dataset has one index set, so it sits in one row.
Random fields sit in two rows. Chapter 7 is one object over any index set, so it is geometry over space and music over time; over space and time together it is the prior of data assimilation.
Astronomy is where Part III began. Least squares was invented to fit an orbit to a few observations, the first inverse problem; data assimilation is its descendant.
Sources and status
Shelves as on the Layer Map (geostack PR #331). “Inherited” marks libraries the stack uses but does not contribute to. meshax is a placeholder with no code yet. The curriculum takes X.-S. Yang, Mathematical Modelling for Earth Sciences (Dunedin Academic Press, 2008), as its starting point, with P. Hennig, M. A. Osborne and H. P. Kersting, Probabilistic Numerics (Cambridge University Press, 2022) for its probabilistic counterparts.