reservoir_discharge_limit_lp.hpp file
LP representation of a ReservoirDischargeLimit constraint.
The ReservoirDischargeLimitLP class provides the LP formulation for volume-dependent peak-discharge limits. For each (scenario, stage, block) triple it creates one inequality row of the form
flow_b - slope * efin <= intercept
This enforces flow_b <= intercept + slope * efin block-by-block, i.e. max_b(flow_b) <= DCMax(V) — the physically correct peak-flow capacity. The previous stage-average formulation (qeh = Σ_b (dur_b/dur_stage) · flow_b, qeh <= DCMax) allowed peaky patterns to satisfy the cap while violating the penstock at the block level; replacing the single averaged row with per-block rows fixes that at the cost of N rows per stage (same nonzero pattern, well-conditioned).
When the ReservoirDischargeLimit has multiple piecewise segments, update_lp() selects the active segment based on the reservoir volume from the previous solve and updates the LP constraint coefficients/RHS on every block-level row of that stage.
Namespaces
- namespace gtopt
Classes
- struct gtopt::ReservoirDischargeLimitLP::RDLState
- Tracks current LP state for coefficient updates.
- class gtopt::ReservoirDischargeLimitLP
- LP wrapper for ReservoirDischargeLimit constraints.