hynet: An Optimal Power Flow Framework for Hybrid AC/DC Power Systems

11/26/2018 ∙ by Matthias Hotz, et al. ∙ Technische Universität München 0

High-voltage direct current (HVDC) systems are increasingly incorporated into today's AC power grids, necessitating optimal power flow (OPF) tools for the analysis, planning, and operation of such hybrid systems. To this end, we introduce hynet, a Python-based open-source OPF framework for hybrid AC/DC grids with point-to-point and radial multi-terminal HVDC systems. hynet's software design promotes ease of use, extensibility, and a manifold of solving options, which range from interior-point methods to relaxation-based solution techniques. This paper introduces the underlying mathematical framework, including the system model and OPF formulation. To support large-scale hybrid grids, the presented model balances modeling depth and complexity to offer both adequate accuracy and computational tractability. Additionally, the OPF formulation is simplified by a proposed state space relaxation that unifies the representation of AC and DC subgrids. Furthermore, two supported convex relaxations of the OPF problem and some related results are discussed and generalized. Finally, hynet's software design is illustrated and related to the presented mathematical framework, while highlighting its amenability to extensions.



There are no comments yet.


page 1

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

I Introduction

To counteract the climate change, many countries consider a decarbonization of the energy sector, especially via a transition of electricity generation based on fossil fuels toward renewable energy sources (RES) [1, 2]. This transition introduces an increasingly distributed and fluctuating energy production, which generally necessitates additional transmission capacity as well as stronger interconnections of regional and national grids to balance and smooth the variability of RES-based generation [2, 3]. In this regard, high-voltage direct current (HVDC) systems are considered as a key technology due to their advantages in long-distance, underground, and submarine transmission as well as their ability to connect asynchronous grids and, in case of voltage source converter (VSC) HVDC systems, to provide flexible power flow control and reactive power compensation [2, 3]. Already today, a large number of point-to-point HVDC (P2P-HVDC) systems and several multi-terminal HVDC (MT-HVDC) systems are installed and many are planned [2, 4]. With the above developments, this trend is destined to continue, leading to large-scale hybrid AC/DC power systems.

Due to the importance of the optimal power flow (OPF) in operational and grid expansion planning as well as techno-economic studies, these structural changes necessitate an OPF framework for large-scale hybrid AC/DC power systems. OPF denotes the optimization problem of identifying the cost-optimal allocation of generation resources and the corresponding system state to serve a given load, while satisfying all boundary conditions of the grid. It involves a large number of optimization variables, system constraints, and, to accurately capture the physics, the power flow equations based on Kirchhoff’s laws, which render the problem inherently nonconvex and challenging to solve. As the OPF problem specification and solution is rather involved, a software framework for this task is desired. Furthermore, for transparency, reproducibility, and flexible adoption in research, it should be available as open-source software. Several open-source software packages for OPF computation have already been published, including the established toolboxes Matpower [5, 6] (and its Python-port Pypower [7]) and PSAT [8, 9] as well as the recently released PowerModels [10, 11] and pandapower [12, 13]. While PSAT is targeted at small to medium-sized systems, Matpower, PowerModels, and pandapower also support large-scale systems, but they are limited to a simple model of P2P-HVDC systems and do not support MT-HVDC systems.

To close this gap, we developed hynet [14], an open-source OPF framework for hybrid AC/DC grids with P2P- and radial MT-HVDC systems. In the process, particular care was taken that hynet is (a) freely accessible, (b) very easy to use, and (c) extensible, while featuring a (d) solid and rigorous mathematical model and inherent support of (e) convex relaxations. To address (a), hynet was written in Python [15], a popular high-level open-source programming language that is freely available for all major platforms. For (b), the interface to the system and result data was designed similar to Matpower, which has been widely successful due to its intuitive accessibility. For (c), we introduced an object-oriented software design, which renders the framework’s structure clear and intuitive while offering inherent support for extensions. For (d), we developed a mathematical model formulation with a substantial modeling depth, while providing several layers of notational abstraction to support its adoption in future works and OPF extensions. Finally, for (e), we devised a state space relaxation that unifies the representation of AC and DC subgrids in the OPF formulation, which simplifies the study of convex relaxations for hybrid AC/DC grids substantially.

I-a Contributions and Outline

In the following, Section II and III presents the system model for hybrid AC/DC power systems as implemented in hynet. This model aims at a balance of modeling depth and complexity to offer adequate accuracy while being tractable for large-scale hybrid grids. To this end, a novel converter model as well as a unified representation of AC and DC subgrids is introduced. The latter simplifies the mathematical modeling significantly and enables the straightforward generalization of previously derived AC models to DC subgrids. Subsequently, Section IV formulates the corresponding OPF problem, which is then simplified by a proposed state space relaxation to unify the voltage representation. Besides streamlining the implementation, which is utilized in hynet, this unified OPF formulation further enables straightforward convex relaxation. This is illustrated in Section V, which discusses two popular convex relaxations of the OPF problem, i.e., the semidefinite and second-order cone relaxation, which are both included in hynet. Additionally, a novel approach to the bus voltage recovery for those relaxations is presented, which comprises a least-squares rank-1 approximation on a particular sparsity pattern, where the latter is defined by the system’s network topology and, therewith, focuses the approximation to system-relevant parts. Furthermore, to support the use of relaxations in hynet, some results on conditions for exactness and locational marginal prices are generalized to hybrid AC/DC grids with MT-HVDC systems. In the former, exactness requires the absence of certain pathological price profiles. This result is complemented by a proposed price profile deformation, which potentially establishes exactness in case of a pathological price profile. Finally, Section VI highlights hynet’s fundamental software design and relates it to the presented system model and OPF formulations. Section VII concludes the paper.

I-B Notation

The set of natural numbers is denoted by , the set of integers by , the set of real numbers by , the set of nonnegative real numbers by , the set of positive real numbers by , the set of complex numbers by , and the set of Hermitian matrices in by . The imaginary unit is denoted by . For , its real part is , its imaginary part is , its absolute value is , the principal value of its argument is , and its complex conjugate is . For a matrix , its transpose is , its conjugate (Hermitian) transpose is , its trace is , its rank is , its Frobenius norm is , and its element in row  and column  is . For two matrices , denotes that

is positive semidefinite. For real-valued vectors, inequalities are component-wise. The vector

denotes the th standard basis vector of appropriate dimension. For a countable set , its cardinality is . For a set and vectors or matrices , with , denotes the -tuple and the -fold Cartesian product .



Converter Mode-DependentProportional Losses

Figure 1: Electrical models: (a) Model for bus  [16] with an injection port (circles) and a branch port (triangles). (b) Model for branch  [16], which connects the branch port of source bus to the branch port of destination bus . (c) Model for converter , which connects the injection port of source bus to the injection port of destination bus .

Ii System Model

In the literature, several models of hybrid AC/DC grids with MT-HVDC systems were proposed for OPF studies, cf. [17, 18, 19, 20, 21, 22, 23, 24]. For hynet, we developed a model that balances modeling depth and complexity to offer adequate accuracy while being tractable for large-scale hybrid grids and accessible to rigorous mathematical studies. To this end, the model for hybrid AC/DC grids with P2P-HVDC systems in [16], with the refinements in [25], is extended with DC subgrids and converters. A unified representation of AC and DC subgrids is introduced, which enables the generalization of the electrical model in [16] to DC subgrids while simplifying the implementation and mathematical exposition. Hereafter, AC lines, cables, transformers, and phase shifters are referred to as AC branches, DC lines and cables as DC branches, inverters, rectifiers, VSCs, and back-to-back converters as converters, and points of interconnection, generation injection, and load connection are called buses.

Ii-a Network Topology

The network topology of the hybrid AC/DC power system, which consists of the interconnection of an arbitrary number of AC and DC subgrids via converters, is described by the directed multigraph , where

  1. is the set of buses,

  2. is the set of branches,

  3. is the set of converters,

  4. maps a branch to its source bus,

  5. maps a branch to its destination bus,

  6. maps a converter to its source bus, and

  7. maps a converter to its destination bus.

The directionality of branches and converters is not related to the direction of power flow and can be chosen arbitrarily. The buses are partitioned into a set of AC buses and a set of DC buses, i.e., and  . AC and DC buses must not be connected by a branch, i.e., the branches are partitioned into AC and DC branches: and  . Accordingly, the set of AC branches and the set of DC branches is given by


Note that the terminal buses of converters are not restricted, i.e., the model supports AC/DC and DC/AC as well as AC and DC back-to-back converters. To support the mathematical exposition later on, some terms and expressions are defined.

Definition 1

Consider the directed subgraph with all buses and branches. A connected component [26] in the underlying [26] undirected graph of is called subgrid. A subgrid comprising buses in is called AC subgrid. A subgrid comprising buses in is called DC subgrid.

Definition 2

The set and of branches outgoing and incoming at bus , respectively, is

Definition 3

The set and of converters outgoing and incoming at bus , respectively, is


Finally, a generally valid property of the network topology is established, which is utilized later on.

Definition 4 (Self-Loop Free Network Graph)

The multigraph does not comprise any self-loops, i.e.,


Ii-B Electrical Model

The electrical model for branches and buses is adopted from [16] and extended with DC subgrids and a proposed converter model. The characterization of generation and load is adopted from [25] and generalized to the concept of injectors.

Ii-B1 Branch Model

Branches are represented via the common branch model in Fig. (b)b. For branch , it comprises two shunt admittances , a series admittance , and two complex voltage ratios . In the latter, and is the tap ratio and and the phase shift of the respective transformer, while


denotes the total voltage ratio. Let the bus voltage vector , source current vector , and destination current vector be


They are related by Kirchhoff’s and Ohm’s law, which renders


where are given in [16, Eq. (6) and (7)]. In the following, bus voltages are used as state variables. While AC subgrids exhibit complex-valued effective (rms) voltage phasors, DC subgrids exhibit real-valued voltages. This is considered by restricting to , where


Furthermore, DC lines and cables are modeled via their series resistance, which is captured as follows.

Definition 5

DC branches equal a series conductance, i.e.,


Finally, a generally valid physical property of DC branches is observed, which is utilized later on.

Definition 6 (Lossy DC Branches)

The series conductance of all DC branches is positive, i.e., , .

Ii-B2 Bus Model

Buses are modeled as depicted in Fig. (a)a. For bus , it comprises a shunt admittance , connections to the outgoing branches as well as to the incoming branches , and an injection port. Let the injection current vector be


It is related to by Kirchhoff’s and Ohm’s law, i.e.,


where the bus admittance matrix is given in [16, Eq. (10)]. Finally, note that the shunt usually models reactive power compensation and is irrelevant in DC subgrids.

Definition 7

DC buses exhibit a zero shunt admittance, i.e., , .

Ii-B3 Converter Model

For hynet, the converter model illustrated in Fig. (c)c is introduced, which balances modeling depth and complexity.111Complementary, the transformer, filter, and phase reactor of a VSC can be modeled using two AC branches and a capacitive shunt, cf. [24, 22]. For converter , it considers the source and destination apparent power flow , respectively, where active power is converted with a forward and backward conversion loss factor222In the analysis of VSC loss models in [24], the difference of the “Avg” model [24, Eq. (2)] and the “Complete” model [24, Eq. (1)] implies that an individual loss parametrization of the rectifier and inverter mode is essential, while the similar performance of the “Avg” model and the “Prop” model [24, Eq. (3)] suggests that individual proportional loss models for both modes potentially offer adequate accuracy, which motivates this formulation. , respectively, while reactive power may be provided, i.e.,


Therein, and is the nonnegative active power flow from bus to and vice versa, respectively, while is the reactive power support. The P/Q-capability of the converter at the source and destination bus is approximated by the polyhedral set and , respectively, cf. Fig. (a)a. In this model, this is captured by


where the polyhedral set is a reformulation of and in terms of the converter state vector using (14). For a compact notation, the state vectors of all converters are stacked, i.e.,


where the polyhedral set is expressed as


In the latter, and capture the inequality constraints that describe the capability regions of all converters. Finally, the absence of reactive power on the DC-side of a converter is established.

Definition 8

The DC-side of all converters exclusively injects active power, i.e.,


In the software framework, static converter losses are modeled explicitly for ease of use, while w.l.o.g. the mathematical model considers them as fixed loads. Furthermore, the P/Q-capabilities and are specified by an intersection of up to half-spaces, which offers adequate accuracy at a moderate number of constraints and parametrization complexity.


Figure 2: Qualitative example of an approximated P/Q capability region of (a) a voltage source converter [27, 22] and (b) a generator [28, Ch. 5.4], where the latter includes an additional power factor and minimum output limit. The approximations are polyhedral sets defined by the intersection of half-spaces.

Ii-B4 Generators, Prosumers, and Loads

For a compact notation, it is observed that, in the context of optimal power flow, power producers, prosumers (and flexible distribution systems), as well as flexible and fixed loads are conceptually equivalent. They comprise a certain set of valid operating points in the P/Q-plane and quantify their preferences via a real-valued function over the P/Q-plane. This is utilized for an abstraction of these entities to injectors. An injector can inject a certain amount of (positive or negative) active and reactive power, which is associated with a certain cost. The set of injectors is denoted by . Injector injects the active power and the reactive power , which are collected in the injection vector . Its valid operating points are specified by the capability region , which is a nonempty, compact, and convex set. The convex cost function specifies the cost associated with an operating point. The injector’s terminal bus is specified by , i.e., injector is connected to the injection port of bus . Conversely, the injectors at a bus are identified as follows.

Definition 9

The set of injectors connected to bus is


Moreover, the nature of DC subgrids is respected.

Definition 10

Injectors connected to DC buses exclusively inject active power, i.e., , .

For example, for a generator, is a convex approximation of its P/Q-capability, while reflects the generation cost. For a fixed load, is singleton and maps to a constant value. For a flexible load, characterizes the implementable load shift, while reflects the cost for load dispatching.

In the software framework, fixed loads are modeled explicitly for ease of use. Furthermore, the P/Q-capability is specified as a polyhedral set defined by the intersection of up to half-spaces, which can approximate the physical capabilities and restrict the power factor, cf. Fig. (b)b. The cost function is considered linearly separable in the active and reactive power costs, i.e.,


where are convex and piecewise linear.

Ii-B5 Power Balance

The flow conservation arising from Kirchhoff’s current law balances the nodal injections with the flow into branches and converters. This is captured by the power balance equations


Therein, the left hand side describes the flow of active and reactive power into the branches and converters, respectively, while the right hand side accumulates the nodal active and reactive power injection. The matrices are a function of the bus admittance matrix and given in [16, Eq. (14)]. The vectors , which include (14) and characterize the flow into converters, can be derived as


Ii-B6 Electrical Losses

The total electrical losses amount to the difference of total active power generation and load, i.e., the sum of the right-hand side in (21a) over all or, equivalently, the respective sum of the left-hand side. With the latter and , the total electrical losses can be derived as , where is333The motivation for defining in terms of the outer product of the bus voltage vector will become evident in Section V.


with and given by


Iii System Constraints

In the following, the formulation of physical and stability-related limits in hynet is presented. This formulation is based on [16], where the common apparent power flow limit (“MVA rating”) is substituted by its underlying ampacity, voltage drop, and angle difference constraint (cf. [28, Ch. 6.1.12]) to improve expressiveness and mathematical structure.

Iii-1 Voltage

Due to physical and operational requirements, the voltage at bus must satisfy , where . With , this reads


Iii-2 Ampacity

The thermal flow limit on branch can be expressed as and , where . In quadratic form, this renders


where are given in [16, Eq. (18)].

Iii-3 Voltage Drop

The stability-related limit on the voltage drop along AC branch , i.e.,


is , with . This is captured by


in which are given in [16, Eq. (24) and (25)].

Iii-4 Angle Difference

The stability-related limit on the voltage angle difference along AC branch , i.e.,


reads , with . Note that


is an equivalent formulation of this constraint that can be put as


with and as given in [16, Eq. (30) and (31)].

Iv Optimal Power Flow

The OPF problem identifies the optimal utilization of the grid infrastructure and generation resources to satisfy the load, where optimality is typically considered with respect to minimum injection costs or minimum electrical losses. With the system model and system constraints above, the OPF problem can be cast as the following optimization problem.


The objective consists of the injection costs and a penalty term comprising the electrical losses weighted by an (artificial) loss price , which enables injection cost minimization, electrical loss minimization, and a combination of both.

In (35), it can be observed that the objective and constraints consider AC and DC subgrids analogously, while their bus voltages are treated differently by restricting to . With respect to the Lagrangian dual domain and convex relaxations, this restriction complicates further mathematical studies. To avoid these issues, it is observed that all currently installed and almost all planned HVDC systems are P2P-HVDC or radial MT-HVDC systems [4]. This observation is formalized by the following definition and, in the next section, it is utilized to unify the representation of AC and DC voltages.

Definition 11 (Radial DC Subgrids)

The underlying undirected graph of the directed subgraph is acyclic [26], i.e., its connected components are trees [26].

Iv-a Unified Voltage Representation

To eliminate the restriction of to and, therewith, unify the representation of AC and DC voltages in the OPF problem, let (31) also be imposed on DC subgrids, i.e.,


with in (34). Jointly, Def. 11 and the complementary constraints in (36) enable the following result.

Theorem 1

Consider any and , for . Let satisfy the constraints in (35b) and (36) for the given and . Then, the bus voltage vector given by


satisfies (35b) and (36) for the given and with equivalent constraint function values and .


See Appendix A.

Considering that , Theorem 1 enables an exact state space relaxation of the OPF problem (35) to under Def. 11 and the complementary constraints (36). Thus, for radial DC subgrids the representation of AC and DC voltages can be unified, where the corresponding OPF formulation reads


Iv-B Optimal Power Flow in hynet

Concluding, to define hynet’s OPF formulation, the constraints in (38b) and the restriction of to are expressed as , where


Therein, (39d) captures (17), (26), (27), (29), (33), and (36), where , , and , , reproduce the inequality constraints. With above, hynet’s OPF formulation is defined as


Grid Database


Class Scenario

Steady-StateSystem Model

Class SystemModel

OPF ProblemFormulation

Class QCQP


Class SolverInterface

SDR Solver

SDRSolver Classes

QCQP Solver

QCQPSolver Classes

SOCR Solver

SOCRSolver Classes

QCQPResult Data

Class QCQPResult

OPFResult Data

Class OPFResult

Infrastructure AC and DC buses Lines, cables, and shunts Transformers and converters Generators and prosumers Dispatchable loads

Scenario Loads Injector capability Entity inactivity
Figure 3: Illustration of hynet’s fundamental design and data flow.

V Convex Relaxation

Due to the power balance equations and indefiniteness of some constraint matrices (cf. [16]), the OPF problem (40) is a nonconvex optimization problem and, in general, it is solved to local optimality as its globally optimal solution is NP-hard. A recent approach to improve computational tractability of a globally optimal solution of OPF problems is convex relaxation, see e.g. [29, 30, 31, 32, 33] and the references therein. In hynet, the following two popular relaxations are included, which are very simple to derive by virtue of the unified representation of AC and DC subgrids.

V-a Semidefinite Relaxation

By definition, the objective in (40) and are convex, while is a polyhedral set and, thus, also convex. Consequently, the nonconvexity of (40) arises from the quadratic dependence on the bus voltage vector . The outer product may be expressed equivalently by a Hermitian matrix , which is positive semidefinite (psd) and of rank 1. As the set of psd matrices is a convex cone, the nonconvexity is then lumped to the rank constraint. In semidefinite relaxation (SDR), the rank constraint is omitted to obtain a convex optimization problem, i.e., the SDR of the OPF problem (40) reads


Therewith, the OPF problem gains access to the powerful theory of convex analysis as well as solution algorithms with polynomial-time convergence to a globally optimal solution. However, SDR is in general only suitable if the optimizer obtained from (41) has rank 1, in which case the relaxation is called exact.

V-B Second-Order Cone Relaxation

Besides exactness, another issue with SDR is the quadratic increase in dimensionality by (real-valued) variables, which impedes computational tractability for large-scale grids. This uplift can be mitigated by an additional second-order cone relaxation (SOCR), see e.g. [29, 30, 25] and the references therein. To this end, it is observed that the constraint matrices , , and in (39) may only exhibit a nonzero element in row and column if , where


see [16, Appendix B]. If the psd constraint (41c) is relaxed to psd constraints on principal submatrices, then only those elements of that are involved in (39) need to be retained. Correspondingly, the SOCR of (41) can be stated as