Skip to content

Reservoir Flood-Control Release Scheduling

Background

A reservoir can create temporary flood-storage capacity by releasing water before a forecast inflow peak, then refill as the event passes. The schedule must respect both the safe storage range and the finite outlet capacity, while preserving an appropriate post-event inventory.

This example optimizes releases for a deterministic ten-day hydrograph. It is a compact water-resources optimal-control problem with explicit volumetric and flow units.

Water-balance model

Let \(S(t)\) be reservoir storage in million cubic meters and \(q(t)\) the controlled release in million cubic meters per day. The forecast inflow is

\[ q_{\mathrm{in}}(t) =3+18\exp\left[ -\left(\frac{t-4}{1.4}\right)^2 \right] \qquad \left[\mathrm{million\ m^3/day}\right]. \]

With precipitation, evaporation, seepage, and uncontrolled spill omitted, the lumped conservation equation is

\[ \dot S(t)=q_{\mathrm{in}}(t)-q(t). \]

The storage and release histories therefore satisfy the full-horizon identity

\[ S(t)-S(0)= \int_0^t\left[q_{\mathrm{in}}(s)-q(s)\right]\,\mathrm ds. \]

Objective and constraints

The horizon is \(T=10\ \mathrm{days}\). The normalized objective keeps storage near its 40 million m³ reference while discouraging unnecessary departure from a 5 million m³/day reference release:

\[ \min J=\int_0^{10} \left[ \left(\frac{S-40}{40}\right)^2 +0.025\left(\frac{q-5}{10}\right)^2 \right]\,\mathrm dt. \]

Storage begins and ends at the same level,

\[ S(0)=S(10)=40\ \mathrm{million\ m^3}, \]

so the optimizer cannot leave the reservoir depleted after the event. The operating constraints are

\[ 20\le S(t)\le80\ \mathrm{million\ m^3}, \qquad 0\le q(t)\le15\ \mathrm{million\ m^3/day}. \]

Variables, parameters, and units

Symbol Meaning Value or unit
\(t\) Time from start of forecast day
\(S\) Reservoir storage million m³
\(q_{\mathrm{in}}\) Forecast inflow million m³/day
\(q\) Controlled downstream release million m³/day
\(S_{\min},S_{\max}\) Operating storage limits \(20,\ 80\) million m³
\(q_{\max}\) Outlet-capacity limit \(15\) million m³/day
\(J\) Integral of normalized penalties day

Modeling choices and limits

The endpoint storage constraint makes the ten-day schedules comparable and represents an inventory-recovery requirement. The two cost terms are scaled before weighting, so their coefficients are not directly physical damage prices. A \(100\times2\) Lobatto mesh is used, and the initial release guess is the mean forecast inflow.

The hydrograph is assumed known perfectly. The model has one well-mixed storage volume, one ideal outlet, and no outlet ramp limit, routing delay, tailwater effect, spillway logic, evaporation, environmental minimum flow, downstream tributaries, forecast uncertainty, or receding-horizon update. It demonstrates deterministic release scheduling, not an operational flood rule curve.

Run the example

python -m examples.reservoir_flood_control

Save the figure without opening a window:

python -m examples.reservoir_flood_control --save reservoir-flood-control.png --no-show

Independent numerical validation

The solution is reconstructed at 4,001 times. The script checks storage and release bounds and independently applies cumulative trapezoidal quadrature to \(q_{\mathrm{in}}-q\) over every prefix of the horizon. The reported residual is the maximum absolute mismatch in the conservation identity above, not merely the terminal volume error.

Quantity Verified value
Objective \(J\) \(0.09006368\)
Minimum storage \(36.589691\ \mathrm{million\ m^3}\)
Maximum storage \(43.411201\ \mathrm{million\ m^3}\)
Peak release \(15.000000\ \mathrm{million\ m^3/day}\)
Maximum full-horizon cumulative water-balance residual \(2.248\times10^{-2}\ \mathrm{million\ m^3}\)

The cumulative residual is \(0.02248\) million m³, or about \(22\,480\) m³. It is below the script's \(0.03\) million m³ validation tolerance; it reflects dense interpolation and numerical quadrature, not an unmodeled source of water. Peak release reaches the outlet-capacity constraint during the event.

Reservoir storage, forecast inflow and optimized release, and cumulative inflow and release volumes

Source code

See the complete runnable example: examples/reservoir_flood_control.py.