AC Optimal Power Flow (AC-OPF)
AC Optimal Power Flow determines the cost-minimizing generator dispatch while satisfying the complete AC power flow equations, voltage constraints, and reactive power limits.
flowchart TB
A[System Demand] --> B[AC-OPF]
C[Generator P, Q Limits] --> B
D[Network Full AC Model] --> B
E[Voltage Constraints] --> B
B --> F{Nonlinear Program}
F --> G[Active Power Dispatch Pi]
F --> H[Reactive Power Dispatch Qi]
F --> I[Voltage Magnitudes Vb]
F --> J[Voltage Angles θb]
AC vs. DC Power Flow
Key Differences
| Aspect | DC-OPF | AC-OPF |
|---|---|---|
| Power Flow | P only | P and Q |
| Voltage | 1.0 (fixed) | Variable |
| Network Model | X only | R + jX |
| Equations | Linear | Nonlinear |
| Variables | θ (angles) | |V| (magnitudes) + θ |
| Losses | Ignored | Included |
| Problem Type | LP/QP | NLP |
| Solution | Global optimum | Local optimum |
| Speed | Faster | Slower |
| Accuracy | Approximate | High |
When AC-OPF is Required
graph TD
A{Analysis
Type?} --> B[Economic
Studies]
A --> C[Operational
Feasibility]
A --> D[Voltage
Analysis]
A --> E[Reactive
Planning]
B --> F[DC-OPF
Sufficient]
C --> G[AC-OPF
Required]
D --> G
E --> G
-
Use AC-OPF when:
- Validating dispatch feasibility
- Voltage stability critical
- Reactive power planning
- Accurate loss calculation
- Generator capability curves matter
- Detailed operational studies
-
Use DC-OPF when:
- Faster speed is critical
- Voltage is not a concern
- Large-scale studies (many scenarios)
- Market clearing considering active power only
Mathematical Formulation
Complete AC-OPF Model
Sets and Indices
| Symbol | Description |
|---|---|
| Set of generators | |
| Set of buses | |
| Set of transmission lines | |
| Bus indices | |
| Generator index | |
| Line index |
Decision Variables
| Variable | Unit | Domain | Description |
|---|---|---|---|
| p.u. | Continuous | Active power generation | |
| p.u. | Continuous | Reactive power generation | |
| p.u. | Continuous | Voltage magnitude at bus | |
| rad | Continuous | Voltage angle at bus |
- Key difference from DC: Voltage magnitudes
are now variables!
Parameters
Network Parameters
| Parameter | Description |
|---|---|
| Admittance matrix element | |
| Conductance between buses | |
| Susceptance between buses | |
| Angle difference |
Generator Parameters
| Parameter | Unit | Description |
|---|---|---|
| p.u. | Active power limits | |
| p.u. | Reactive power limits | |
| $/h | Generation cost (function of P only) |
System Parameters
| Parameter | Unit | Description |
|---|---|---|
| p.u. | Active load at bus | |
| p.u. | Reactive load at bus | |
| p.u. | Voltage magnitude limits | |
| p.u. | Apparent power limit on line |
Formulation Explanation
(1a) Objective Function
- Minimize total generation cost:
Constraint Explanation
(1b) Active Power Balance
- Kirchhoff’s Current Law (real part):
- Physical meaning: For every bus, the net active power injection is balanced by the local active power demand.
- Nonlinearity in AC power flow
- Compare to DC: DC used simplified equation
(1c) Reactive Power Balance
- Kirchhoff’s Current Law (imaginary part):
- Physical meaning:
- Reactive power must also satisfy a nodal power balance at each bus.
(1d) & (1e) Generator Limits
- Active power limits:
- Reactive power limits:
- Important: Real generators have coupled P-Q capability curves (more complex than box constraints).
(1f) Voltage Magnitude Limits
- Operational voltage range:
- Limits in KPG 193:
- 345 kV, 765 kV: 0.95 ≤ V ≤ 1.05 p.u.
- 154 kV: 0.90 ≤ V ≤ 1.10 p.u.
- Why limits matter:
- Equipment designed for nominal voltage
- Low voltage → Poor motor performance, dimming lights
- High voltage → Insulation stress, equipment damage
(1g) Line Flow Limits
- Apparent power (thermal) limit:
- More accurate than DC: Considers both P and Q flows
- Line flow calculation:
- Where
is conjugate of line current.
(1h) Reference Angle
- Slack bus angle:
- Same as DC-OPF: angles are relative.
AC Power Flow Equations
Complex Power Formulation
graph TB
subgraph "Complex Voltage"
A["Vb = |Vb| ∠ θb"]
B["Magnitude: |Vb|"]
C[Angle: θb]
end
subgraph "Complex Power"
D[S = P + jQ]
E["Active: P (MW)"]
F["Reactive: Q (MVAr)"]
end
subgraph "Power Flow"
G[Sb = Vb Σ Ybk Vk*]
end
A --> G
D --> G
Expanded Form
-
For line from bus
to bus :-
Active power flow:
-
Reactive power flow:
-
Where:
- Conductance - Susceptance - Line charging (half at each end)
-
Why Nonlinear?
-
Products of variables:
(bilinear term) , (trigonometric)
-
Consequence:
- No global optimum guarantee
- Multiple local optima possible
- Convergence not guaranteed
- Sensitive to starting point
Reactive Power and Voltage
Relationship
graph LR
A[Reactive Power Q] <-->|Controls| B[Voltage Magnitude V]
C[Increase Q
Generation] --> D[Voltage
Increases]
E[Decrease Q
Consumption] --> D
- Key principle: Reactive power supports voltage
Voltage Control
-
Methods to control voltage:
- Generator excitation (increase Q output)
- Shunt capacitors (inject Q)
- Shunt reactors (absorb Q)
- Transformer taps (change voltage ratio)
-
In AC-OPF: Optimize generator Q dispatch
Voltage Stability
Voltage Collapse
- Phenomenon: Insufficient reactive power → voltage decay
sequenceDiagram
participant Load
participant Voltage
participant Reactive
Load->>Voltage: Demand increases
Voltage->>Reactive: Need more Q
Reactive->>Voltage: Q support limited
Voltage->>Voltage: Voltage drops
Load->>Load: Current increases (constant P)
Voltage->>Voltage: Further drop
Note over Voltage: COLLAPSE!
- Indicators in AC-OPF:
- Voltage limits binding
- Reactive limits binding
- High losses
Transmission Losses
Loss Calculation
-
Power losses in line:
Where:
= Line current = Line resistance = Power flows = Voltage magnitude
-
Key observations:
- Losses are nonlinear in P and Q
- Losses increase with square of power flow
- Low voltage → higher losses
Extensions
- Security-Constrained AC-OPF with N-1 contingencies
- Optimal Reactive Dispatch: Given P dispatch, optimize Q for voltage profile
Solver Comparison
| Feature | ED | UC | DC-OPF | AC-OPF |
|---|---|---|---|---|
| Problem Type | LP/QP | MIP | LP/QP | NLP |
| Network Model | ✗ | ✗ | ✓ DC (Linearized) | ✓ AC |
| Time Periods | Single | Multiple (24+) | Single | Single |
| Commitment | ✗ | ✓ Binary | ✗ | ✗ |
| Transmission Limits | ✗ | ✗ | ✓ | ✓ |
| Voltage Constraints | ✗ | ✗ | ✗ | ✓ |
| Reactive Power | ✗ | ✗ | ✗ | ✓ |
| Transmission Losses | ✗ | ✗ | ✗ | ✓ |
| Solve Time | Fastest | Slow | Fast | Medium |
Next Steps
- Compare all models: Solver Comparison →
- Learn simpler models: DC-OPF → or ED →
- Multi-period scheduling: Unit Commitment →
- Try it: KPG Run Getting Started →