Physical Curves: HVCurve and PQCurve
Source:
HydroCore/src/curves.jl
Physical curves describe the behaviour of the real system. They are the bridge between the geometric/mechanical properties of the infrastructure and the numbers that go into an optimisation model.
HVCurve — Head-Volume curve
What it represents
A reservoir's HV curve (also called the elevation-volume or bathymetric curve) maps stored water volume [Mm³] to water surface elevation [m.a.s.l].
As volume increases, the water level rises — but not linearly. A typical reservoir is wide at the top (valley floor) and narrow at the bottom (valley neck), so early water fills fast (steep elevation rise) and later water fills slowly (flat elevation).
Elevation
[m.a.s.l]
800 ┤ ╭────────
780 ┤ ╭────╯
760 ┤ ╭────╯
740 ┤ ╭────╯
720 ┤ ╭────╯
700 ┼─────╯
└────────────────────────────► Volume [Mm³]
0 50 100 150 200Why it matters
Net head across a plant is:
H_net = elevation(upper reservoir) - elevation(lower reservoir) - lossesMore head = more power from the same discharge. If we use a constant head approximation in the LP, we can be significantly off when reservoirs are at extreme levels. The HV curve enables head-dependent power calculations.
Implementation
struct HVCurve
volumes::Vector{Float64} # Mm³, strictly increasing
elevations::Vector{Float64} # m.a.s.l, strictly increasing
endThe curve is piecewise-linear between breakpoints. Outside the range, values are clamped (held at the boundary) — never extrapolated.
hv = HVCurve([0.0, 50.0, 100.0, 150.0],
[800.0, 840.0, 870.0, 890.0])
elevation(hv, 75.0) # → 855.0 (midpoint of 840–870 segment)
elevation(hv, -5.0) # → 800.0 (clamped)
elevation(hv, 200.0) # → 890.0 (clamped)How many breakpoints?
In practice, 4–10 points from the bathymetric survey are sufficient for weekly planning models. Hourly models might want more resolution if head variation is large (deep reservoirs with significant head change over a week).
PQCurve — Power-Discharge curve
What it represents
A plant's PQ curve maps turbine discharge Q [m³/s] to generated power P [MW] at a specified reference head.
The fundamental relationship is:
P = η(Q, H) × ρ × g × Q × H / 1,000,000
where:
η = turbine efficiency [-]
ρ = water density = 1000 kg/m³
g = gravity = 9.81 m/s²
Q = discharge [m³/s]
H = net head [m]
P = power [MW]A perfect turbine (η = 1) at 100 m head and 100 m³/s would produce: 1 × 1000 × 9.81 × 100 × 100 / 1e6 = 98.1 MW
Real turbines have efficiency around 85–93%. Efficiency varies with Q and H, which is why the PQ curve is not perfectly linear.
The reference head approximation
The PQ curve is measured at (or computed for) a reference head H_ref — usually the design head. At different heads we use a scaling approximation:
P(Q, H) ≈ P_ref(Q) × H / H_refThis is a first-order correction that captures the dominant head-dependence. A more accurate model uses the full Hill chart (efficiency surface over Q and H), but that is rarely needed for weekly planning models.
Implementation
struct PQCurve
reference_head::Float64 # m
discharges::Vector{Float64} # m³/s, strictly increasing, starts at 0
powers::Vector{Float64} # MW, non-decreasing
endpq = PQCurve(
reference_head = 350.0,
discharges = [0.0, 20.0, 40.0, 60.0, 80.0],
powers = [0.0, 12.0, 26.0, 38.0, 48.0]
)
power(pq, 40.0) # → 26.0 MW (at reference head 350 m)
power(pq, 40.0, 320.0) # → 23.8 MW (at 320 m head, scaled)
power(pq, 40.0, 385.0) # → 28.6 MW (at 385 m head, scaled)
max_discharge(pq) # → 80.0 m³/sPractical shape of a PQ curve
The curve is typically:
- Zero at zero discharge (plant is off)
- Has a minimum technical flow (below which the turbine vibrates)
- Roughly linear in the main operating range
- Flattens near maximum (diminishing returns as turbine approaches runaway)
Power
[MW]
48 ┤ ●
38 ┤ ●
26 ┤ ●
12 ┤ ●
0 ┼───────────────────────────► Discharge [m³/s]
0 20 40 60 80The minimum technical flow manifests as a forbidden zone in the MIP formulation: the plant must either be off (Q = 0) or above the minimum (Q ≥ Q_min per unit).
The interp1 function
Both curves use the same underlying piecewise-linear interpolation:
function interp1(xs, ys, x)
# Binary search for segment
# Linear interpolation within segment
# Clamp at boundaries
endThis is a deliberately simple implementation. Julia's standard library has Interpolations.jl for more sophisticated methods (cubic splines, etc.), but for planning models with 4–10 breakpoints, linear interpolation is both accurate enough and fast.
Why not use a physics formula directly?
You might wonder: why store a PQ curve at all, rather than computing P = η × ρ × g × Q × H / 1e6 directly?
Several reasons:
- Efficiency is not constant. Real efficiency varies with Q and H in a complex way measured from turbine tests — it cannot be parametrised simply.
- Manufacturer data is in curve form. The PQ curve from the turbine manufacturer is what the operator actually has available.
- LP compatibility. A piecewise-linear curve is directly usable as a set of LP constraints. The full physics formula is nonlinear and requires special treatment.
For the initial LP model, the PQ curve at the reference head is the right abstraction. Head-dependent effects are either ignored (constant head approximation) or handled with a linear correction term.