Toy Four-Reservoir SDDP Walkthrough
Purpose
Section titled “Purpose”This chapter extends the single-reservoir walkthrough in Toy Single-Reservoir Walkthrough to a four-reservoir, four-bus system, still using a 0-order (seasonal-sampling) inflow model. The chapter demonstrates two phenomena that the single-reservoir case cannot exhibit:
- Multi-dimensional cuts. The cut becomes a hyperplane with one storage coefficient per reservoir: the probability-weighted reduced cost of that reservoir’s pinned incoming-storage column.
- Per-bus dispatch with independent supply. Each bus carries its own demand and is served by its local hydro and a local thermal; the LP solves the regional dispatches simultaneously inside one stage problem.
Novomodelo’s repository ships a reference case at examples/4ree/ modelling
the four-region Brazilian interconnected system (SUDESTE, SUL, NORDESTE,
NORTE) over 12 monthly stages (January to December 2015), with 126
thermals, five buses and five transmission lines. The fifth bus,
NOFICT1, is a fictitious transit node with no load and no generation;
the lines are SUDESTE–SUL, SUDESTE–NORDESTE, SUDESTE–NOFICT1,
NORDESTE–NOFICT1 and NORTE–NOFICT1. The shipped case has no
inter-reservoir cascade coupling (each region’s reservoir is
independent), no spatial inflow correlation, and uses a constant
hydro productivity model. This walkthrough preserves those
properties but replaces the production-scale numbers with
hand-traceable values: 4 stages, 3 openings, one thermal per bus, no
transmission. This walkthrough is a pedagogical caricature, not a
reproduction of the shipped case.
The chapter does not cover transmission, cascade coupling, the FPHA production model, an infinite-horizon cyclic policy, multi-resolution studies, or risk measures. Those topics are addressed in the chapters cited in section 8.
1. The Case in One Picture
Section titled “1. The Case in One Picture”The system has four buses, each with one local hydro (productivity 1.0), one local thermal, and one local demand block. The four reservoirs are independent — no cascade coupling. There is no transmission between buses in this walkthrough; each bus self-balances dispatch from its local resources.
Per-hydro parameters:
| Hydro | Bus | Productivity | ||||
|---|---|---|---|---|---|---|
| H1 | B1 | 100 | 30 | 15 | 5 | 1.0 |
| H2 | B2 | 100 | 30 | 12 | 4 | 1.0 |
| H3 | B3 | 80 | 20 | 10 | 3 | 1.0 |
| H4 | B4 | 80 | 20 | 8 | 3 | 1.0 |
Per-bus demand:
| Bus | |
|---|---|
| B1 | 25 |
| B2 | 20 |
| B3 | 15 |
| B4 | 12 |
System-level parameters:
| Parameter | Symbol | Value |
|---|---|---|
| Stages | 4 | |
| Openings per stage | 3 | |
| Thermal marginal cost | 50 $/MWh | |
| Deficit cost | 1000 $/MWh | |
| Discount factor | 1.0 |
Each bus’s demand exceeds its local hydro mean inflow (, , , ), so reservoirs deplete over the four-stage horizon and thermal generation appears in later stages.
2. Stage LP for This Case
Section titled “2. Stage LP for This Case”The stage- LP is assembled from the general formulation in LP Formulation, specialised to four hydros, four buses with one local thermal each, four storage state variables, and 0-order inflow (no AR-lag state).
Objective (minimise current-stage cost plus future cost):
Per-bus load balance (each bus self-balances, no transmission):
where is the local hydro generation at bus .
Hydro generation (constant productivity at all four plants):
Water balances (each reservoir is independent — no cascade):
(For this walkthrough : one m³/s of turbining per stage withdraws one hm³.)
Incoming-storage pinning (the reduced cost of each pinned column becomes the cut coefficient):
Bounds: ; ; .
Future cost variable : as in the single-reservoir case, the terminal stage carries no cuts; cuts of the form are added by the backward pass to earlier stages’ LPs. With four reservoirs the cut is now a 4-coefficient hyperplane in storage state space, with each reflecting that storage at hydro reduces future cost.
Note again the absence of any AR-lag state: 0-order inflow has no memory, so storage is the entire state vector.
3. The 0-Order Inflow Model with Four Hydros
Section titled “3. The 0-Order Inflow Model with Four Hydros”Each hydro samples its own inflow independently from a normal distribution with hydro-specific seasonal mean and standard deviation:
with hydro-specific from the parameter table in
section 1. The innovations are independent across hydros — there
is no correlation.json file in the actual examples/4ree/ case, and
this walkthrough preserves that property.
If a correlation.json file were supplied, the spatial structure
between innovations would be applied via the spectral
factorisation with — see
PAR(p) Inflow Model §6 for the
multivariate case. For this walkthrough the four innovations are
drawn independently.
The three openings used in the backward pass correspond to a single shared applied uniformly to all four hydros (a simplifying choice: in novomodelo each opening is one noise vector with a value for every stochastic entity, each hydro included, so the hydros’ inflows need not move together). Each opening has equal probability .
4. Iteration 1 — Forward Pass
Section titled “4. Iteration 1 — Forward Pass”The forward pass samples one trajectory using for every stage, so each hydro receives its mean inflow at every stage. With free at zero (no cuts in iteration 1), the LP minimises the per-bus thermal and deficit costs at each stage.
Because at the initial state every bus has enough hydro plus storage to meet demand from hydro alone, stages 1–3 carry zero cost. Stage 4 runs water-short on two of the four buses, and a third (B3) has exactly enough.
Stage 1 — incoming storage , inflows . At every bus, (demand met from hydro); end-of-stage storage:
Stage cost: (no thermal, no deficit).
Stage 2 — . Same pattern: each bus meets demand from hydro; storage decreases by :
Stage cost: .
Stage 3 — . Bus 1 reaches a knife edge: water available ; the LP turbines all available water and ends with . Other buses still have surplus.
Stage cost: .
Stage 4 — , inflows . Now two buses go water-short, and B3’s available water exactly meets its demand:
| Bus | Avail. | ||||||
|---|---|---|---|---|---|---|---|
| B1 | 0 | 15 | 15 | 25 | 15 | 10 | 0 |
| B2 | 6 | 12 | 18 | 20 | 18 | 2 | 0 |
| B3 | 5 | 10 | 15 | 15 | 15 | 0 | 0 |
| B4 | 8 | 8 | 16 | 12 | 12 | 0 | 0 |
Stage 4 cost: .
Trajectory upper-bound estimate: .
5. Iteration 1 — Backward Pass
Section titled “5. Iteration 1 — Backward Pass”The backward pass walks stages . At each stage it pins the incoming storage to the trial point from the forward pass, evaluates all three openings, reads the four pinned-column reduced costs, and aggregates into a 4-coefficient cut. The mechanics follow Cut Management sections 2–3, generalised from one storage coefficient (single-reservoir case) to four (this case).
Stage 4 (terminal)
Section titled “Stage 4 (terminal)”Trial point: . Inflows under the three shared openings (all four hydros move together with ):
| Opening | |||||
|---|---|---|---|---|---|
| 10 | 8 | 7 | 5 | ||
| 15 | 12 | 10 | 8 | ||
| 20 | 16 | 13 | 11 |
For each opening, each bus solves its local dispatch independently (no transmission, no at the terminal stage):
(dry):
| Bus | Avail. | Stage cost | ||||
|---|---|---|---|---|---|---|
| B1 | 10 | 25 | 10 | 15 | 750 | |
| B2 | 14 | 20 | 14 | 6 | 300 | |
| B3 | 12 | 15 | 12 | 3 | 150 | |
| B4 | 13 | 12 | 12 | 0 | 0 |
.
The storage cut coefficient at each bus — the reduced cost of the pinned incoming-storage column — follows the single-reservoir logic: water-limited buses with thermal active have ; buses where demand is met by hydro alone have .
(mean):
| Bus | Avail. | Stage cost | ||||
|---|---|---|---|---|---|---|
| B1 | 15 | 25 | 15 | 10 | 500 | |
| B2 | 18 | 20 | 18 | 2 | 100 | |
| B3 | 15 | 15 | 15 | 0 | 0 | |
| B4 | 16 | 12 | 12 | 0 | 0 |
. B3 is at a kink (available water exactly meets demand): one more unit of storage ends in the terminal , which has zero value, while one unit less needs one unit of thermal worth . Every value in is a valid subgradient; as in the single-reservoir walkthrough, the walkthrough takes the rate for one more unit of storage, .
(wet):
| Bus | Avail. | Stage cost | ||||
|---|---|---|---|---|---|---|
| B1 | 20 | 25 | 20 | 5 | 250 | |
| B2 | 22 | 20 | 20 | 0 | 0 | |
| B3 | 18 | 15 | 15 | 0 | 0 | |
| B4 | 19 | 12 | 12 | 0 | 0 |
.
Per-opening intercepts :
| Opening | |||
|---|---|---|---|
(The signs flip because and the formula subtracts a negative-times-positive product.)
Aggregation ():
| Hydro | |
|---|---|
| H1 | |
| H2 | |
| H3 | |
| H4 |
Cut added to stage 3’s LP:
Sanity check. At , the cut evaluates to
This equals the probability-weighted expected stage-4 cost at the trial point, : the cut is exact there by construction, and it lies on or below the expected stage-4 cost at every other storage vector.
The four storage coefficients rank by how much each reservoir reduces expected future cost. H1 is the most valuable: thermal at B1 was active in all three openings, so an extra unit at H1 saves in every scenario and the average is . H4 has zero coefficient: B4 was thermal-free in every opening, so storage at H4 has no marginal value at this trial point.
Stages 3 and 2
Section titled “Stages 3 and 2”The same procedure repeats at the earlier stages, with the cut from the next stage active in the LP. At each stage:
- Pin the incoming storage vector (column bounds).
- Solve all three opening LPs with the next-stage cut active.
- Read four pinned-column reduced costs per opening (one per reservoir).
- Compute per-opening intercepts via .
- Aggregate by probability-weighted averaging into one 5-coefficient cut (intercept plus four storage slopes).
- Add the cut to the previous stage’s LP.
By the end of the backward pass, stages 1 through 3 each carry one cut; stage 4 has none.
6. The Cut as a 4-D Hyperplane
Section titled “6. The Cut as a 4-D Hyperplane”The fundamental change from the single-reservoir case is the dimensionality of the cut. Each cut is now a hyperplane in 4-dimensional storage state space:
Several practical consequences follow:
Per-reservoir slopes. At the terminal stage the buses share no constraint, so the stage problem splits into four independent bus problems, and each slope of the iteration-1 stage-3 cut comes from its own bus alone: averages the reduced cost of hydro ‘s pinned incoming-storage column over the three openings, whatever the other reservoirs hold. The slopes are , , and : one more unit at H1 saves in every opening, and one more unit at H4 saves nothing at this trial point. The cut stacks four independent marginal water values; trading water between reservoirs needs a coupling that the caricature leaves out, such as transmission or a cascade (section 8).
The figure shows the four slopes of this cut as bars and each opening’s reduced cost as a dot: H1 is water-limited in all three openings ( each), H2 in and , H3 in only (its kink takes ), and H4 in none. The plotted values come from a tested module that re-runs this stage-4 backward pass.
Cut tightness is local, not global. Each cut equals the expected cost the backward pass computed at its trial point; far from the trial point it can be a loose lower bound on the cost-to-go. The forward pass spreads trial points across the storage state space as iterations progress, and each new trial point produces a cut that tightens the approximation in its neighbourhood. When the cuts bound the cost-to-go from below and when the approximation converges is set out in Cut Management — when bounds and certificates hold.
Per-bus thermal regime drives slope structure. A bus whose thermal is always idle (B4 in this trial) gets ; the corresponding reservoir’s storage has no marginal value at the visited state. As subsequent iterations sample trial points where B4 also runs short, that reservoir’s slope becomes negative in those cuts, and the cumulative cut pool eventually covers the region where every reservoir’s storage carries a non-zero marginal value.
7. Convergence on This Case
Section titled “7. Convergence on This Case”The percent form of the
optimality gap divides the gap
by the magnitude of the lower bound,
(floored at one currency unit). The iteration count needed to close it
depends on the demand-to-inflow ratios, the reservoir capacities and
the variance of the inflows, and the upper bound of a sampled forward
pass is a statistical estimate that certifies nothing
(Cut Management — Tier 3).
The shipped 4ree runs four sampled forward passes per iteration and
stops at its iteration limit of 256; novomodelo rejects a gap stopping
rule at setup under a sampled forward pass. See
Stopping Rules for the available criteria.
8. What This Example Does Not Show
Section titled “8. What This Example Does Not Show”The toy walkthrough above keeps to four reservoirs at four buses with no transmission. It does not cover:
- Transmission networks: the shipped
examples/4ree/case has five transmission lines, three of them through the fictitious transit bus NOFICT1, that let cheap generation at one bus serve another. With transmission, the load balance becomes a network constraint and the per-bus thermal share depends on line capacities and exchange costs. The cut structure does not change — still one storage coefficient per reservoir — but the per-opening LPs are no longer separable across buses. - Cascade coupling: in branched cascades, downstream reservoirs receive upstream releases via a water-balance term ; the storage cut coefficient at upstream plants then carries the expected downstream value of released water. See System Element Modeling Overview for cascade topology and Cut Management for how cascade sensitivities propagate through the pinned-column reduced cost.
- FPHA production model: nonlinear head-dependent productivity approximated by piecewise-linear hyperplanes; one of the planes binds at the optimum and contributes to the storage cut coefficient. See Hydro Production Function Models.
- Spatial inflow correlation: when a
correlation.jsonfile is supplied, the per-hydro innovations are drawn from a correlated multivariate normal via spectral factorisation. See PAR(p) Inflow Model §6. - Autoregressive inflow memory: a PAR(p) model with adds one lag state variable per hydro per lag; whether a stage’s cuts carry a coefficient for each lag is that stage’s cut-state projection (State Augmentation §7).
- Risk measures: CVaR weighting that shifts cut aggregation probabilities away from uniform toward worst scenarios, raising cut intercepts and slopes in the dry direction. See Risk Measures.
- Cyclic policy graphs: the four-stage horizon ends without a cut
linking back to stage 1. A cyclic (periodic) policy graph, in which
the first stage’s cost-to-go would feed the last stage, is a reserved
design:
stages.jsonaccepts onlyfinite_horizonaspolicy_graph.typeand rejectscyclicat case load. See Horizon Modes. - Multi-resolution studies: stages of different lengths in one horizon, for example a weekly head followed by a monthly tail, sharing one set of cuts. See Multi-Resolution Studies.
Cross-References
Section titled “Cross-References”- Toy Single-Reservoir Walkthrough — Single-reservoir baseline; core SDDP loop, 0-order inflow, forward/backward/cut in the simplest setting
- LP Formulation — Complete stage LP
- LP Layout and Scaling — Column and row layout
- State Augmentation — Column-bound state pinning, reduced-cost extraction
- System Element Modeling Overview — Hydro plant element, cascade topology (not exercised here), water-balance convention, FPHA overview
- Hydro Production Function Models — Constant-productivity (used here) and FPHA hyperplane fitting; impact on Benders cut coefficients
- PAR(p) Inflow Model — Inflow model definition; the degenerate case (white noise) used here; spatial correlation factorisation for multivariate cases
- Cut Management — Dual extraction, per-opening intercepts, single-cut aggregation; sign convention
- Risk Measures — CVaR definition, EAVaR convex combination, risk-adjusted aggregation weights
- Horizon Modes — Finite (supported) vs. reserved cyclic policy graphs and the season-indexed cut pool