Optimal Power Flow & SCED — LMPs, DAM/RTM markets
OPF: min Σ c_i·P_g,i s.t. power balance + V band + line MVA + gen caps. DC OPF (linear, <1 s) vs AC OPF (nonlinear, 10 s-5 min). SCOPF adds N-1 contingencies via Benders / iterative screening. LMP_k = ∂J/∂P_k = energy + congestion (PTDF·μ_line) + losses. Two-settlement: DAM (unit commitment MILP) + RTM (SCED every 5-15 min). Frontier: stochastic, chance-constrained, AC convex relaxations (SDP/SOCP), ML-warm-start, FERC 2222 DER aggregation.
Step 1 — Optimal Power Flow (OPF): minimum-cost dispatch subject to network constraints
Reference notes
Optimal Power Flow (OPF) is the optimization problem at the heart of every wholesale electricity market and modern transmission control room. Originally formulated by Carpentier in 1962. OPF computes the least-cost generator dispatch that meets demand while satisfying all network constraints. Security-Constrained OPF (SCOPF) extends this with N-1 contingency constraints. The shadow prices of bus power-balance constraints are the Locational Marginal Prices (LMPs) used for market settlement.
The OPF problem statement
Subject to:
- Power balance at every bus (Kirchhoff): Σ P_g - Σ P_load = losses; same for Q.
- Generator capacity: P_min,i ≤ P_g,i ≤ P_max,i; Q_min,i ≤ Q_g,i ≤ Q_max,i.
- Bus voltage band: 0.95 ≤ |V_k| ≤ 1.05 per unit (typical).
- Line flow limits: |S_line| ≤ S_line,max.
- Transformer tap-changer range: t_min ≤ t ≤ t_max.
- Decision variables: P_g,i, Q_g,i, |V|_k, sometimes θ_k, transformer taps, switched-reactive settings.
- Outputs: optimal dispatch, bus voltages and angles, line flows, plus Lagrange multipliers (shadow prices) — the LMPs.
DC OPF — linear approximation
- Assumptions:
- All voltage magnitudes equal 1.0 per unit.
- Line resistances negligible compared to reactances.
- Angle differences across each line are small: sin(θ_i - θ_j) ≈ θ_i - θ_j.
- Result: P_line ≈ (θ_i - θ_j) / X_line — LINEAR in angles.
- DC OPF is a LINEAR PROGRAM. Solvable by simplex or interior-point methods in < 1 second for 5,000-10,000 bus systems.
- Used for SCED in production markets (PJM, MISO, CAISO, ERCOT, NYISO, ISO-NE) every 5-15 minutes.
- Limitation: ignores reactive power, voltage limits, losses. Adequate when network is well-conditioned.
AC OPF — full nonlinear formulation
- Includes all four state quantities: |V|, θ, P, Q at every bus.
- Solved by:
- Interior-point methods (IPOPT, KNITRO, MOSEK, MATPOWER).
- Sequential Quadratic Programming (SQP).
- Specialized algorithms.
- Solution time: 10 seconds to 5 minutes for 5,000-bus systems.
- Used for: long-term planning, post-contingency rebalance, voltage-stability-limited dispatch, reactive-resource scheduling.
- Non-convex with multiple local optima; convergence not guaranteed.
- Active research: convex relaxations (SDP, SOCP) for global optima.
SCOPF — security-constrained OPF (N-1)
- Adds N-1 contingency constraints: dispatch must remain feasible in BASE CASE plus all credible single contingencies.
- Credible single contingencies:
- Any single transmission line outage.
- Any single transformer outage.
- Any single generator trip.
- Mathematically: for every contingency k, add post-contingency power-flow equations + flow / voltage limits.
- Direct formulation is computationally infeasible (1000+ contingencies × thousands of constraints each).
- Decomposition strategies:
- Benders decomposition: master solves base case; sub-problem checks each contingency; cuts added on violations.
- Iterative contingency screening: solve base OPF; screen all contingencies via approximate PF; add violating constraints; re-solve. Converges in 3-10 iterations. Used in production EMS.
- Preventive vs corrective: preventive requires base dispatch alone to handle all contingencies; corrective allows rerouting after a contingency.
- Standards: NERC TPL-001 defines contingency categories P0 through P7 for the bulk power system.
Locational Marginal Pricing (LMP)
- Equivalently: cost of supplying ONE MORE MW of demand at bus k while maintaining all network constraints. $/MWh units.
- Three-component decomposition:
- LMP_energy — marginal cost of generation at the reference (slack) bus. Same at every bus.
- LMP_congestion,k — shadow price on transmission constraints × PTDF (Power Transfer Distribution Factor) for bus k. Positive on import side of a congested line, negative on export.
- LMP_losses,k — incremental losses for injection at bus k vs reference.
- Example: PJM day-ahead clears 8,000 buses every hour. LMPs typically $25/MWh (surplus generation in Indiana, Ohio) to $80/MWh (transmission-constrained NJ, Chicago hubs). Extreme: negative (excess must-run renewable) or > $1000/MWh during scarcity.
Settlement
- Every MWh of generation withdrawn or injected at bus k settles at LMP_k.
- Generators earn LMP_k for their MWh output; loads pay LMP_k for their MWh consumption.
- The difference is collected by the RTO as congestion revenue, distributed to FTR (Financial Transmission Rights) holders.
- Market participants:
- Generators submit OFFER curves (price-quantity steps).
- Demand response submits BIDS.
- SCED clears the market and publishes LMPs.
Two-settlement market structure (DAM + RTM)
| Market | Timing | What it solves |
|---|---|---|
| DAM (Day-Ahead) | Clears ~noon day before | Unit commitment + economic dispatch for each of 24 hours next day; ancillary services co-cleared. MILP solved by CPLEX/Gurobi. Publishes DAM-LMP per bus per hour. |
| RTM (Real-Time) | Every 5-15 min during operating day | SCED adjusts to actual demand/supply. Publishes RTM-LMP per bus per dispatch interval. Pays generators for deviation from DAM commitment. |
- Example settlement: gen scheduled 100 MW DAM at $50, dispatched 110 MW RTM at $70: revenue = 100 × $50 + 10 × $70 = $5,700/hr.
- Markets: PJM, MISO, CAISO, ERCOT, NYISO, ISO-NE all use two-settlement.
Unit commitment (UC) in DAM
- Binary on/off decision for every generator for every hour of the planning horizon.
- Constraints: minimum up-time, minimum down-time, startup cost, shutdown cost, ramp rate, no-load cost.
- Co-optimized with economic dispatch — choose binary u_i,t AND continuous P_g,i,t.
- Mixed-integer linear program (MILP); solved by CPLEX, Gurobi, FICO Xpress, or RTO-proprietary tools in 30 min to several hours.
- Outputs: hourly commitment schedule + dispatch + DAM-LMPs.
Modern OPF frontier
- Stochastic OPF — multi-scenario optimization for renewables uncertainty; CVaR risk measures.
- Chance-constrained OPF — P[flow > limit] ≤ α (typical α = 5%).
- Robust OPF — worst-case bounded uncertainty.
- AC OPF convex relaxations — SDP and SOCP relaxations for global optima; tight on radial distribution, looser on meshed transmission. Active research at MIT, Cornell, Caltech.
- ML-accelerated OPF — neural networks predict warm starts; 10×-1000× speedup. Pilots at PJM, CAISO.
- Real-time OPF for inverters — sub-1-second distributed and consensus-based algorithms for grid-forming inverter coordination and microgrid optimization.
- FERC Order 2222 (2020) — RTOs must allow aggregated DER (Distributed Energy Resources) participation in wholesale markets.
Vendors and tools
- RTO market software: OATI, Siemens, GE, Hitachi-ABB, EPRI commercial tools.
- Proprietary: PJM MARS, MISO LMP-DA, CAISO Market Software.
- Open source: MATPOWER + MOST extension, PowerModels.jl (Julia), Pyomo / pyomo (Python), PowerWorld (academic).