Power System Optimization
OPF problems are used to model the entire power system network topology by representing the transmission line interconnections between different nodes for power system optimization. Each node, also known as bus, represents a specific location, where a given set of generators, consumers and storage systems inject or withdraw power into/from the network. In OPF problem, power flow calculation and economic dispatch problem are solved simultaneously aiming to find the optimal operating conditions by minimizing the costs of meeting electricity demand, subject to transmission flow limits, including various electrical parameters such as voltage angles, reactance, etc. The full alternating current or "AC" OPF simultaneously co-optimizes the active and reactive power dispatch according to the defined operational and physical network constraints and is a non-convex optimization problem which is non-deterministic and polynomial-time hard. Hence, linearized versions (LOPF) are used in applications with high computational complexity where it would be hard/ time-consuming to use the full load flow equations. The so called "DC-OPF" problem is such a linearized version. The DC-OPF only considers real power and ignores reactive power dispatch. It but still works satisfactorily for bulk power transmission networks as long as such networks are not operated at the brink of instability or under heavily loaded conditions (source). But voltage drops or overloaded lines due to reactive power flows cannot be considered (source).
In general power flows along a transmission line l from bus i to bus j are driven by voltage phase angle differences, denoted by
- The resistance for each branch is negligible relative to the reactance, and can therefore be approximated as ~0.
- The voltage magnitude at each bus is constant and equal to the base voltage (e.g. equal to 1 p.u). -> simplifying the normally non-linear power flow equations.
- The voltage angle difference
$(\theta_j - \theta_i)$ across any branch from bus i to j is sufficiently small such that$cos(\theta_i - \theta_j) \approx 1$ and$sin(\theta_i - \theta_j) \approx (\theta_i - \theta_j)$ .
(
for details on power flow theory see: https://nworbmot.org/courses/es-24/es-5-power_flow.pdf
As a first step, the single period approach of DC-OPF (without storage and variable renewable generators) is formulated:
The transmission lines (from node i to node j / where each node (=bus) could stand for one country, for example) are treated as a transport model with controllable dispatch (coupled source & sink), constrained by energy conservation at each node. The absolute flows on these transmission line interconnections cannot exceed the line capacities due to thermal limits.
Sets:
Objective Function:
subject to:
Parameters:
-
$P^{min}_g$ , the minimum operating bounds for the generator (based on engineering or natural resource constraints) -
$P^{max}_g$ , the maximum operating bounds for the generator (based on engineering or natural resource constraints) -
$Demand_i$ at node i in MW -
$VarCost_{i,g}$ , variable generation costs -
$F^{max}_{i,j}$ transmission capacity (for the line between node i and node j) -
$X_{i,j}$ , reactance of line between node i and node j
Variables:
-
$P_{i,g}$ generation dispatch by (thermal) unit g, in MW -
$f_{i,j}$ power flow from node i to node j, in MW -
$\theta_i$ voltage angle in node i -
$\lambda_i$ , locational marginal price (LMP) in node i
Market price λ is the shadow price of the balance constraint, i.e. the cost of supply for an extra increment 1 MW of demand. (source) (=> increase in the objective function if demand increases)
Not considered here:
- fixed annualized costs for generators and transmission capacities
- losses
Next, a multi-period techno-economic cost linear optimization problem for the capacity investment and dispatch of renewable and thermal generators, as well as storage that minimizes the total annual system costs is formulated, which is used in Schlachtberger et al. 2017 with pypsa.
But first, we need some theory:
Linear Optimal Power Flow (LOPF) with network constraints for Kirchhoff’s Voltage Law (KVL) and Kirchhoff’s Current Law (KCL)
- conventionally the linearization of the relations between power flows in the network and power injection at the buses is expressed indirectly through auxiliary variables that represent the voltage angles at the buses (see above). For pypsa a new formulation of the LOPF problem is introduced which uses the power flows directly, decomposed using graph theoretic techniques into flows on a spanning tree and flows around closed cycles in the network. This formulation involves fewer decision variables and fewer constraints than the angle-based formulation resulting in shorter calculation times to solve the LOPF formulation Hörsch et al. 2018:
| Source: Lecture ES by T. Brown | |
|---|---|
| $K_{il} = \begin{cases} 1 & \text{if edge l starts at node i} \ −1 & \text{if edge l ends at node i} \ 0 & \text{otherwise} \end{cases}$ | the node-edge incidence matrix |
| power balance in the whole network of nodes N - all injected power should be consumed in the network, otherwise the network would be in imbalance. | |
| Kirchhoff’s Current Law (KCL) inforces energy conservation at each node (the power imbalance equals what goes out minus what comes in) for the linear setting. | |
| for a given edge l, the corresponding columns of the incidence matrix sums up to zero, since every edge starts at some node (+1) and ends at some node (-1) | |
| the voltage difference across edge l | |
| Since the flow in a closed cycle is balanced (the flow that enters each node along the edges of the cycle is balanced by the flow that exits) | |
|
|
Kirchhoff's Voltage Law (KVL) inforces that the directed sum of voltage differences around each closed cycle add up to zero. The cycles are organized in a cycle basis matrix |
with:
The equations for DC circuits (Ohm's Law) and "linear power flow" in AC circuits are analogous:
with: Active power flow
The voltage differece across edge l written in the logic of the incidence matrix K:
instead of L different
$f_l$ variables,$f_l$ depends only on N voltage angles$\theta_i$
and further: since the flow doesn't shift under constant shift, we can choose a slack/ reference node, such that$\theta_1=0$
with (1) + (2) KVL now becomes:
-> the power flows are used directly in the power balance, decomposed using graph theoretic techniques into flows on a spanning tree and flows around closed cycles in the network. This formulation involves fewer decision variables and fewer constraints than the angle-based formulation resulting in shorter calculation times to solve the LOPF formulation.
With this switch in the formulation of the power balance, in the following the LOPF formulation for a multi-period techno-economic cost linear optimization problem with renewable and thermal generators, as well as storage is given according to Schlachtberger et al. 2017/ pypsa. (see also Brown, Hörsch, Schlachtberger 2018)
with EES and renewable generators
Sets:
Objective Function:
subject to:
Parameters:
-
$P^{min}_{i,g}$ minimum operating bounds for the generator i,g, in MW (based on engineering or natural resource constraints) -
$P^{max}_{i,g}$ maximum operating bounds for the generator i,g, in MW (based on engineering or natural resource constraints) -
$Demand_{i,t}$ demand at node i and time t, in MW -
$VarCost_{i,g}$ generator operational/ variable costs, in €/MWh -
$FixedCost_{i,g}$ generator capital/ fixed costs, in €/MW -
$CAP_g$ power capacity of generator g at node i, in MW -
$F^{max}_{l}$ transmission capacity of branch l, in MW -
$w_t$ weighting of time to represent e.g. multiple hours, in h -
$C_{l,c}$ L$\times$ (L−N +1) cycle basis matrix -
$K_{il}$ N$\times$ L incidence matrix -
$\Lambda_{i,g,t}$ Power availability per unit of generator capacity, in MW/MW -
$\eta$ charging/ discharging efficience -
$P_{i}^{storage}$ storage nominal power, in MW
Variables:
-
$P_g$ , generation dispatch by (thermal) unit g, in MW -
$P_{i,t}^{ch}$ storage uptake at node i and time t, in MW -
$P_{i,t}^{dch}$ storage dispatch at node i and time t, in MW -
$soc_{i,t}$ storage state of charge (energy level) at node i at time t, in MWh -
$f_{l,t}$ power flow in branch l at time t, in MW -
$\lambda_{i,t}$ locational marginal price (LMP) in node i at time t, in €/MWh
- https://nworbmot.org/courses/es-24/es-5-power_flow.pdf
- https://pypsa.readthedocs.io/en/latest/user-guide/optimal-power-flow.html
- https://home.engineering.iastate.edu/~jdm/ee553-Old/LMP.pdf
- https://arxiv.org/pdf/1704.05492
- https://www.sciencedirect.com/science/article/abs/pii/S0378779617305138
- https://github.com/Power-Systems-Optimization-Course/power-systems-optimization/blob/30c3463a375f27928430581cb416a5361cee31fa/Notebooks/06-Optimal-Power-Flow.ipynb
- https://www.tugraz.at/fileadmin/user_upload/tugrazExternal/f560810f-089d-42d8-ae6d-8e82a8454ca9/files/lf/Session_B2/224_LF_Recht.pdf