Cascade LP — Multi-Reservoir Scheduling
This document explains the multi-reservoir cascade LP in WeeklyScheduling. It extends the single-reservoir LP (Phase 2) to K reservoirs connected by the Cascade topology from HydroCore. This model becomes the LP subproblem that SDDP calls at every forward/backward pass stage in Phase 6.
Reference: Kompendium 3, §4 (Vassdragstopologier, Optimaliseringsstruktur)
The problem
Given a T-stage planning horizon and a cascade with K reservoirs and J plants:
max Σ_t price[t] × Σ_j prod[t,j] × Δt + Σ_k end_val_k(v[T,k])
subject to:
v[t,k] = v[t-1,k] + inflow[t,k] (water balance)
− Σ_{out edges} outflow[t,edge]
− spill[t,k]
+ Σ_{in edges} inflow_from[t−delay, edge]
v_min_k ≤ v[t,k] ≤ v_max_k (storage bounds)
0 ≤ r[t,j] ≤ r_max_j (discharge bounds)
spill[t,k] ≥ 0 (residual spill)
prod[t,j] ≤ slope_s × r[t,j] + intercept_s (PQ curve per plant)
end_val_k ≤ vf[i] + wv[i] × (v[T,k] − grid[i]) (end-value cuts)Topology and water balance
The cascade is a directed acyclic graph (DAG) of nodes and edges. Each reservoir's water balance constraint accounts for:
- Natural inflow — external inflow to this reservoir [Mm³/stage]
- Outgoing plant discharge — water flowing through turbines
- Outgoing waterway flow — spillway, bypass, river reach flows
- Residual spill — emergency slack (exits system, ensures feasibility)
- Incoming plant discharge — water arriving from an upstream reservoir
- Incoming waterway flow — with routing delay applied
Routing delays
When a waterway has delay_h > 0, the flow from stage t only arrives at the downstream node at stage t + delay_stages, where:
delay_stages = floor(delay_h / step_hours(resolution))For stages before the horizon (t − delay < 1), the warm-start flow is assumed to be zero.
Residual spill
Each reservoir has a spill[t,k] ≥ 0 variable that exits the system entirely (not routed downstream). This ensures the LP is always feasible even when all physical outflow paths are saturated. The spill has zero revenue — the LP naturally minimises it because releasing through turbines earns revenue.
This follows the penalty/slack approach from Kompendium 3, §7.2.
Shadow prices (water values)
After solving, the dual variable of each water balance constraint gives:
shadow_price[t,k] = marginal value of 1 extra Mm³ of inflow
at reservoir k, stage t [NOK/Mm³]These are the β⃗ gradient components used in SDDP Benders cuts (Phase 6):
α(k+1) ≥ β_i + μᵀ_i × x(k)
where μ_i = vector of K shadow prices at stage tConstraints from HydroCore
The cascade LP translates all Cascade.constraints to JuMP:
| HydroCore type | LP translation |
|---|---|
FlowConstraint | Tightens bounds on r[t,j] or q_way[t,w] |
VolumeConstraint | Tightens bounds on v[t,k] |
RampConstraint | r[t,j] − r[t-1,j] ≤ ramp_up per stage |
MinEnvFlow | Raises lower bound on waterway flow |
Using the model
using HydroCore, WeeklyScheduling
# Build cascade (see HydroCore docs)
cascade = Cascade("ALTA", "Alta System")
add_node!(cascade, r_upper); add_node!(cascade, r_lower); add_node!(cascade, sea)
add_edge!(cascade, plant_A); add_edge!(cascade, plant_B); add_edge!(cascade, spill_A)
# Natural inflow per reservoir [Mm³/stage]
inflows = Dict(
"R_upper" => fill(3.0, 52),
"R_lower" => fill(0.5, 52)
)
# Electricity price [NOK/MWh]
price = fill(400.0, 52)
# End-value (optional, per reservoir)
end_vals = Dict{String, EndValueFunction}() # defaults to ZeroEndValue
# Solve
result = optimize_cascade(cascade, inflows, price, end_vals;
resolution=WEEKLY)
result.volume # T × K matrix [Mm³]
result.discharge # T × J matrix [Mm³/stage]
result.spill # T × K matrix [Mm³/stage]
result.production # T-vector [MWh/stage]
result.shadow_price # T × K matrix [NOK/Mm³] — water values for SDDP
result.revenue_NOK # total revenue [NOK]
result.reservoir_ids # column labels for K dimension
result.plant_ids # column labels for J dimensionKnown limitations
Fixed reference head — PQ curves are evaluated at reference head. Variable head correction (Kompendium 2, §5.4.6; Kompendium 3, §3.4) is not implemented. For cascades with small lower reservoirs where head varies significantly, this introduces error.
Fixed routing delays —
Waterway.delay_his a constant. In reality, delay depends on current flow rate and channel fullness (Kompendium 3, §2.5.1).No unit commitment — The LP relaxes min-discharge to zero. Start/stop decisions and associated costs (Kompendium 3, §3.1) are not modelled.
No intra-stage price variation — A single price per stage. Price segments within a week (Kompendium 2, §3.4.4) are not modelled.
Connection to the planning hierarchy
WaterValues (Phase 1 SDP)
↓ produces WaterValueTable (single reservoir)
WeeklyScheduling — single-reservoir LP (Phase 2)
↓
WeeklyScheduling — cascade LP (Phase 4) ← this document
↓ produces CascadeScheduleResult with shadow_price
↓ (Phase 6: embedded in SDDP as subproblem)
SeasonalPlanning (Phase 6–7)
↓ produces SeasonalPlan with Benders cuts