SWMM5 Nesterov Optimizer Racer

Plain gradient descent vs Nesterov's accelerated gradient, racing a genuine EPA SWMM 5.2 engine to calibrate a model. Honoring Yurii Nesterov, 2026 Carl Friedrich Gauss Prize.
Engine: loading…

1 · Model & observed data

Drop or — a self-contained .inp replaces the model, .out or .csv (time as hours, H:MM, or datetime; flow in the last column) attaches observed data. Demo watershed is preloaded. Files never leave your browser.
Demo watershed: 2 subcatchments → J1/J2 → O1.
Objective: waiting for the engine…
Observed: none yet — the twin generates automatically once the engine is ready.

2 · Hidden truth (twin experiment)i

The engine generates "observed" flow at these values; the optimizers must rediscover them. Upload real observed data to replace this.

3 · Race settings

Central-difference gradients, h = 0.02 (normalized). Budgets land on 31, 36, 41, … so a 1-run start plus 5-run iterations spends them exactly (a racer only stops short if it revisits an already-cached point). The gradient step is capped at 0.15 (normalized) for both racers; Nesterov's momentum displacement itself is uncapped — the momentum is the experiment.
i

Racers

Gradient Descenti
best RMSE (cfs) · NSE i
runs 0 · θ
Nesterov (NAG)i
best RMSE (cfs) · NSE
runs 0 · θ
GD : θₖ₊₁ = θₖ − η ∇f(θₖ) NAG: yₖ = θₖ + βₖ(θₖ − θₖ₋₁), βₖ = (k−1)/(k+2) = 0.000 θₖ₊₁ = yₖ − η ∇f(yₖ) ← gradient at the look-ahead point

Loss surface & descent paths (RMSE, log color — dark = high error · hover for values)

Error vs engine runs (log scale, live · hover for values)

Hydrographs at the objective link (hover for values)

Iteration log

Racerkrunsθ₁θ₂RMSE

What this race demonstrates

Calibrating a SWMM model is optimization: minimize the mismatch f(θ) between simulated and observed flow. Plain gradient descent asks only "which way is downhill from here?" Nesterov's accelerated gradient (1983) keeps momentum from recent motion, looks ahead to a predicted point yₖ, and evaluates the gradient there — for smooth convex problems this provably improves the error rate from O(1/k) to O(1/k²), the optimal rate for first-order methods.

Here every objective evaluation is a genuine EPA SWMM 5.2 dynamic-wave run in your browser, and gradients come from central finite differences (4 runs each). The currency is engine runs, exactly what an overnight calibration spends. Watch the curves cross: descent grabs the easy early error, then stalls in the shallow valley along the width axis; momentum carries Nesterov through it to a far tighter fit on the same budget.

Honest caveats: this loss surface is not convex, finite-difference gradients carry noise, and the clean O(1/k²) guarantee does not formally apply — which is precisely why watching the race on a real engine beats trusting the asymptotics. The classic momentum schedule βₖ = (k−1)/(k+2) is used verbatim. Parameters raced are the two workhorse SWMM runoff calibration dials: a multiplicative scale on subcatchment %Imperv (volume) and on Width (hydrograph shape and timing).