Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Equipment-Specific Formulations

Purpose

This spec details the LP constraints for each equipment type in Cobre. While system elements describes what each element is and its decision variables, this spec contains the detailed mathematical constraints governing each equipment type’s behavior within the LP. The reading order is: system elementsLP formulationthis spec (per-equipment deep dives).

For variable definitions and index sets, see notation conventions. For hydro production constraints specifically, see hydro production models.

1. Thermal Plants

1.1 Standard Thermals

Thermal generation cost is modeled as a piecewise-linear convex function of dispatched power. Each cost segment represents a generation tranche with its own marginal cost — for example, a 200 MW plant might have its first 50 MW at $100/MWh, the next 50 MW at $150/MWh, and the final 100 MW at $200/MWh. Because the segment costs are non-decreasing (convex), the LP solver naturally fills cheaper segments first.

Decision Variables:

  • = generation at thermal , block , cost segment

Constraints:

Total generation:

Segment bounds:

Total generation bounds:

Both bounds are hard constraints with no slack variables — thermal dispatch is directly controllable (unlike hydro, which depends on exogenous inflows).

Objective Contribution:

Continuous relaxation: Cobre does not include binary commitment variables in the training LP. The minimum generation bound is enforced as a simple lower bound, meaning the LP may dispatch a thermal at an intermediate level between zero and — a region that is physically infeasible for most thermal units (below minimum stable load). This is a deliberate modeling choice: the continuous relaxation is acceptable for the long-term planning horizon targeted by SDDP, and stepped enforcement can be applied during simulation (see §8).

1.2 GNL Thermals

GNL (Gas Natural Liquefeito) plants require dispatch anticipation due to fuel ordering lead times. The data model is fully specified (see Input System Entities §4), including state variables for the committed dispatch pipeline. However, implementation is deferred — input validation currently rejects GNL thermals with an exceptional validation rule. See deferred features for the planned formulation.

2. Transmission Lines

Decision Variables:

  • = direct flow (source → target)
  • = reverse flow (target → source)

Bounds:

Stage-varying capacity: The capacity limits and may vary by stage through exchange factors defined in constraints/exchange_factors.json. See Input Constraints for the exchange factor specification.

Load Balance Contribution:

At source bus:

At target bus:

where accounts for transmission losses.

Objective Contribution:

Note on Exchange Cost: The cost is a regularization term, not an actual transmission cost. Its purpose is to:

  1. Prevent degenerate solutions: Without this term, multiple equivalent solutions exist with different flow patterns
  2. Guide the solver: Small positive cost encourages minimal power transfers when indifferent
  3. Improve numerical stability: Reduces cycling in LP simplex iterations

Typical values are very small ($0.01–1.00/MWh), several orders of magnitude below generation costs. If this cost significantly affects dispatch decisions, the value is set too high.

See LP formulation (§1.4 Regularization Costs) for the full taxonomy of penalty vs. cost types.

3. Import/Export Contracts

Each contract is unidirectional — either an import or an export contract, identified by a type field. This matches the data model in Input System Entities §6.

Decision Variables:

  • = dispatched power for contract , block

Bounds:

Load Balance Contribution:

At connected bus:

  • Import contracts (): (power entering the system)
  • Export contracts (): (power leaving the system)

Objective Contribution:

Because import prices () are positive and export prices are negative, this single summation naturally adds import costs and subtracts export revenue.

4. Pumping Stations

Pumping stations transfer water from a source reservoir (downstream) to a destination reservoir (upstream), consuming electrical power in the process.

Decision Variables:

  • = pumped water flow at station , block (m³/s)

Bounds:

Both bounds are hard constraints.

Power Consumption:

where is the power consumption rate (MW per m³/s).

Water Balance Impact:

  • Source hydro: (water removed)
  • Destination hydro: (water added)

Load Balance Impact:

At connected bus: (power consumed)

Objective Contribution: None

Economic Modeling Note: Pumping stations do not have a direct cost term in the objective function. The cost of pumping is implicitly captured through energy consumption — the marginal cost of energy at the connected bus determines the effective pumping cost. This approach correctly models the economic incentive: pumping is attractive when energy prices are low (e.g., excess hydro/renewable generation) and unattractive when prices are high (e.g., thermal dispatch at margin).

5. Hydro Plants

Hydro constraints are the most complex in the system. Rather than duplicating them here, the hydro formulation is split across two specs:

  • Water balance, outflow, storage bounds, and soft constraints: See LP formulation §4 (water balance), §6 (generation constraints), §7 (outflow constraints), §8 (variable bounds), §9 (constraint violation penalties).
  • Production function models (constant productivity, FPHA, linearized head): See hydro production models.

For hydro decision variables and physical meaning, see system elements §5.

6. Non-Controllable Generation Sources

Non-controllable sources (wind farms, solar plants, small run-of-river hydros) have stochastic availability determined by the scenario pipeline. The solver can only curtail generation below the available amount — it cannot dispatch upward beyond what nature provides.

Decision Variables:

  • = generation at non-controllable source , block

Bounds (hard):

where is the stochastic available generation for the current (stage, scenario), bounded by (installed capacity).

Load Balance Contribution:

At connected bus: (generation injected)

Objective Contribution:

The curtailment cost is a regularization penalty (Category 3 in the Penalty System), analogous to spillage_cost for hydros — curtailment discards available “free” energy.

Note: Curtailment is not a separate LP decision variable — it is derived as . Both bounds are hard constraints with no slack variables, since the available generation is always non-negative and output can always be curtailed to zero.

Open question — block distribution of available generation: The scenario pipeline produces a single available generation value per (stage, scenario). Currently, this value is used identically across all blocks within the stage — the available generation does not vary by block. This contrasts with load demand, which has per-block factors (multipliers on the stochastic load value, see Input Scenarios §8), and exchange capacity, which has per-block factors on line limits (see Input Constraints §4). For non-controllable sources, the generation profile within a stage is often non-uniform — solar generation concentrates in daylight blocks, wind may peak at night. Without block factors, the model distributes NCS generation proportionally to block duration, which may not fit all applications. Whether to add NCS block factors (analogous to load and exchange) and where to define them (scenario pipeline, entity registry, or constraints) is to be resolved during the architecture review.

7. Deferred Equipment Types

7.1 Batteries

Battery energy storage systems with charge/discharge dynamics. DEFERRED — see deferred features for the planned formulation.

8. Simulation-Only Constraint Enhancements (Future)

Implementation status: The enhancements described in this section are planned for future implementation. They are documented here to establish the modeling intent and inform architectural decisions. The training LP formulations in §1–§6 are the current scope.

During training (policy construction), all constraints must be linear and stable across iterations to preserve SDDP convergence guarantees. During simulation (single forward pass, no cuts), these restrictions do not apply — the LP is solved once per (stage, scenario) with no convergence concerns. This opens the door for higher-fidelity constraint enforcement that would break SDDP if used during training.

The following enhancements follow the same pattern established for the linearized head model: relaxed/linearized during training, exact during simulation via preprocessing and postprocessing.

8.1 Stepped Thermal Enforcement

During training, thermal generation uses a continuous LP relaxation where dispatch can take any value in (or ). In reality, most thermal plants operate either fully off or above their minimum stable load — the region is physically infeasible.

During simulation, the stepped behavior can be enforced by adjusting bounds before the LP solve: for each thermal, either fix or set as a hard lower bound, based on the dispatch signal from the continuous solution. This is a preprocessing step that does not change the LP structure.

8.2 Storage-Dependent Hydro Bounds

Several operational and environmental constraints on hydro plants are defined as step functions of reservoir storage by system operators. Common examples:

  • Outflow bounds: Maximum outflow depends on storage level (e.g., hm³ → m³/s; hm³ → m³/s; hm³ → unbounded)
  • Turbined flow bounds: Minimum turbined flow varies with reservoir level (environmental flow requirements that depend on downstream conditions affected by reservoir level)

During training, these constraints must be linearized — typically using the most conservative bound or a piecewise-linear relaxation — to keep the LP linear and stage-invariant. During simulation, the exact step function can be enforced by reading the incoming storage at each stage and selecting the appropriate bound before the LP solve.

8.3 Relationship to Generic Constraints

Cobre already supports generic constraints (§10) — user-defined linear constraints on any LP variable. A user could express storage-dependent bounds as generic constraints with appropriate coefficients. However, the piecewise stepped constraints described above have a fundamentally different character:

  • Generic constraints are linear and active during both training and simulation
  • Stepped constraints involve discrete breakpoints on state variables, requiring different treatment in each phase (linearized for training, exact for simulation)

Whether stepped constraints should be expressed through the generic constraint mechanism (with a training/simulation mode flag) or defined in a dedicated input format is an open design question to be resolved during the architecture review. The key requirement is that the user can specify the step function breakpoints and the system handles the training/simulation duality transparently.

Cross-References

  • Notation conventions — variable and set definitions (, , , , )
  • System elements — element descriptions, decision variables, and connections
  • LP formulation — how equipment constraints integrate into the assembled LP; hydro water balance (§4), generation constraints (§6), variable bounds (§8)
  • Hydro production models — hydro-specific production function constraints (constant, FPHA, linearized head)
  • Penalty System — penalty taxonomy, regularization vs. violation costs
  • Input System Entities — entity registries (contracts §6, NCS §7, GNL §4, pumping §5)
  • Input Constraints — exchange factors, generic constraints
  • Block formulations — block structure within which equipment constraints operate
  • SDDP Algorithm — iterative algorithm that solves stage subproblems containing these equipment constraints
  • Deferred features — batteries, GNL thermals