Documentation

SWRC/HCC Fitter — User Manual

A complete, hands-on guide to fitting soil water-retention curves (SWRC, θ(h)) and hydraulic-conductivity curves (HCC, K(h)) with 96 retention models, 6 conductivity models, three fit objectives, and bootstrap or likelihood uncertainty. This manual applies to both the web app and the desktop app — the interface is identical.

Teaching a class? See the short, student-friendly classroom guide built around the app's Learner mode (soil presets + manual curve preview).

1Overview

The SWRC/HCC Fitter estimates the two functions that govern unsaturated water flow in soil:

  • Water-retention curve (SWRC), θ(h) — how volumetric water content θ changes with suction (matric head h, shown on the log scale as pF = log₁₀(h in cm)).
  • Hydraulic-conductivity curve (HCC), K(h) — how unsaturated conductivity K drops as the soil dries.

You upload measured points, pick a model, and the app fits the model parameters by global optimisation (differential evolution), then shows the fitted curves, parameters with confidence intervals, goodness-of-fit metrics, and 95 % confidence and prediction intervals. You can fit and compare several models at once.

The app opens in Simple mode — van Genuchten–Mualem (VGM) and its Brunswick version (BW-VGM), which covers most everyday work. Switch to Power user (top of the model pane) for all 96 retention models, every conductivity model and the expert options (§5.2).

96 retention models

8 basic × {uni·bi·tri-modal} × 4 variants (original·Brunswick·PDI·Wang).

6 conductivity models

Mualem, Burdine, Alexander–Skaggs, Childs–Collis-George, plus Gardner exponential & power — with any retention curve.

3 fit objectives

nRMSE, NSE, or Gaussian NLL (which also calibrates the noise σ).

Uncertainty

95 % confidence intervals and 95 % prediction intervals, by bootstrap or by likelihood (NLL) — validated by simulation.

2Get the app — web or desktop

The app is the same in both places, so every step in this manual applies to both.

A · Use it online (nothing to install)

Open PTF.bluerror.com in any modern browser. Your data is processed in a private session and is not stored.

B · Desktop app (Windows)

  1. Download SWRC-HCC-Fitter-setup.exe from the latest release.
  2. Run it and follow the wizard. Everything is included (native Fortran engine + .NET); nothing is downloaded at first launch, and the app works offline. A Linux package (.run) is on the same release page.
  3. Launch SWRC-HCC Fitter from the Start Menu or desktop shortcut.

Web vs desktop differences are cosmetic only: the desktop app runs in its own window and handles file dialogs natively; the web app opens in a browser tab. The fitting engine and every control are identical.

3Data format

The app reads CSV, text, and Excel (.xlsx / .xls) files. You can provide the two branches separately or in one combined file. Columns are auto-detected, and you confirm the mapping in the toolbar.

Option A — two files (retention + conductivity)

A retention file with a suction column and a water-content column, and a conductivity file with a suction column and a conductivity column. Suction can be given as pF (= log₁₀ of cm of head).

RetMeas.csvCondMeas.csv
pF,theta
0.00,0.4294
1.00,0.4054
1.80,0.2669
2.30,0.1738
3.00,0.1001
4.20,0.0690
pF,K
0.50,38.73
1.10,12.44
1.70,0.7181
2.30,0.00922
2.90,8.32e-05
3.20,8.89e-06
  • pF — suction as log₁₀(h/cm). E.g. pF 2 = 100 cm ≈ 10 kPa; pF 4.2 ≈ permanent wilting point.
  • theta — volumetric water content (cm³/cm³), e.g. 0.0–0.5.
  • K — unsaturated conductivity in your own units (e.g. cm/day). Must be positive (it is fitted in log space).

Option B — one combined file, multiple samples

Use a sample_id column plus separate suction columns for each branch. Leave cells blank where a branch has no measurement on that row.

sample_id,pF_theta,theta,pF_K,K
Loam_A,0.00,0.4294,0.50,38.73
Loam_A,1.50,0.3310,1.40,4.467
Loam_A,2.30,0.1738,2.30,0.00922
Sand_B,0.00,0.3790,0.50,290.4
Sand_B,1.50,0.2104,1.40,55.13

A sample may have only retention or only conductivity — whichever branch is present is fitted. If your suction is in kPa or cm, convert to pF with pF = log₁₀(head in cm) (1 kPa ≈ 10.2 cm).

No data of your own? Use a built-in database

The app ships with three public soil hydraulic databases. In the toolbar, open “No data? Try a database”, pick a source and a soil sample, and click Load — the measured retention and conductivity are loaded ready to fit (your own uploads are never touched). You can also download the whole collection as an Excel workbook (one *_SWRC and one *_HCC sheet per source, each with Sample_ID and pF).

  • Hohenbrink et al. (2023) — German database, 569 soils (evaporation method + dewpoint + saturated K).
  • UNSODA 2.0 (Nemes et al., 2001; Leij et al., 1996) — global, 329 soils; independent cross-database test set.
  • EU-HYDI (Weynants et al., 2013) — European Hydropedological Data Inventory, 2243 soils; independent test set.

Please also cite the database(s) you use:

  • Hohenbrink, T., Jackisch, C., Durner, W., Germer, K., Iden, S., Kreiselmeier, J., et al. (2023). Soil water retention and hydraulic conductivity measured in a wide saturation range. Earth System Science Data, 15, 4417–4432. doi:10.5194/essd-15-4417-2023
  • Nemes, A., Schaap, M. G., Leij, F. J., & Wösten, J. H. M. (2001). Description of the unsaturated soil hydraulic database UNSODA version 2.0. Journal of Hydrology, 251(3–4), 151–162. doi:10.1016/S0022-1694(01)00465-6 — original report: Leij, F. J., Alves, W. J., van Genuchten, M. Th., & Williams, J. R. (1996). The UNSODA Unsaturated Soil Hydraulic Database. EPA/600/R-96/095.
  • Weynants, M., Montanarella, L., Tóth, G., et al. (2013). European Hydropedological Data Inventory (EU-HYDI). Publications Office of the European Union, Luxembourg. doi:10.2788/5936

Smart reader. Drop in CSV, text, or Excel — the app figures out the rest. It auto-detects the separator (comma, semicolon, or tab) and decimal mark (so European / LabView exports using ; with a , decimal load directly), picks the right worksheet in an Excel workbook, and finds where the data table starts even when there are metadata/preamble rows above it (common in instrument exports). It also auto-detects whether the conductivity column is K or already log₁₀(K) (name contains “log”, or any value ≤ 0), so it never double-logs. No setup — and if a guess is off, just re-pick the columns in the toolbar.

4The 5-step workflow

1 · Upload CSV→ 2 · Map columns→ 3 · Pick model→ 4 · Choose metric→ 5 · Fit & read results
  1. Upload one or more CSV files in the top toolbar (Browse CSV or drag & drop).
  2. Map columns: set the Retention pF/θ and Conductivity pF/K dropdowns (auto-guessed). Pick a sample_id column and a single sample if you have several.
  3. Pick a model: in Simple mode VGM or BW-VGM (default: unimodal VGM); in Power user mode a retention shape (row) × variant (original/Brunswick/PDI/Wang) and a conductivity model below. Tick Select several models (or Ctrl+click) to add more models to compare, also across uni-, bi- and trimodal.
  4. Choose the fit metric (nRMSE, NSE, or NLL) and the number of bootstrap refits.
  5. Press Fit. Read the curves, parameter table, statistics and ranking; open any plot full screen with its corner button. Export when happy.

5Interface guide

5.1 Upload & column mapping

The toolbar groups the inputs: the upload zone, then Retention θ(h) (pF, θ), Conductivity K(h) (pF, K), and Sample (ID column + one sample). Hover (or tap) the ⓘ badge on any panel for an in-app explanation.

Screen size and zoom. On big monitors the whole interface is scaled up; on small laptop screens the text keeps its normal size and the page scrolls instead of shrinking (the control panes may wrap onto two rows). Browser zoom works as on any website — Ctrl + makes everything bigger, Ctrl − smaller (⌘ on a Mac; the same keys work in the desktop app). Narrow windows and phones get the one-view-at-a-time layout with a bottom tab bar. All control panes (optimisation, model, both parameter tables, results) have the same height, set by the window size alone — switching Simple ⇄ Power user, uni/bi/trimodal or learner mode never changes it or the plot area; a pane with more content (e.g. the Power-user model pane) scrolls inside.

5.2 Soil hydraulic model selection

Simple | Power user. The switch at the top of the model pane sets how much of the model library you see. The app remembers your choice in this browser (or desktop app); first-time visitors start in Simple.

ModeModelsDefault model
Simplevan Genuchten (m = 1 − 1/n) only, in two variants: VGM (original, with Mualem conductivity) and BW-VGM (Brunswick, Weber et al. 2019) — uni-, bi- or trimodal. The conductivity model is Mualem, and the expert options (6 cm pore cutoff, Brunswick film base h₀/ha, vapor conductivity, other K models) are hidden and stay at the paper defaults.unimodal VGM
Power userAll 8 retention shapes × 4 variants × 3 modalities (96 models), all 6 conductivity models and every expert option — everything described below.unimodal BW-VGM (Brunswick van Genuchten)

The default is only used until you pick a model yourself; switching modes keeps your selection where the mode allows it (going to Simple keeps VGM / BW-VGM models and otherwise selects unimodal VGM). Restoring a saved session that uses a model or option Simple mode does not show switches to Power user automatically — the restored model is never changed.

The matrix has one row per retention function and one column per variant (original · Brunswick · PDI · Wang; in Simple mode just the VGM and BW-VGM cells). Click a cell to select that model (filled). Above the matrix, switch the modality (unimodal / bimodal / trimodal) — a single selected model follows the switch. Below it (Power user), choose the conductivity (K) model(s). Hovering a cell with the mouse shows the model's equations; on a touch screen a long press does (✕ or any tap closes it).

Several models at once. Ctrl+click (⌘+click on a Mac) a cell to add it to the selection or remove it again — or tick Select several models above the matrix: then every plain click (or tap) adds or removes a model, no key needed — up to 10 models, also across modalities. Example: with unimodal VGM selected, switch the modality to bimodal (the model moves to bimodal VGM), then Ctrl+click bimodal VGM: both unimodal and bimodal VGM are now selected. While two or more models are selected the modality switch only changes which cells are shown. The line under the matrix lists the selection (“3 models: ★ VGM · uni · VGM · bi · BW-VGM · tri”): the ★ model is the primary one whose parameters are shown in the tables; click another chip to make it primary, ✕ to remove one, clear to keep only the primary. With Select several models unticked, a plain click (tap) always selects just that one model again.

VariantWhat it addsSource
originalClassic capillary model. θ(h) reaches a residual θr.—
BrunswickAdds a non-capillary (film/adsorptive) term so θ→0 at oven dryness; extra film-conductivity terms. Uses θcs/θncs notation.Weber et al. 2019
PDIPeters–Durner–Iden adsorptive saturation; θ→0 at pF 6.8. Adds Ksnc, a; tortuosity τs. Film conductivity follows Eq. 21 (base h₀/ha), so a = 1.5 gives the physical Tokunaga −1.5 dry-end slope; Brunswick uses Weber's Eq. 12 (base h₀).Peters, Durner & Iden 2024
WangWang, Ma & Vereecken (2025) generalized framework: θ = C(h)·[(θs−θr)Γ + θr], C(h) = [1 − ln(1+h/hr)/ln(1+h0/hr)]nc. The exponent nc makes one capillary curve produce a bimodal SWRC. Conductivity is matched at ha=−6 cm (K(ha)) for the sharp near-saturation structure decline, plus a film term; Ks is anchored to the wettest measured K and the structure branch enforces Ks ≥ K(ha) so K(h) stays continuous (no near-saturation step). Following Table 2, nc=1, pF₀=6.8 and the tortuosity l(τ)=0.5 are fixed by default; tick any of them to fit — untick nc stays 1 (U-model), tick it for the bimodal B-model that performed best in the paper.Wang, Ma & Vereecken 2025

5.3 Optimisation parameters

ControlMeaning
bootstrapNumber of resample-and-refit rounds used to build the 95 % confidence intervals (parameters and curves) and the 95 % prediction intervals (see §5.7). 0 or 1 = off (fastest). 100–200 is typical. Used for nRMSE/NSE.
max iterDifferential-evolution generations. Higher = more thorough optimisation (and slower). 150 is a good default.
Fit metricThe objective — see §5.4 and §8.

5.4 Fit metric & σ

  • nRMSE — range-normalised RMSE, so θ and K weigh equally. Uncertainty via bootstrap.
  • NSE — variance-normalised (Nash–Sutcliffe). Uncertainty via bootstrap.
  • NLL — Gaussian negative log-likelihood. It jointly calibrates the mean (model parameters) and the noise σ. Pick calibrate (σ̂ = RMSE, the maximum-likelihood value) or fixed (you type σθ and σK to control the θ-vs-K weighting). With NLL the 95 % confidence and prediction intervals come from the joint likelihood (Gauss–Newton covariance, parameter and σ draws; §5.7) instead of the bootstrap.

5.5 Parameter tables

Two tables — retention and conductivity — list each parameter with its fitted Value and its 95 % confidence interval (2.5 % / 97.5 %, §5.7). Symbols follow the selected variant's source paper (e.g. α, n, θr, θs; for Brunswick θcs, θncs; for PDI Ksnc, τs).

Fit or fix each parameter. Every row has a checkbox. Ticked (the default) means the parameter is fitted. Untick it to pin the parameter at the value in its box — type the value you want first, then untick — and it is held fixed while everything still ticked is fitted around it. This is useful when you know a value independently (say θs from saturation, or Ks from a measurement) and want the rest of the curve fitted to it. The min/max cells set each fitted parameter's search range. Your edited bounds and fit/fix toggles are kept across fits — only restore parameters resets everything to defaults.

Oven-dryness head pF₀. The full-range variants (PDI, Brunswick, Wang) carry an extra parameter pF₀ — the suction, in pF, at which θ → 0. It is a normal parameter row: it defaults to pF 6.8 and is fixed (its box unticked), reproducing the classic dry end. Change its value, set its range, or tick it to fit pF₀ to your dry-end data like any other parameter.

5.6 Plots

Toggle each square plot independently. Measured points are shown as dots and fitted models as lines; a standalone legend sits to the right so the plots stay square.

  • Retention θ(h), Conductivity K(h), Conductivity K(θ) — the fitted curves, each with its 95 % confidence interval and 95 % prediction interval (see §5.7). Static soil-water zones (saturation → field capacity → wilting point → oven dry) are shaded behind them.
  • Capacity C(h) — the specific water capacity C(h) = −dθ/dh [cm⁻¹]: how much water the soil releases per unit change in suction. It peaks where the retention curve is steepest, i.e. at the dominant pore size. Data points show the capacity estimated directly from your measured retention by finite differences (−Δθ/Δh); the y-axis stays anchored to the fitted curve, so noisy outlier points clip off-scale rather than hiding it.
  • Pore-size — the equivalent pore-size distribution: pore-water volume per decade of pore radius, against the equivalent radius r [µm]. Radii come from the capillary law r ≈ 1490 / h (h in cm; a pore of radius r empties at suction h). Two curves are drawn so you can see how the selected model partitions the water: the capillary distribution (solid — water held in pores of that radius, the pore-size distribution proper) and, for the full-range variants, the film / non-capillary contribution (dotted — adsorbed water, which is not held in capillary pores). Comparing them shows how PDI, Brunswick and Wang each split capillary vs adsorptive water across the size range. Data points here come from the total measured water content (−Δθ/Δlog₁₀r) — θcapillary cannot be measured, since the capillary/film split is a model construct — so they reflect capillary + film combined: they track the capillary curve where film is negligible (large pores) and rise toward the film curve at small radii.
  • Residuals θ, Residuals K — observed minus fitted, to check for structure the model missed.

θ(h), K(h) and K(θ) carry a 95 % confidence interval (darker) and a 95 % prediction interval (lighter, dotted edge); capacity and pore-size carry the 95 % confidence interval (§5.7).

Full screen. Each plot has a full-screen button in its corner. It shows that figure over the whole window (or phone screen), re-drawn at full resolution — not magnified — with the same curves, intervals (with the same confidence interval / prediction interval ticks as the legend; changing them keeps your zoom) and data, the legend inside the figure, and the zoom you had set. Drag to zoom, double-click to reset, use the Plotly tools (top right) to pan, and ⬇ PNG to save the figure as shown at high resolution. Esc or ✕ closes it.

5.7 Uncertainty — bootstrap, confidence & prediction intervals

Every fit can carry two different 95 % intervals. They answer different questions, and since 3.2.0 both are computed rigorously in both uncertainty modes and validated by simulation (below):

  • 95 % confidence interval — where the true curve (or parameter) lies. It describes how well the data pin down the model and shrinks as you add measurements. Drawn as the darker band.
  • 95 % prediction interval — where a new measurement of the same soil is expected with 95 % probability. It adds the measurement scatter to the uncertainty of the curve, so it is always wider and does not shrink to zero with more data. Drawn as the lighter band with a dotted edge.

Both are shown on Retention θ(h), Conductivity K(h) and Conductivity K(θ); Capacity C(h) and Pore-size show the 95 % confidence interval. The legend names the method, e.g. “95 % confidence interval (bootstrap)” or “95 % prediction interval (likelihood)”, and hovering a legend entry explains it. θ is treated on its volumetric scale and K on the log₁₀ scale (the scales the fit uses). θ and K are always fitted together (one parameter vector for both branches), and every interval comes from that joint fit: each bootstrap refit and each likelihood draw gives one matching set of θ(h), K(h) and K(θ) curves.

Several models. Every selected model gets its own intervals — its own bootstrap (B refits per model, so the fit takes about that many times longer) or its own likelihood draws. The plots first show the intervals of the primary ★ model only; the ticks confidence interval / prediction interval under each model in the legend (and the all models row) choose which intervals are drawn, in every plot, the full-screen view, ⬇ Figure and the PDF report.

Bootstrap mode (fit metric nRMSE or NSE, bootstrap = B refits)

  1. Resample and refit. Each round draws, with replacement, as many θ points as you measured and as many K points as you measured (pairs or “case” resampling) and refits both branches together. B rounds give B refitted parameter vectors and curves (Efron & Tibshirani 1993).
  2. Effective parameters per branch. From the joint fit to your data the tool computes how many of the p fitted parameters each branch “uses” — the sum of that branch's leverages, so pθ + pK = p — and the residual degrees of freedom df = n − p of each branch.
  3. 95 % confidence interval = the 2.5 % and 97.5 % percentiles of the B refitted curves at every pF, after a small-sample expansion (Hesterberg 2015): each refit's distance from the fitted curve is multiplied by √(n/df) · t0.975(df)/1.96. Plain percentiles are too narrow for small data sets — the spread of a pairs bootstrap is about √(df/n) of the real one and normal rather than Student-t; with 13 K points they covered the true curve only ≈ 87 % of the time (see the table).
  4. 95 % prediction interval — bootstrap predictive interval (Stine 1985; Davison & Hinkley 1997, §6.3.3): for every refit, ⌈4000/B⌉ new “measurements” are simulated as refit curve + a residual drawn at random from the fit to your data (centred, θ residuals for θ and log₁₀ K residuals for K, multiplied by √(n/df) and the same t/1.96 factor); the interval is the 2.5–97.5 % percentile of all of them at every pF.
  5. Parameter 95 % confidence intervals are the 2.5–97.5 % percentiles of the refitted parameters; the capacity and pore-size curves and the water-content summaries are recomputed on every refit.

3.1 drew the prediction band as “confidence band ± 1.96 σresidual”; it is replaced. B = 100–200 is a good choice (the simulation used 100).

Likelihood mode (fit metric NLL)

  1. The NLL fit is the joint maximum-likelihood fit of θ and log₁₀ K with Gaussian errors and one σ per branch (calibrated, or fixed by you).
  2. Covariance. The tool differentiates the σ-scaled residuals of both branches with respect to every fitted parameter (central differences; on a log₁₀ scale for the scale parameters α, hm, hae, Ks, Ksnc, K(ha) and the Gardner parameters, where the normal approximation is far better) and forms the Gauss–Newton observed information JᵀJ (Bates & Watts 1988; Seber & Wild 1989). One joint covariance covers all parameters of both branches.
  3. σ. With calibrated σ, each branch gets s² = SSE/(n − pbranch) (the maximum-likelihood σ = RMSE is biased low for small n) and its uncertainty: every draw uses its own σ² = SSE/χ²(n − pbranch). With fixed σ the values you typed are used as known.
  4. Draws. 2000 parameter vectors are drawn from the normal distribution with that covariance (scaled by each draw's σ — together a multivariate-t, the posterior of the linearised model; Gelman et al. 2013, ch. 14). A draw outside the parameter bounds, or with θr ≥ θs, is rejected and redrawn (a flat prior on the bounds box); clipping draws to the bounds would pile them up on the bounds and distort the intervals.
  5. 95 % confidence interval = 2.5–97.5 % percentiles of the 2000 drawn curves; 95 % prediction interval = percentiles of drawn curve + Gaussian noise with that draw's σ (θ branch: σθ, K branch: σlogK). Parameter 95 % confidence intervals are the percentiles of the drawn parameters.

K(θ)

K(θ) intervals are read at a fixed water content: each refit / draw gives its own K(θ) curve (its K(h) plotted against its own θ(h)), and the percentiles are taken at the θ values of the fitted curve. The 95 % prediction interval on K(θ) is for a new log₁₀ K measurement at a known water content; the measurement error of that point's θ is not part of it (points plotted at a measured θ scatter a little more, see the last coverage row).

How well do the intervals hold? — coverage simulation

The script tools/coverage_test.py (in the source) simulates data sets from known curves, fits each through the real engine and counts how often the intervals contain the truth. Design like a HYPROP + WP4 measurement: 41 θ points (35 at pF 0.3–3.0, 6 at pF 3.2–4.2) and 13 log₁₀ K points (one Ks at pF 0, 12 at pF 1.6–3.0), noise σθ = 0.008, σlogK = 0.15; and a sparser design (25 θ points at pF 0–4.2, 10 K points at pF 1.6–3.0, σθ = 0.01, σlogK = 0.2). Truth: unimodal VGM (θr 0.06, θs 0.43, α 0.02 cm⁻¹, n 1.6, Ks 50 cm d⁻¹, τ 0.5) and unimodal BW-VGM (θncs 0.04, θcs 0.40, α 0.03, n 1.8, pF₀ 6.8, Ksc 30, τ 0.5, Ksnc 0.05, a 1.5). 300 simulated data sets per model and design; bootstrap with B = 100 refits (100–200 is the recommended range; 100 keeps the run affordable), likelihood with 2000 draws; the previous version (3.1) was run on the same HYPROP data sets for comparison. Confidence interval: share of pF grid points in the measured range where the true curve lies inside; prediction interval: share of new, independent measurements (at the design pF and at random pF) that fall inside. ± = Monte-Carlo standard error (data sets are the independent units). Target: 95 %.

HYPROP + WP4 design (41 θ, 13 log₁₀ K points; coverage in %, “3.1” = the previous version on the same data sets):

QuantityVGM bootstrap 3.2VGM bootstrap 3.1VGM likelihood 3.2VGM likelihood 3.1BW-VGM bootstrap 3.2BW-VGM bootstrap 3.1BW-VGM likelihood 3.2BW-VGM likelihood 3.1
θ(h) — confidence interval covers the true curve93.3 ± 0.691.6 ± 0.794.3 ± 0.688.1 ± 0.896.0 ± 0.494.1 ± 0.594.7 ± 0.689.1 ± 0.8
log₁₀ K(h) — confidence interval covers the true curve91.8 ± 1.086.0 ± 1.394.2 ± 0.960.4 ± 1.495.0 ± 0.786.9 ± 1.194.7 ± 0.754.5 ± 1.2
K(θ) — confidence interval covers the true curve92.9 ± 0.977.6 ± 1.495.2 ± 0.749.9 ± 1.495.8 ± 0.682.2 ± 1.295.6 ± 0.650.2 ± 1.3
θ AND K at the same pF — both confidence intervals cover85.8 ± 1.178.9 ± 1.488.3 ± 1.056.0 ± 1.591.7 ± 0.882.6 ± 1.190.1 ± 0.852.8 ± 1.3
θ — prediction interval, new measurement at the measured pF94.9 ± 0.297.3 ± 0.294.6 ± 0.2—96.1 ± 0.298.0 ± 0.195.5 ± 0.2—
θ — prediction interval, new measurement at random pF94.9 ± 0.297.6 ± 0.194.7 ± 0.2—95.2 ± 0.297.7 ± 0.194.8 ± 0.2—
log₁₀ K — prediction interval, new measurement at the measured pF93.0 ± 0.594.5 ± 0.592.8 ± 0.6—94.3 ± 0.594.2 ± 0.595.5 ± 0.4—
log₁₀ K — prediction interval, new measurement at random pF93.2 ± 0.495.6 ± 0.394.2 ± 0.4—95.2 ± 0.394.9 ± 0.494.9 ± 0.4—
θ AND K — both prediction intervals hold a new pair (random pF)89.4 ± 0.493.2 ± 0.389.8 ± 0.4—91.4 ± 0.492.5 ± 0.489.9 ± 0.4—
K(θ) — prediction interval, new log₁₀ K at known θ94.1 ± 0.4—94.9 ± 0.4—95.6 ± 0.3—95.2 ± 0.3—
K(θ) — same, point plotted at a measured θ86.0 ± 0.5—86.5 ± 0.6—91.3 ± 0.4—90.4 ± 0.5—
mean width, confidence interval θ [vol. %]1.101.020.990.811.201.081.050.87
mean width, prediction interval θ [vol. %]3.484.033.36—3.554.103.40—
mean width, confidence interval log₁₀ K0.320.260.290.120.700.500.420.16
mean width, prediction interval log₁₀ K0.690.760.70—1.020.950.77—

Sparse design (25 θ, 10 log₁₀ K points; 3.2 only):

QuantityVGM bootstrap 3.2VGM likelihood 3.2BW-VGM bootstrap 3.2BW-VGM likelihood 3.2
θ(h) — confidence interval covers the true curve95.5 ± 0.594.2 ± 0.696.6 ± 0.495.2 ± 0.6
log₁₀ K(h) — confidence interval covers the true curve95.5 ± 0.795.8 ± 0.897.2 ± 0.493.4 ± 0.8
K(θ) — confidence interval covers the true curve95.8 ± 0.795.8 ± 0.898.3 ± 0.397.1 ± 0.5
θ AND K at the same pF — both confidence intervals cover91.0 ± 1.189.1 ± 1.294.1 ± 0.789.5 ± 1.0
θ — prediction interval, new measurement at the measured pF95.2 ± 0.393.9 ± 0.495.8 ± 0.395.4 ± 0.3
θ — prediction interval, new measurement at random pF95.5 ± 0.394.3 ± 0.396.2 ± 0.295.3 ± 0.3
log₁₀ K — prediction interval, new measurement at the measured pF94.4 ± 0.594.9 ± 0.595.7 ± 0.594.1 ± 0.6
log₁₀ K — prediction interval, new measurement at random pF94.0 ± 0.494.9 ± 0.496.7 ± 0.395.7 ± 0.4
θ AND K — both prediction intervals hold a new pair (random pF)90.0 ± 0.590.1 ± 0.593.2 ± 0.490.8 ± 0.4
K(θ) — prediction interval, new log₁₀ K at known θ94.9 ± 0.495.2 ± 0.497.7 ± 0.296.5 ± 0.3
K(θ) — same, point plotted at a measured θ87.8 ± 0.688.5 ± 0.593.9 ± 0.491.5 ± 0.5
mean width, confidence interval θ [vol. %]1.981.642.391.77
mean width, prediction interval θ [vol. %]4.724.405.054.53
mean width, confidence interval log₁₀ K0.430.390.760.68
mean width, prediction interval log₁₀ K0.970.981.231.17

Confidence interval by pF region (3.2):

Confidence interval, pF regionVGM HYPROP bootstrapVGM HYPROP likelihoodBW-VGM HYPROP bootstrapBW-VGM HYPROP likelihoodVGM sparse bootstrapVGM sparse likelihoodBW-VGM sparse bootstrapBW-VGM sparse likelihood
log₁₀ K, pF0-191.2 ± 1.594.0 ± 1.394.6 ± 1.294.6 ± 1.2————
log₁₀ K, pF1-291.2 ± 1.493.6 ± 1.295.6 ± 0.996.1 ± 0.894.1 ± 1.395.5 ± 1.197.6 ± 0.696.9 ± 0.8
log₁₀ K, pF2-392.9 ± 1.094.8 ± 1.094.6 ± 0.793.4 ± 0.996.1 ± 0.895.9 ± 0.997.0 ± 0.592.1 ± 1.0
θ, pF0-193.8 ± 1.395.4 ± 1.197.4 ± 0.895.1 ± 1.195.1 ± 1.194.8 ± 1.295.4 ± 1.195.8 ± 1.0
θ, pF1-293.4 ± 1.093.7 ± 1.096.4 ± 0.694.8 ± 0.997.9 ± 0.596.3 ± 0.797.6 ± 0.695.5 ± 0.8
θ, pF2-393.3 ± 1.193.0 ± 1.195.4 ± 0.895.4 ± 0.894.5 ± 1.092.1 ± 1.296.4 ± 0.795.3 ± 1.0
θ, pF3-4.293.0 ± 1.295.3 ± 1.095.2 ± 0.993.7 ± 1.194.7 ± 0.993.7 ± 1.196.9 ± 0.794.3 ± 1.0

Reading the table. “θ AND K” counts a pF as covered only if both intervals cover; two independent 95 % intervals give about 0.95² ≈ 90 % jointly, so ≈ 90 % is the expected value (the intervals are pointwise, one per branch, not simultaneous). Old versus new. The 3.1 likelihood confidence interval covered the true log₁₀ K curve only 55–60 % of the time and K(θ) only ≈ 50 % (its covariance ridge shrank the variance of Ks to almost nothing, σ was the biased maximum-likelihood value, and draws were clipped to the bounds); 3.1 had no likelihood prediction interval. The 3.1 bootstrap prediction band (confidence band ± 1.96 σ) was too wide for θ (97–98 %) and the 3.1 bootstrap confidence interval too narrow for log₁₀ K (86–87 %). In 3.2 both modes are within about 1–3 points of 95 % for θ, log₁₀ K and K(θ), for both models and both designs. The least accurate case is the bootstrap confidence interval of log₁₀ K for VGM with the HYPROP design (≈ 92 %): with 13 K points, one of them the saturated K at pF 0, a third of the resamples lose that point, and percentile intervals stay slightly short even after the small-sample expansion; the likelihood intervals are closer to 95 % there. With few points and the many-parameter BW-VGM the bootstrap intervals err on the safe side (up to ≈ 98 %). Limits: the coverage holds inside the measured pF range — outside it the intervals reflect only the model's shape and are not validated; the test assumes that the fitted model family is the true one and that the errors are independent and Gaussian (correlated HYPROP sensor errors or a wrong model make every interval too narrow); when a fitted parameter sits on its bound (e.g. θr at its minimum) its likelihood interval is one-sided by construction; and the K(θ) prediction interval does not contain the error of the θ at which a new K is measured (≈ 86–94 % coverage when the new point is placed at a measured θ).

5.8 Statistical analysis

For the selected model: RMSE · NSE · KGE · NLL for each branch (θ and K), the corrected AICc (lower = better, penalises extra parameters), the calibrated/fixed σ, and water-content / plant-available-water summaries at standard suctions. When several models are fitted, a dropdown lets you inspect each one.

5.9 Model comparison

Select several models (§5.2: tick Select several models, or Ctrl/⌘+click) — they may mix modalities and variants, e.g. unimodal VGM + bimodal VGM + unimodal BW-VGM — and press Fit. All of them are fitted together (× every ticked K model in Power user mode). Each model gets its own colour in the plots and legend (the primary model is blue); every model gets its own 95 % confidence interval and 95 % prediction interval (its own bootstrap, or its own likelihood draws). To keep the plots readable only the primary ★ model shows its intervals at first; under each model in the legend two ticks — confidence interval and prediction interval — show or hide that model’s intervals, and the all models row switches them for every model at once. The choice applies to all plots, the full-screen view, ⬇ Figure and the PDF report (which lists the models whose intervals it draws); a new fit starts again with the primary model only. The Ranking tab orders them by AICc with ΔAICc and Akaike weights; click a row for its statistics. The parameter and curve CSV exports and the PDF report contain every fitted model. A plain click resets to a single model.

5.10 Export

  • ⬇ Figure — saves each shown plot as a high-resolution (3×) PNG, ready for slides or papers.
  • ⬇ Parameters — fitted parameters + metrics + statistics as CSV.
  • ⬇ Curves — the fitted θ(pF) and log₁₀K(pF) curves as CSV, with their intervals: interval_method (bootstrap / likelihood), theta_conf_lo/hi and theta_pred_lo/hi (95 % confidence / prediction interval of θ, volume fraction), log10K_conf_lo/hi and log10K_pred_lo/hi (the same for log₁₀ K [cm d⁻¹]) and log10K_at_theta_conf_lo/hi, log10K_at_theta_pred_lo/hi (the K(θ) intervals at the row's fitted θ). Empty cells = not available (bootstrap: primary model only).
  • ⬇ Fit all samples — fits every sample in the file with the selected model(s) and downloads a single combined parameters + metrics table (great for whole datasets). Pick a sample-ID column first.

In the desktop app a Save dialog appears; in the browser files download normally.

5.11 Learner mode (teaching aid)

Tick 🎓 Learner mode under the model matrix to reveal two teaching tools:

  • Soil type presets — load typical van Genuchten parameters for a USDA texture class (sand → clay, after Carsel & Parrish 1988) and watch how the curve and numbers change.
  • ▸ Preview curve from parameters — draws the curve straight from the current parameter values (no fitting), overlaying any uploaded data. Each parameter input shows its typical range on hover, so students can hand-tune and see each parameter's visual effect — then press Fit to compare their guess with the algorithm.

A short, student-ready walkthrough lives in the classroom guide.

6Worked examples

These use the downloadable sample files from §3. Grab RetMeas.csv, CondMeas.csv, and two_samples.csv first.

6.1 Your first fit — van Genuchten–Mualem

  1. Upload RetMeas.csv and CondMeas.csv together (select both, or drop both).
  2. Mapping is auto-detected: Retention pF→pF, θ→theta; Conductivity pF→pF, K→K. Sample column = none (fit all rows).
  3. In the matrix choose van Genuchten (m=1−1/n) row, original column, modality unimodal. Conductivity model: Mualem.
  4. Fit metric nRMSE, bootstrap 0, max iter 150. Press Fit.
  5. Enable all three plots. You should see a sigmoidal θ(h) through the points and a steeply falling K(h). Read the table: α ≈ 0.03–0.04 cm⁻¹, n ≈ 1.5–1.7, θs ≈ 0.43, Ks ≈ 45.
  6. Set bootstrap to 100 and re-fit to add the 95 % confidence intervals and 95 % prediction intervals (curves) and the parameters' 95 % confidence intervals.

If the curve looks under-fitted, raise max iter (e.g. 300). Differential evolution is global, so more generations = a more accurate optimum.

6.2 Compare original vs Brunswick vs PDI

  1. Switch to Power user (PDI is not in Simple mode) and keep the van Genuchten unimodal original model from 6.1 (blue).
  2. Ctrl+click the Brunswick and PDI cells in the same row to add them.
  3. Press Fit. Three coloured curves appear on each plot. In the dry range the Brunswick and PDI curves bend toward θ→0, while the original flattens at θr.
  4. Open Statistical analysis and switch models in the dropdown. Compare AICc: the lowest AICc is the best trade-off of fit vs. parameters. PDI usually wins when you have dry-range data.

6.3 NLL with calibrated σ → likelihood confidence and prediction intervals

  1. Single van Genuchten–Mualem model (as in 6.1).
  2. Set Fit metric = NLL. The σ controls appear — leave it on calibrate. (Bootstrap is automatically off; NLL provides its own uncertainty.)
  3. Press Fit. You get likelihood-based 95 % confidence intervals of the parameters and, on every plot, the 95 % confidence interval (likelihood) and the 95 % prediction interval (likelihood).
  4. Check Statistical analysis: σθ and σK appear, and equal each branch's RMSE — that is the maximum-likelihood σ (NLL calibrates the mean and σ together).
  5. To weight θ vs K yourself, switch σ to fixed and enter e.g. σθ = 0.02, σK = 0.3.

6.4 Several samples & a bimodal soil

  1. Upload two_samples.csv. Set the Sample ID column to sample_id and pick Loam_A (the dropdown fits one sample at a time).
  2. Map pF_theta/theta and pF_K/K.
  3. For a structured soil, switch modality to bimodal — the parameter table now shows two pore systems (α₁,n₁,w₁,α₂,n₂). Fit and compare AICc against the unimodal fit.
  4. Switch the sample to Sand_B and re-fit to see a much steeper, sandier curve.

7Model reference

Retention functions (8)

FunctionShape parametersNote
van Genuchten (m = 1−1/n)α, nThe default; smooth sigmoid.
van Genuchten (m, n free)α, n, mExtra flexibility near saturation.
Brooks–Coreyα, λSharp air-entry break.
Kosugihm, σLognormal pore-size distribution.
Fredlund–Xing (constrained & m free)α, n (, m)Good over a wide suction range.
Campbell (1974)α, bPower form / Brooks–Corey-like.
Vogel–Císlerová (air-entry vG)α, n, haevG with an explicit air-entry head.

Each comes in unimodal / bimodal / trimodal (1–3 superimposed pore systems, mixed by weights w) and four variants (original / Brunswick / PDI / Wang): 8 × 3 × 4 = 96 retention models.

Conductivity (capillary-bundle) models (4)

ModelExponentsReference
Mualem ⭐ (recommended)q=1, r=2Mualem 1976
Burdineq=2, r=1Burdine 1953
Alexander–Skaggsq=1, r=1Alexander & Skaggs 1986
Childs–Collis-Georgemoment integralChilds & Collis-George 1950

The HCC adds saturated conductivity Ks and a tortuosity τ; Brunswick and PDI add film/non-capillary terms (Ksnc, a). Any conductivity model combines with any retention curve.

8Metric reference

MetricRange / bestMeaning
RMSE≥ 0, lowerRoot-mean-square error in the branch's own units (θ, or log₁₀K).
NSE≤ 1, best = 1Nash–Sutcliffe efficiency; 1 = perfect, 0 = no better than the mean.
KGE≤ 1, best = 1Kling–Gupta efficiency; balances correlation, bias, and variability.
NLLlowerGaussian negative log-likelihood; rewards an accurate mean and a small calibrated σ.
AICclowerCorrected Akaike criterion — fit quality penalised by the number of parameters. Use it to pick between models.

Which model is “best”? Prefer the lowest AICc — it stops you from over-fitting with a model that simply has more parameters. NSE/KGE near 1 and small RMSE confirm the fit visually.

9Tips & troubleshooting

SymptomFix
Nothing happens after uploadMap at least one full branch: (pF + θ) or (pF + K). Check the column dropdowns.
Fit looks too coarse / under-optimisedIncrease max iter (200–400). Differential evolution improves with more generations.
No confidence / prediction intervalFor nRMSE/NSE set bootstrap ≥ 100. For NLL both intervals are automatic. A branch without data (e.g. no K points) has no prediction interval.
K won't fit / errorsK must be positive (it is fitted in log space). Remove zeros/negatives.
Curves vanish in the dry rangeUse the Brunswick or PDI variant — they keep film conductivity and θ→0.
One sample onlyThe sample dropdown fits one sample at a time by design; switch it to fit another.
Kosugi, PDI, Wang, Burdine … are missingYou are in Simple mode — switch to Power user at the top of the model pane.
Text too small or too largeUse browser zoom (Ctrl + / Ctrl −, also in the desktop app). On small screens the page scrolls rather than shrinking the text.
A plot is too small to readOpen it with its full-screen button (corner of the plot); Esc closes it.

10FAQ

What is pF?

pF = log₁₀ of suction in cm of water. pF 2 = 100 cm (~10 kPa, field-capacity-ish); pF 4.2 ≈ 1500 kPa (permanent wilting point); pF 6.8 ≈ oven dryness.

Do I need both retention and conductivity?

No. Fit either branch alone, or both together. With both, the chosen metric balances them on a common scale.

Is my data uploaded anywhere?

The web app processes data in a transient session and does not store it; the desktop app runs entirely on your machine.

Why does calibrated σ equal RMSE?

That is the Gaussian maximum-likelihood estimate: σ̂ = √(SSE/N) = RMSE. NLL calibrates the mean and σ jointly.

Which conductivity model should I use?

Mualem (q=1, r=2) is the recommended default and works well with most retention curves.

11References & links

How to cite. If you use SWRC/HCC Fitter, please cite: Shojaeezadeh, S.A. SWRC/HCC Fitter tool for fitting soil water retention and hydraulic conductivity curves over the full moisture range (under review).

  • Weber et al. (2019), Water Resources Research — modular (Brunswick) framework.
  • Peters, Durner & Iden (2024), Vadose Zone Journal — the PDI model system.
  • Peters, Iden & Durner (2023), HESS — comparison of capillary-bundle conductivity models. doi
  • Mualem (1976); Burdine (1953); Alexander & Skaggs (1986); Childs & Collis-George (1950).
  • Intervals (§5.7): Efron & Tibshirani (1993), An Introduction to the Bootstrap, doi; Stine (1985), Bootstrap prediction intervals for regression, JASA 80:1026, doi; Davison & Hinkley (1997), Bootstrap Methods and their Application, §6.3.3, doi; Hesterberg (2015), The American Statistician 69:371, doi; Bates & Watts (1988), Nonlinear Regression Analysis and Its Applications, doi; Seber & Wild (1989), Nonlinear Regression, doi; Gelman et al. (2013), Bayesian Data Analysis, 3rd ed., doi; Marsaglia & Tsang (2000), gamma variates, ACM TOMS 26:363, doi.
  • Wang variant: Wang, Ma & Vereecken (2025), Water Resources Research — generalized framework for unimodal/bimodal SHPs, doi.

Built on the pyspsh forward model · numerical fitting in NumPy + SciPy. Released under the MIT License.