An Interior-Point Solver for AC Optimal Power Flow Considering Variable Impedance-Based FACTS Devices

This work proposes a full AC optimal power flow (ACOPF) model considering variable impedance-based flexible AC transmission system (FACTS) devices, in which the reactance of lines are introduced as decision variables to minimize system operation costs, power losses, and load shedding costs. This work is motivated by increasing interest in using FACTS and Distributed FACTS (D-FACTS) devices to address system operational and cyber-security concerns in the presence of renewable energy, such as line congestion relief, power loss reduction, load curtailment reduction, and moving target defense. The proposed ACOPF model can be utilized by system operators to achieve economic and cyber-security benefits simultaneously. In addition, we build and make publicly available an open-source MATPOWER-based interior-point solver for the proposed ACOPF model through rigorously deriving the gradient and Hessian matrices of the objective function and constraints. Numerical results on an IEEE 118-bus transmission system and an IEEE 69-bus distribution system show the validity of the proposed ACOPF model as well as the efficacy of the developed interior-point solver.


I. INTRODUCTION
Smart grids are undergoing a revolution towards lowfossil electricity generation by the integration of renewable energy sources and distributed energy resources (DERs). Even though these resources can provide economic benefits and reduce emissions, the high penetration of DERs challenges power grids with a series of adverse effects due to their low dispatching capability and unanticipated power grid congestions, including line flow, reliability, and power quality issues. Specifically, integrating electric vehicle charging, utility-scale solar photovoltaic farms, and energy storage systems into modern power systems brings more uncertain and complex power flow conditions into both transmission and distribution systems [1].
Flexible AC Transmission Systems (FACTS) have proven to be effective in providing extra controllability in power system operations. FACTS devices become a part of transmission networks for various applications worldwide as they can quickly and continuously control voltages, current, and line impedances. Previous research has demonstrated that FACTS devices can reduce operation costs [2], improve reliability [3], enhance the demand response [4], and increase transmission capability [5]. Most recently, FACTS devices are used in moving target defense (MTD) to detect false data injection cyberattacks targeted on power systems [6]- [8]. MTD enhances the grid cyber-security by actively changing system configurations to prevent attackers from knowing the true system configurations.
The FACTS devices are mainly classified into series FACTS and shunt FACTS based on the way that a device connects to transmission lines. The shunt FACTS devices operate as reactive power compensators by controlling charging susceptance, while the series FACTS devices can adjust the reactance of transmission lines. Hereafter, the term "FACTS" is loosely referred to series FACTS devices in this paper, including unified power flow controller (UPFC) and thyristor controlled series compensator (TCSC). The model and formulation proposed in this paper are also applicable to the Distributed FACTS (D-FACTS) devices such as Distributed Static Series Compensators (DSSC), distributed series reactor (DSR), and distributed series impedance (DSI), and devices that can equivalently adjust the line impedance, such as Smart Wire Grid device [9].
As system operators can utilize FACTS devices to control power flows, relieve congestions, and reduce power losses, it is necessary to integrate the coordinated control of FACTS devices into the mathematical model of real-time operations. Optimal power flow (OPF) models are an indispensable real-time system operation tool to minimize system operation costs and maintain reliable grid operations. Previous research in the literature has worked on the inclusion of FACTS models into OPF tools in both DC and AC models. Ding et al. [10] presented a DC optimal power flow (DCOPF) with FACTS devices, in which the original non-convex model is transformed into mixed-integer quadratic programming (MIQP) based on the big-M based complementary constraints. It further studied the impact of FACT devices on system generation costs. As the complexity of DCOPF with the FACTS model is the primary barrier for dispatching the impedance in real-time operation, Ardakani et al. [11] converted the nonlinear program (NLP) into a mixed-integer linear program (MILP) to approximate the optimal solution. However, the DCOPF models neither lead to an accurate power flow solution, especially when an operation point is far away from the "flat start", nor capture system loss reductions caused by FACTS devices, which is one of the main benefits of FACTS devices.
Song et al. [12] reformulated the ACOPF model considering FACTS devices as a semi-definite program under the existing convex relaxation framework by treating a line with flexible impedance as a constant-impedance line with a correlated pair of tap-adjustable ideal transformers. However, line resistance is ignored in the model. In [13], voltage-actor FACTS devices such as Phase Shift Transformer (PST) and the UPFC were modeled and incorporated in the rectangular ACOPF model. Kumari et al. [14] proposed a power injection model (PIM) to model all features of any type of FACTS devices, in which active and/or reactive power injections of FACTS devices are considered as independent control variables. Then, an ACOPF model with PIM is proposed to minimize the total deviation from the prescribed control targets of active and reactive power flow and voltage. Xiao et al. [5] integrated the PIM model of FACTS devices into the OPF model with the objective to maximize the uncommitted active transfer capacity of a prescribed interface. However, an ACOPF model considering FACT devices with traditional OPF objectives, such as generation costs, power losses, and load shedding costs, is still missing in the literature. To fill this gap, this work proposes an ACOPF model with a variable impedance-based FACTS model, in which the reactance of lines equipped with FACTS devices are introduced as decision variables. The proposed ACOPF model can be applied in the control center to minimize generation costs and system losses in real time. In addition, it can dispatch FACTS devices to minimize the load shedding when it deems necessary for ensuring system reliability.
While controllable line impedance facilitates the flexibility of modern power grids, it also brings much complexity to the concerned optimization problems. An efficient solver for ACOPF models considering FACTS devices is critical for this real-time operation. Intelligent computational algorithms have been used to resolve the ACOPF model considering FACTS devices, such as genetic algorithm [15], particle swarm optimization [15], gravitational search algorithm [16], differential evolution [17], fuzzy goal programming [18] and chicken swarm algorithm [19]. Even though these algorithms can solve the optimization problem without deriving the gradient and Hessian matrices, the low computational efficiency of these algorithms represents a major issue in real-time operations. Learning-based approaches have been leveraged to solve the OPF problem recently. The work in [20] developed the first deep neural network (DNN)-based scheme to generate feasible and close-to-optimal solutions for the DCOPF model. The work [21] designed a DNN scheme to generate solutions to the ACOPF model without considering the line flow limit constraints. Pan et al. developed a DNN approach for solving the ACOPF model, which preserves the power flow balance equality and reduces the number of variables to predict [22]. In addition, learning-based methods are utilized to facilitate the solving process for the OPF problem, such as reducing the problem size [23], [24], finding warm-start points [25] and speeding up the iterations [26], [27]. However, those approaches have not been applied to solve the OPF model considering FACTS devices. On the other hand, interior-point methods are proven to be among the most efficient tools to resolve ACOPF problems [14], [28]- [30]. Therefore, this work develops and makes publicly available an open-source interior-point solver for the proposed ACOPF model by modifying and extending Matlab Interior-Point Solver (MIPS) in MATPOWER developed for the conventional ACOPF [31], [32]. Specifically, this work derives the gradient and Hessian matrices in polar coordinates required by the interior-point solver. Since MATPOWER is one of the most popular power system simulation tools used by power system researchers, educators, and professionals, it is believed that such an open-source solver will promote the research and development on the application of FACTS devices. The contributions of this paper are summarized as follows:  Based on our preliminary work [30], we propose an ACOPF model considering variable impedance-based FACTS devices in polar coordinates, which takes the impedance of lines as independent variables and minimizes the weighted sum of generation costs, power losses, and load shedding costs. The model can be used in both transmission and distribution systems.  This work mathematically derives the gradient and Hessian matrices of the objective function and constraints in the proposed ACOPF model with respect to line impedance variable and load curtailment variable, respectively.  This work modifies MIPS in MATPOWER and makes this new solver publicly available in [33] to resolve the proposed ACOPF model.  This work evaluates the performance of the proposed ACOPF model and the interior-point solver on an IEEE 69-bus distribution system and an IEEE 118-bus transmission system. The case studies demonstrate the impact of FACTS devices on reducing generation costs and system losses. Particularly, this work evaluates the performance of the proposed ACOPF model when the under-voltage load shedding occurs in the distribution system and the under-frequency load shedding occurs in the transmission system.
We utilize the block diagram to summarize the characteristics of the proposed ACOPF model and the developed interior-point solver in Fig. 1, in which the contributions of this paper are highlighted in boldface. The rest of this paper is organized as follows. Section II presents the formulation of the ACOPF model considering load shedding and FACTS devices. In Section III, gradient and Hessian matrices of the proposed model are derived for the developed interior-point solver. Case studies are conducted to study the impact of FACTS devices on reducing generation costs, power losses, and load shedding in Section IV. The paper is concluded in Section V.

II. PROBLEM FORMULATION
This work proposes an ACOPF model considering the load shedding and FACTS devices, which minimizes the weighted sum of generation costs, system losses, and load shedding costs as follows: , ref ref x , 1,...., (1j) , and L S is complex load curtailment. Cg is a generator connection matrix in which its element (i, j) is one, if Generator j is located at Bus i, and zero otherwise. Similarly, Cs is a load shedding connection matrix, in which its element (i, j) is one, if j-th load curtailment variable is located at Bus i, and zero otherwise. Constraint (1b) defines the complex load curtailment L S in which the reactive power load curtailment is proportional to the active power load curtailment with a fixed power factor  . Constraint (1c) defines the system complex power loss ( ) L X as the sum of complex power loss of each line, and the line power loss is the sum of complex power flows at the from-end and to-end of this line, where 1 l n     1  . Note that f S and t S are the vector of complex power flows at the from-end and to-end of all lines, respectively. Inequality constraints (1d) and (1e) are two sets of line flow limits, i.e., one set for the from-end and one for the to-end of each branch, respectively. This paper considers the active line power flow limits, i.e., ( , , ) and max F represents the maximum active line power flow. Constraint (1f) ensures the voltage angle of the slack bus is a constant value; Constraint (1g) is the voltage magnitude constraints; Constraints (1h) and (1i) are generator constraints; Constraint (1j) defines the operation range of line reactance due to the physical capacity of FACTS devices. For Line i, the maximum and minimum of line reactance are calculated as max 0 FACTS magnitude  could be 0.8 [11]. Constraint (1k) is the load shedding constraint, indicating a limitation can be enforced on the maximum amount of load curtailment. As the load curtailment cost is much higher than the generation costs and system losses, it is suggested to set w3=1 and then adjust w1 and w2 accordingly. Generally, the value of the generation cost is much larger than the value of the system loss. In this case, if we set w1=1, a two order of magnitude larger w2 is recommended, such as 100. Without considering the load curtailment, increasing weight w2 leads to a decrease in power losses but an increase in generation costs, as shown in the case study in Section IV. A.

III. SOLUTION METHODOLOGIES
As the MIPS in MATPOWER derived the gradient and Hessian matrices in the conventional ACOPF model based on polar coordinates and complex power using complex matrix notation [31], this work follows suit and extends the interior-point solver for the proposed ACOPF model. Specifically, this work derives the gradient and Hessian matrices of nonlinear equality constraints, inequality constraints, and objective function with respect to active power load curtailment and the line reactance.

A. PRELIMINARIES IN ACOPF MODEL
In this subsection, the basic definitions, operations, and derivatives in MIPS [31] are provided as the preliminaries for the follow-up derivations. Let V be a vector of complex voltages of all buses. Then, the first derivatives of V with respect to voltage angle and magnitude are derived as follows: where θ is a vector of voltage angles; υ is a vector of voltage magnitude;  is a diagonalizable operator defined in [31], which converts a vector to a diagonal matrix, i.e., [ ] : .
As the nodal admittance matrix plays an important role in deriving the gradient and Hessian matrix with respect to line reactance, its definition in MATPOWER is presented as follows: According to the definition of , , ff ft tf Y Y Y and tt Y , their gradient with respect to line reactance are diagonal matrices and their diagonal entries can be calculated as follows: Similarly, the Hessian matrices of , , , diagonal matrices whose diagonal entries can be calculated as Note that the first and second derivatives of the admittance of shunt elements with respect to reactance are zero matrices, i.e., The subscripts of the gradient and Hessian matrices of all admittance matrices with respect to the line reactance are ignored hereinafter for simplicity, i.e.,

C. THE GRADIENT OF POWER INJECTION CONSTRAINTS
The complex power balance equations can be expressed as The gradient of power balance equations can be expressed as follows: where the first four blocks ( , , G G G g θ ν P and G g Q ) are the same as those in the conventional ACOPF model, which can be found at (27)- (33) in [32]. For the proposed ACOPF model, we need to derive the blocks G x and L G P , i.e., the gradient matrix of power balance equations with respect to line impedance and active load curtailment, respectively. According to the definition of load curtailment In the calculation of G x , we find that Bus S is the only matrix in the complex power balance equations that is related to the line impedance. This is because nodal power load D S is a fixed vector, power generation vector G S is the decision variable, and load curtailment vector L S is the decision variable. Therefore, it indicates * *

D. THE HESSIAN MATRIX OF POWER INJECTION CONSTRAINTS
The Hessian matrix of complex power balance constraints in the proposed ACOPF can be calculated using (17). It is necessary to note that Hessian blocks related to power load curtailment are zero matrices. In addition, Hessian blocks related to power generation and line reactance also are zero matrices including , , , where  is a constant vector for calculating the Hessian matrix; the expressions of , G θθ , G θν G νθ and G νν can be found in [31].
, , , , G G G G xx xν xθ θx and G νx need to be derived for the proposed ACOPF model. Due to the space limit, this work ignores the derivation process and directly presents the calculation results. First, this work calculates G xx based on G x in (16).
E. THE GRADIENT OF POWER FLOW CONSTRAINTS VOLUME XX, 2017 9 The complex power flow f S is a nonlinear function of nodal voltage angle, voltage magnitude and line reactance, i.e., This work derives the gradient matrix of the complex power flow at the from-ends of the lines. Note that the derivative results for the to-ends of the line can be identically calculated by replacing all f sub/super-scripts with t. Similar to power injection constraints, the first derivatives of the power flow with respect to voltage angle, voltage magnitude, real and reactive power generation are identical to that in [31]. Thus, this work only derives the first derivatives of power flow with respect to line reactance and load curtailment as follows:

F. THE HESSIAN MATRIX OF POWER FLOW CONSTRAINTS
The Hessian matrix of complex power flow constraints in the proposed ACOPF has the same form as that of power flow constraints in (17     f f

G. THE GRADIENT AND HESSIAN MATRIX OF OBJECTIVE FUNCTION
In this section, the gradient and Hessian matrix of the objective function are derived. To focus on the derivation, we neglect the weights  in the objective function. Let function   F X to represent the objective function in the proposed ACOPF model. The gradient of the objective function can be calculated as follows: The Hessian matrix of the objective function has the same form as that of power injection constraints in (17). Note that all blocks related to load curtailment are zero matrices, and blocks of generation costs related to line reactance are zero matrices. For example, Fxx can be calculated as follows: x S S holds according to (25).
Similarly, the remaining non-zero matrix blocks in the Hessian matrix can be calculated as follows: The remaining matrix blocks related to voltage magnitude and angle are identical to the results in [31].

H. THE EXTENDED INTERIOR-POINT SOLVER
This paper extends the primal-dual interior-point method [32] to integrate the FACTS devices into the ACOPF model. The method [32] converts inequality constraints in the ACOPF model into equality constraints using slack variable Z. Then, it uses the Newton method to solve decision variable X, slack variable Z, and Lagrangian variables λ and μ in the KKT condition. The extended MIPS in this paper is shown in Algorithm 1. The algorithm first calculates the gradient matrix and Hessian matrix based on the derived equations in this paper. Then, the incremental of four variables are computed using the gradient and Hessian matrices. Next, the algorithm updates four variables and four condition parameters defined in [32]. The algorithm repeats the above process until the four condition parameters are all less than the stop criteria.

IV. CASE STUDY
To validate the proposed ACOPF model and the developed interior-point solver, we conduct case studies on an IEEE 69-bus distribution system and a modified IEEE 118-bus transmission system [34]. The algorithms are performed on a laptop with an Intel Core i7 processor CPU 2.90 GHz with 8 GB RAM.   is adopted. Table I presents generation costs, active power losses, and CPU time under different flow limit conditions. It is observed that generation costs in the proposed ACOPF in Cases 1 and 2 are always less than that in the conventional ACOPF since line reactance is adjusted to relieve the congestions in the system. In addition, the system loss in Case 2 is less than that in Cases 0 and 1, indicating the effectiveness of the proposed ACOPF model in minimizing system losses. Case 2 has lower power losses but higher generation costs than Case 1. It indicates that increasing weight w2 leads to a decrease in power losses but an increase in generation costs, which presents a trade-off between the generation costs and power losses. As the CPU time for resolving the proposed ACOPF model is less than 15 seconds in most cases, the proposed ACOPF model and the modified interior-point solver can be applied in real-time system operations. This work focuses on comparing generation costs under the following three cases in the condition of the heavy load without considering system losses and load shedding. The base case (Case 0) is the system free of FACTS devices, and its generation cost is calculated by the conventional ACOPF model. Case 1 is the system with FACTS devices adopting random setpoints and its generation cost is calculated by the conventional ACOPF model. Case 2 is the system with FACTS devices adopting optimal setpoints and its generation cost is calculated by the proposed ACOPF model. For Case 1, 500 setpoint vectors are randomly generated using the same FACTS magnitude used in Case 2, i.e., 50%   . Note that one setpoint vector determines the setpoints of all FACTS devices in the system. As the system in the base case is operating with multiple line congestions, there are 130 setpoint vectors leading the conventional ACOPF model to fail to find feasible solutions. It indicates that optimal adjustment of the line impedance can convert some infeasible optimal power flow scenarios to be solvable, consistent with the conclusion in the DCOPF model considering FACTS devices [10].
The histogram of generation costs in the remaining 352 vectors is shown in Fig. 2, where the generation costs obtained by the proposed OPF and conventional OPF without FACTS devices are represented by dashed and solid lines, respectively. It is seen that system with random FACTS setpoints may increase or decrease the generation costs compared with that in the based case. But, generation costs in the systems with random FACTS setpoints are always higher than the generation cost obtained by the proposed model. It validates the effectiveness of the proposed OPF model and the interior-point solver in minimizing generation costs. VOLUME XX, 2017 9 Then, this work compares power loss in the previous three cases under the heavy load condition without considering generation costs and load shedding. Note that the objective function of the conventional ACOPF model is merely minimizing power losses. The histogram of power losses in the conventional OPF with 351 randomly selected FACTS setpoints vectors is shown in Fig. 3. Note that 149 random setpoint vectors in the total 500 vectors cause the conventional ACOPF model not to converge, which are excluded in the histogram. Power losses in the proposed model are always lower than that in the OPF model using the random FACTS setpoints, which validates the effectiveness of the proposed model in minimizing the power losses. This work further evaluates the effectiveness of line power flow constraints in the proposed ACOPF model. Figure 4 shows the active power flow and flow limit of each line in the IEEE 118-bus system. It is seen that the power flows are always no more than power flow limits. The power flows of most lines are lower than their limits, while the power flows of some lines reach their limits, which verifies the effectiveness of line power flow constraints.

B. IMPACT OF FACTS DEVICES ON GENERATION COSTS
In this section, the impact of FACTS devices on generation costs is assessed in a modified IEEE 118-bus transmission system under light and heavy load conditions, respectively. To concentrate on the impact of FACTS devices on the system generation cost, we only minimize the generation cost without considering power losses and load shedding. The default load in the MATPOWER 118bus system is adopted as the heavy load with modified line flow limits. For the light load, this work reduces the nodal load by 50% while maintaining the same line flow limits. Analogously, all transmission lines are assumed to be equipped with FACTS devices.
The FACTS magnitude is increased from 0 to 0.8 with an incremental of 0.1. The generation costs under these FACTS magnitudes under the light and heavy load conditions are shown in Fig. 5 and Fig. 6, respectively. It is shown that generation cost decreases as the FACTS magnitude increases in both heavy and light conditions. When system operators adopt 0.8 FACTS magnitude, FACTS devices decrease the generation cost by 2.9% under the heavy load condition and by 0.87% under the light load condition. When more line congestions occur in the system, FACTS devices can reduce more generation costs. Generation cost ($)

C. IMPACT OF FACTS PLACEMENTS ON SYSTEM LOSSES
The effectiveness of the proposed ACOPF model is evaluated by investigating the impact of FACTS placement on system losses without considering the generation cost and load shedding. As power loss to impedance sensitivity (PLIS) is a linearized metric to measure the system loss change due to the line impedance change [2], PLIS is used to determine the most appropriate lines to install FACTS devices. The following five FACTS placements are constructed: Case 0: the base case with no FACTS devices.  Table II summarizes PLIS of the lines equipped with FACTS devices, system losses, and the loss reduction in the above five FACTS placements under 0.2 FACTS magnitude. It is seen that the maximum number of FACTS devices in Case 4 contributes to obtaining the lowest system losses. Case 3 can reduce 1.52% of system loss compared with that in Case 0, which is much higher than the system loss in the random FACTS placement and the lowest PLIS FACTS placement. The comparison in Table II illustrates that the loss reduction increases with the increase in PLIS values, which is consistent with the conclusion in [2]. After the load shedding, the voltage magnitude under these two models both satisfy the voltage magnitude requirement, as shown in Fig. 8. Figure 9 demonstrates the line reactance dispatched by the proposed model. As seen, the proposed model reduces the reactance of most lines in this distribution system, which is quite different from the pattern of dispatched line reactance in the transmission system in Fig. 7. Those differences can be explained by looking into the fundamental differences between transmission and distribution systems. In general, a reduced line reactance would increase the power transfer capability and reduce the power losses of lines, which in turn decreases the load curtailment. Due to the radial structure of the distribution system, the proposed model decides only to reduce the line reactance. The reduction in line reactance, in turn, increases the power transfer capability of lines, decreases the power losses, and reduces the load curtailment. In contrast, the pattern of dispatched line reactance is not apparent due to the existence of loops in the transmission system with a high x/r ratio. Furthermore, it is illustrated in Table III, when the load of Bus 65 is scaled up by k times, a larger FACTS magnitude contributes to a greater reduction of load curtailment as opposed to the system without FACTS devices.  A case study is conducted to evaluate the effectiveness of the power balance constraint (1a) by investigating all nodal power components in multiple buses. Table IV and  Table V summarize the active and reactive nodal power components in generation Bus 1, load Buses 7, 12, 61, and 69, respectively. Note that load curtailment occurs in Bus 69 with a 0.7 power factor, i.e., 0.7

 
in (1b). The last column G in these two tables represents active and reactive power mismatch, respectively, i.e., . It is seen that active and reactive power mismatch are both close to zero, which verifies that the power balance constraint is satisfied.  The case study compares generation costs, system losses, and CPU time between the proposed and conventional ACOPF models under different power flow limits. The simulation results show that the CPU time of solving the proposed ACOPF is generally less than 15s. The FACTS devices can effectively reduce generation costs and power losses, and both of which decrease as the FACTS magnitude increases. In addition, simulation results show that the proposed ACOPF model can reduce the amount of load curtailment via FACTS devices under both the undervoltage load shedding and under-frequency load shedding conditions. Numerical results verify the validity of the proposed ACOPF model and the effectiveness of the interior-point solver. The proposed ACOPF model and the interior-point solver can be seamlessly integrated into the energy management system of a power grid to ease system operational issues and implement MTD by optimally dispatching FACTS devices. In future work, it is worth exploring how to integrate advanced and latest power system devices into the OPF model, such as power electronics converters and power factor corrections.