Fit a closed conduit boundary with a Fourier series in log r(θ) and emit a
SWMM5 [CURVES] Shape curve. Every error figure below is produced by running the
actually exported table through a port of the engine's own
computeShapeTables(), and compared against the built-in shape's real
aFull/rFull constants — not against an independent integration of the width
table, which flatters the result.
Auto-placement minimises section-factor error weighted toward low flow (triple weight below 10% depth), not width RMS — the model routes conveyance, not width.
Error by depth band
Full-section conveyance can look fine while the section misbehaves for most of a storm. These are maximum errors within each band, computed from the engine's own area, hydraulic-radius and width tables.
Section — source (grey) vs Fourier fit (blue)
Width vs depth — what SWMM5 stores
Spectrum of log r — |ck| vs harmonic k
Faster coefficient decay indicates a smoother boundary, and the 1/k line is drawn for reference. Treat it as an indicator, not a classifier: rate of decay bounds smoothness in one direction, but the converse needs further conditions.
Substitution error is usually the big one. A built-in Egg conduit does not derive its
hydraulics from the width table — the engine assigns it explicit constants
(aFull = 0.5105 y², rFull = 0.1931 y) and looks area up in a separate
A_Egg table. A CUSTOM section instead has its geometry built by
computeShapeTables() from your curve. So even a perfect 51-point copy of SWMM's
own Egg width table routes about 4.9% less conveyance than the built-in Egg. Basket Handle loses
about 8.1%. That is the price of leaving the built-in shape, before any fitting happens.
Truncation error is what this tool controls — the fitted curve against the source section, both taken through the same engine path. It is typically far smaller than the substitution error at 51 points.
The point count changes the answer. The metrics follow the export selector, because SWMM receives exactly the table you emit. Dropping an Egg from 51 to 11 points moves total conveyance error from about −3.8% to about −8.4%.
Engine rules enforced before export. First depth in [0,1); widths non-negative; depths non-decreasing; non-zero full area, hydraulic radius and max width. Every interior depth must have exactly two boundary intersections — a fitted curve that doubles back cannot be stored, since SWMM keeps one width per depth. Failures disable export rather than emitting a warning comment.
Fourier rings at sharp features. Benched inverts, cunettes and flat shelves are where you will see it, and the error lands in the bottom and top few percent of depth — the low-flow region. Watch the 0-10% band, not the full-section figure.
A finite approximation inspired by binary-coefficient constructions, kept separate from the engineering fitter because it is a curiosity rather than a section source. Bits of x set dk and ek with a 1/k weight.
What this is not. Every boundary drawn here is a finite trigonometric polynomial from at most 40 bits and a finite harmonic count, so it is smooth and differentiable. The infinite construction is what would be nowhere-differentiable; this is a truncation of it. Terminating and repeating expansions do produce visibly different characters, which is the part worth looking at.