Predispatch of hydroelectric power systems with modifications in network topologies

Electric grids are operated to ensure the provision and supply of electric power under suitable conditions at a minimum cost. However, the need for maintenance and repairs to equipment and transmission lines employed in the electric grid is constant and increasingly frequent; therefore, studies are necessary in the operational area in order to analyze and to enable the required services. Manipulations in an electric grid are necessary in order to allow preventive or corrective maintenance on the grid, thereby ensuring system operability. In this study, the primal-dual interior-point methods are used to minimize costs and losses in a predispatch model for the generation and transmission of direct current (DC) power flow in a hydroelectric system with pre-programmed manipulations; i.e., in cases of preventive maintenance, within a period of 24 h. From the computational standpoint, the effort required to solve a problem with and without manipulations is similar, and the reasons why will be also discussed in this study. Computational results corroborates these findings.


Introduction
In an electric power system, operating conditions are constantly evolving; accordingly, maintenance services must be performed to avoid short-circuits and overloads. Scheduled shutdowns are recommended when system maintenance is necessary. These actions should be planned in order to ensure the supply of electric energy with few interruptions and for the shortest time possible, while maintaining the quality levels established in the legislation governing the electricity sector. This paper develops a methodology based on interior point concepts for the short-term optimization of power flows and generation inputs under the constraints given by scheduled shutdowns and maneuvers. The Brazilian power system is predominantly hydroelectric. The system interconnect several hundreds of generating units with thousands of kilometers of high voltage transmission lines. Coordinating the operation of such a power system is a very complex task. In essence, the planning is divided into a chain of three main stages. The first one, called long-term planning, deals with the addition of new generation plants and construction of transmission lines. The second stage, medium-term planning, provides a monthly planning for the level of the reservoirs. This information is further refined for each unit in a short-term planning, considering weekly, daily and hour targets for each generation plant. The entire planning chain is supported by optimization techniques, which aim to provide the best possible use of renewable resources while decreasing losses in the transmission networks and reducing the generation costs (Terry et al. 1986).
This work addresses the problem called predispatch, which defines the hourly generation schedule of each plant over a 24 h time frame, given the daily targets for hydroelectric plants provided by the upper level planning, the load forecasts for each hour, the detailed information about the transmission network and the operation costs for all available non-hydraulic plants.
The occurrence of scheduled or emergency interruptions in the power system requires isolation of some lines and equipments, and restoration maneuvers on the transmission network, which leads to changes in the configuration of the network throughout the day. All these operations must take into account the stability of the whole system and comply with the electrical requirements and criteria regulated by government agencies, or by the the power utilities. Previous contribution to the predispatch problem do not address these changes in configurations (Soares and Salmazo 1997;Oliveira et al. 2003Oliveira et al. , 2005. Therefore, the optimized schedules provided by these approaches require heuristic adjustments, which lead to higher costs in the effective implementation of the solutions. The approach proposed in this paper innovates by formally considering in the optimization process of the predispatch problem all changes in configurations due to the shot down and restoration maneuvers of lines and equipments. In order to address this highly constrained predipatch problem it relies on the efficiency and robustness of the interior-point methods (Garzillo et al. 1999;Momoh et al. 1999;Quintana et al. 2000). It presents improvements over a preliminary study about this problem (Carvalho and Oliveira 2015), which are achieved through a deeper exploitation of the matrix structures that result from the constraints of the system.
Next section presents the standard formulation for the predispatch problem and discusses the main ideas for addressing the problem with the primal-dual interior-point method. Section 3 presents the new developments for considering the changes in configurations due to the shot downs and restoration maneuvers. Section 4 describes some heuristic procedures that enhances the optimization process. Numerical Experiments are presented in Sect. 5. Conclusions follow.

The predispatch problem
As observed in the previous section, the objective of the predispatch schedule is to meet over a short-term period the generation targets that have been defined in the long-term planning. It should consider a more detailed representation of operational constraints and meet the longterm objectives with the lower possible costs. Flow restrictions in the predispatch can be divided into blocks that repeat themselves over each time interval of the planning periodthis paper considers the planning period of a day, divided into 24 intervals of 1 h. The constraints are defined by the Kirchhoff laws, by the bounds on flows, by the bounds on generation outputs, and by the targets settled by the long-term planning (Ohishi et al. 1991). The predispatch models usually adopt the linear representation for power flow equations called DC power flow models. This representation is a good approximation of the nonlinear flow equations adopted in real time models and offer considerable analytical and computational advantages (Stott et al 2009).
The standard predispatch problem for a system with m buses, n lines and g generators can be modeled as follows (Oliveira et al. 2005). where: f k ∈ R n×1 represents the power flow variables at the interval k; p k ∈ R g×1 represents the generation inputs at the interval k; -Q ∈ R g×g is the diagonal matrix of the generation costs quadratic term; -R ∈ R n×n is the diagonal matrix that represents the resistances of transmission lines; d k ∈ R m×1 represents the loads at interval k; -X ∈ R n−m+1×n represents the network loop reactance matrix; -E is a matrix of dimension m × g; each column of E contains a single nonzero entry associated to the position of a generator in the network; -A ∈ R m×n is the incidence matrix that represents the lines in the transmission network; c T ∈ R g×1 is the vector associated to the linear terms of the generation costs; f max , f min , p max and p min ∈ R g×1 are the bounds for the power flows and generation values; -α and β are constants associated to energy prices and unit transformations; q ∈ R g×1 represents the generation targets; k represents each one of the 24 h intervals.
In this model, the two objective function components are quadratic with separable variables. The first component represents the value of the transmission losses. The second component characterizes the generation cost of power plants (Soares and Salmazo 1997).
Problem (1) may be simplified by using changes in the variables (Oliveira et al. 2003) and adding slack variables, thus we have the primal problem in its standard form: whose respective dual can be written as: Matrix B, formed by the juxtaposed rows of the incidence and reactance matrix, is no longer constant throughout the time intervals k, which may be partitioned as: In more detail: Where, and, With this partitioning, the columns of the incidence matrix A are divided so that T contains the edges of a spanning tree and N is formed by the remaining edges, which belong to the cotree (Ahuja et al. 1993); the reactance matrix X is divided similarly. Matrices B and E vary according to the time intervals (B k and E k ), reflecting the modifications to the networks and buses by the manipulations carried out throughout the study window. The reason why these matrices vary according to time intervals is that the network is no longer constant throughout these t intervals; every time there is a manipulation, the matrix B formed by the juxtaposed rows of the incidence and reactance matrix and the matrix E of order m × g should vary in accordance with the changes imposed on the network.
The matrix B has full rank and it is sparse. In Sect. 3 these characteristics will be exploited efficiently (Oliveira et al. 2003).
The primal-dual interior-point methods consist of the application of Newton's method to the optimality conditions; therefore, the following linear system is obtained: when several variable substitutions are made, we get: By eliminating the dy k f from the first equation of the previous system and replacing it in the second equation, we get: The direct solution of the linear system (9) requires a large computational effort, because the blocks M = B(D k f ) −1 B T + D k have the dimension of transmission lines and the dy a dimension is given by the of number of generators. A more efficient solution, inspired by (Oliveira et al. 2005), will be developed for the model with topology network modification.
Next section describes a set of developments that allow to efficiently consider in the predispatch problem the necessary maneuvers faced by the daily system opetation planing of the Brazilian Independent System Operator (ONS).

Transmission line and bus manipulations
As previously mentioned, the maneuvers may occur due to momentary unscheduled interruptions, or to meet the needs of network maintenance and transfers of loads, feeders and substations. The Brazilian Independent System Operator is responsible for executing, authorizing and overseeing the manipulations and scheduled or emergency services of the electricity transmission system. It monitors and gives the guide lines for the operation of the interconnected Brazilian electric system and for restoring the system in the event of simple and generalized contingencies. Such activities, carried out in real time, cover the orientation on the execution of any maneuver that may be required, aimed at ensuring the integrity of people and facilities, and at keeping the system reliability and quality of supply.
Four to six maneuvers are typically executed each day in the main Brazilian interconnected power system. The changes considered herein will be preventive maneuvers, i.e., those changes that allow maintenance to be carried out, in order to avoid power interruptions. The goal is to meet all the loads at the lowest possible cost, taking into account the varying constraints on transmission lines and power generation plants.
Three types of manipulations will be considered in this study: -line manipulations; -bus manipulations; -simultaneous line and bus manipulations.

Line manipulations
Line manipulations represent the shutdown or return to operation of certain transmission lines. When a line manipulation is executed, a branch is removed from the system and the network topology is modified. Algebraically, a column from the incidence matrix, concerning the branch manipulated, and a row from the reactance matrix are removed (Carvalho and Oliveira 2012).

Predispatch model with line manipulation
The predispatch problem complies with a model involving repetitions in k time intervals, which characterize the study window. The predispatch problem with manipulations can be formulated in the standard form as: This problem is similar to the case without manipulations (1). However, matrices B and E vary according to time intervals (B k and E k ), reflecting the modifications to the networks and buses by the manipulations executed throughout the study window.
The following sections detail the aspects exploited, taking into account the different types of manipulations.

Study of matrix structure for the problem with line manipulations
We assume that the preprogrammed manipulations i occur along the time intervals k, where each time interval corresponds to a period of 1 h.
Matrix B, formed by the juxtaposed rows of the incidence and reactance matrix, is no longer constant throughout the time intervals t. Each time a manipulation is executed, a row and a column from matrix B are removed (inserted). In case there is more than one manipulation in the same time interval, a larger number of rows and columns from matrix B is removed (inserted).
When we consider a system with manipulations at different time intervals, we will use the following notation: As the dimension of matrix B can be modified according to the maneuvers, the system must be adjusted to take into account these alterations; in other words, before the execution of the products and summations with B, the dimensions and structures of the other matrices in the system (arising from the characteristics of B) must be modified.
As previously observed, matrix B can be decomposed according to (4), (5) and (6). The columns of the incidence matrix A are divided so that T contains the edges of a spanning tree and N is formed by the remaining edges, which belong to the co-tree (Ahuja et al. 1993). The reactance matrix X is partitioned in a similar manner. Figure 1 illustrates the nodes and edges of an electric system, where the rows in bold represent a spanning tree and the other lines are its additional edges. Figure 2 illustrates the planned maneuvers is the system, where the dotted lines represent the branches of the system to be disconnected, whose incidence matrix is shown in Fig. 3.

Solving the predispatch problem with line manipulations
Next we will study the consequences of the line manipulations in the matrix structure. We have observed that, in Eq. (8), which does not consider manipulations, the matrix is square and has the dimension (n + 1) × (n + 1), where its first m lines constitute the diagonal matrix (D k p ) −1 , while the remainder of its elements are null. The matrices that are affected by the change in dimension of B are E, D k f and D k . Thus, when performing the manipulations in the system, Eq. (11) will be the following: The matrix M is calculated according to Eq. (12), The direct resolution of system (12) requires significant computational effort, because the matrix M has the dimension of the number of rows, while d ya has the dimension of the number generators. An efficient solution can be obtained with the following sequence of steps (Oliveira et al. 2003): Step 1 Consider the nonsingular matrixB k = [B k e j ], where e j is the corresponding canonical vector.
Step 2 In order to replace B k byB k in (12) we add a row and a column to D k f , whose diagonal entry came from D k j j .
Step 3 Position j should correspond to a generating unit. Therefore, such diagonal entry is not null. Thus, D k is replaced byD k . The only difference between than is thatD k j j is null. The right hand side could be rewritten in a similar way: Step 4 We define: This system is solved in two steps (Carvalho and Oliveira 2009): 1. We will first solve the following linear systems It is important to note that we are assuming that in the time intervals k there there are i planned manipulations; i.e. the matrices B k and B k T vary throughout the interval as a function of the number of manipulations. Vector dŷ is easily computed sinceB k is square, nonsingular, does not change with the optimization method iteration, and its LU factorization can be computed beforehand. Namely, we can write: Note that every matrix in such equation is square and nonsingular. 2. The Sherman-Morrison-Woodbury formula (Duff et al. 1986) is used for the calculation of the inverse of matrix M k : where U and V are matrices of dimension p ×q and S has the dimension q ×q. Adapting to our problem, we have C = B k D k f B k T and U SV T = D k .
Observe that: -S is a g × g diagonal matrix, whose diagonal entries correspond to the nonzero entries ofD k . -U is formed by columns from the identity matrix; -V T = U T . Therefore, ( M k ) −1 is written as: where, Note that Z is a symmetric positive-definite matrix, with dimension equal to the number of generators. Therefore, the calculation of Z is not costly, as the matrix allows the application of Cholesky decomposition and has relatively small dimension.
Multiplying the Sherman-Morrison-Woodbury equation by r k , we have: Note that the matrices B k = L k U k can be factored before starting the iterative process, in a similar way to what can be accomplished with matrix B, in the case of the problem without manipulations.

Bus manipulations
A bus manipulation occurs when generators or loads are disconnected or connected from the system. The loads have variations that are not always predictable over time, which is a factor that can hinder system modeling.
Unlike line manipulations, in bus manipulations we cannot choose branches that belong, or not, to the spanning tree, because, obviously, when disconnecting a bus, lines from the spanning tree and the additional edges must be disconnected. To prevent damage to the structure of the system, we chose to execute manipulations only on buses with a degree of less than two (only one edge of the tree touching it). Again, it is easy to change the heuristic in (Oliveira et al. 2005) to get trees with these characteristics.
We assume that n-edges touch on the bus to be operated, then n-rows and columns from B and one more line from the incidence matrix A = [T N] should be removed.

Solving the predispatch problem with bus manipulations
The manipulations involving generation buses and loads are similar to line manipulations. But in this case, the study of the matrix structure of the problem associated with these manipulations must also be executed in the spanning tree. When there are bus manipulations at different time intervals, there is a modified network topology. Therefore: In this study, we decided to consider only bus manipulations whose modes associated in the tree have a degree of less than two; that is, the manipulations are carried out in the leaf of the tree. This prevents the system from being disconnected, which occurs mostly in small problems. Thus, in Fig. 1, the only buses that can be disconnected are C and E. Assuming that bus E has been chosen, the changes in the incidence matrix are shown in Fig. 4. The columns and row featured must be removed from the matrix.
In the incidence matrix, the columns relating to branches that are connected to the bus will be disconnected. Note that by removing these columns, the incidence matrix is replaced by a null line; therefore, this line is also removed from the matrix.
The changes in the reactance matrix are illustrated in Fig. 5. Note that we only have to search for the nonzero element in the column of the branches of the additional edges and remove the reactance element associated with it, similar to the case with line manipulations. This approach to the problem involves no loss of generality. In fact, if necessary, we can manipulate a bus that corresponds to a node of the tree of degree 2. The next step is to execute line and bus manipulations in the same time interval.

Bus and line manipulations executed simultaneously
The bus and line manipulations executed simultaneously characterize more complex changes in the network. In these cases, a greater number of rows and columns from the incidence matrix and their respective reactances are removed from matrix B, formed by the incidence and reactance matrices of the system. Assuming, for example, the a manipulation on bus E is executed and the branch C−D is disconnected in this same period in the network in Fig. 1. Figures 6 and 7 highlight rows and columns to be removed from the incidence and reactance matrices, respectively. When a manipulation is executed where p edges address the manipulated bus and, at the same time, a line manipulation occur, matrix B will have p + 1 rows and p + 1 columns removed.
Bus manipulations will be executed in buses with a degree less than two, and operated lines should belong to the matrix of additional edges.

Fig. 6
Rows and columns to be removed from the incidence matrix Fig. 7 Rows and columns to be removed from the reactance matrix a spanning tree with additional edges. Thus, it is possible to have a reactance matrix whose structure can be effectively exploited.
The reactance matrix is denoted by [X T X N ], where the sub-matrix X N is diagonal and represents the edges of the co-tree. It is known that the sparseness of the reactance matrix depends on the circuits adopted in its construction. The purpose of the following heuristic is to build a sparse reactance matrix: -We choose the bus with the higher degree as the root, and all of its neighbors as children; -The remaining neighbor buses from the greater degree of leaves are then added to the tree; -The procedure is repeated until all buses are part of the tree.
Thus, we have attempted to build a tree with a small depth. The circuit obtained adding a line that does not belong to the tree and form the reactance matrix. In a shallow tree, these ties tend to contain few buses, resulting in a sparse matrix. Note that each additional edge also belongs to a single circuit; that is, X N is diagonal. Finally, considering that X N is diagonal, the reactance matrix has linearly independent rows and, since there are n − m + 1 matrix out of the tree, we obtained the number of equations needed to form X (Franco et al. 1994).

Numerical experiments
In this study, the information about all planned maneuvers is given as input data. Thus, the changes that occur in the matrices are known before and can be studied before the beginning of the iterative process. Without loss of generality, it is possible to use a heuristic for the construction of the spanning tree, in order to ensure that the branches to be manipulated will always belong to the co-tree (Oliveira et al. 2003).
For both line and bus manipulations, the matrix B k is stored for subsequent calculations of the resolution of linear systems of the interior-point method. However, only the branches that are active in the system are stored, i.e., the columns of the matrix N which are connected in a specific period of time.

Test systems
The networks in which the tests were executed include the IEEE30 and IEEE118 systems representing the American Midwest, South-Southeast-Center-West (SSECO) Brazilian systems with 1654 and 1732 buses and the Brazilian systems composed of 1993 and 3511 buses. The largest system, with 3511 buses, has 4237 branches.
In the computational experiments executed herein, we used the primal-dual interior-point method and carried out tests with the number of manipulations ranging from zero to six in one day, which is a common occurrence in the main Brazilian interconnected power system.
The implementation was developed in Matlab 7.0 with accuracy of 10 −3 (to consider the optimal conditions of the problem satisfied), using a 2.5 GHz Intel Core i5 processor, with 4 GB 1333 MHz DDR3 memory.
The tests carried out used the starting point shown in Eq. 14:

Computational results for line manipulations
The number of iterations necessary for convergence may vary significantly, depending on the branch that is being manipulated. If a branch with a high flow is disconnected, the method has a hard time to find a new way to meet the demand, reflecting on the number of iterations and, consequently, on the computational time. However, other reasons may be responsible for this increase, because depending on the branch that is being manipulated and its resulting network, the adequacy of the system may not be efficient.
For the case with line manipulations, we observe only a small increase in computational time, as shown in Tables 1, 2, 3, 4, 5 and 6, which is affected not only by the number of manipulations, but also by the branches manipulated.

Computational results for bus manipulations
Bus manipulations do not cause major modifications in computational results because, when a bus is removed, the system is reduced to a simpler subsystem. The results of Tables 7 and 8 reinforce this observation.
In the next section, we will be address the case in which bus and line manipulations are executed simultaneously. Therefore, a more interesting analysis with respect to the behavior of the system will be possible.

Computational results for simultaneous bus and line manipulations
In this section, we will address the case in which bus and line manipulations are executed simultaneously. It is worth mentioning that bus manipulations are performed only on buses that have a degree of less than two in the spanning tree, thus avoiding disconnections in the system. In the tests performed here, we have considered the following assumptions: For the case with one manipulation, we executed the test with a bus manipulation and a line manipulation, both carried out at the same period of time, in order to analyze the system for the worst possible case. For the application of two manipulations, the test was performed with the manipulation of only one bus and two lines. For three manipulations, we executed the manipulations of two buses and three lines, and so on until reaching the maximum number of manipulations of six lines and three buses.
We considered these case studies to test the network in a more severe scenario. Noting that bus manipulations cause less convergence problems for the method, as they reduce the system and its demand, the goal is only to analyze how the system reacts with both modifications. Thus, the bus manipulations were executed in smaller numbers.
When five manipulations are executed, which would correspond to five lines and three buses, there is the shutdown of a generator, causing the systems presented in Tables 9 and 10 to have their computational cost significantly increased. The systems represented in Tables 11,  12 and 13 also suffered consequences with the shutdown of a power plant, but in a less drastic manner, since the manipulations performed previously helped the system to behave more efficiently.
It is important to highlight that, depending on the branch/bus that is being operated, the convergence of the method cannot be obtained. For example, in the IEEE30 system, the bus manipulation involving generator number 8 cannot be executed, because its generation capacity is high and the shutdown would result in load shedding.
When compared to the problem that does not consider manipulations, the computational cost per iteration is essentially the same. In addition, there was a small increase in the number of iterations in the problem with manipulations compared to the same problem without considering them.   The efficiency of the methodology proposed in this paper can be verified not only by the convergence, but also by the non-convergence in some tests carried out with infeasible systems. Accordingly, we could show that the implementation actually optimizes the problems addressed. For example, for the test of the IEEE system with 30 buses, power generation capacity was reduced from 100 to 61.5 MW, thus some slack variables related to generation reached their limit.
In Fig. 8, we can verify that, during peak hours, all generators work at their limits to meet the energy demand of the system.
The implementation also detects the unfeasible schedules for the system. For example, when reducing the bounds for the flows in the transmission lines from 100 to 59 MW, convergence of the method was not possible; although the generator can produce the necessary energy, it cannot be distributed to all the load buses in order to meet the demands of the system. This set of results corroborates that the methodology developed in the paper is more appropriate to deal with the real predispatch problem faced by a complex hydrothermal electric system. Furthermore, it achieves this benefit with a negligible additional computational effort and without presenting any numerical stability problems.
Moreover, it is worth to remark the pseudo contradiction that the inclusion of maneuvers in the constraints of the predispatch problem leads to optimal costs that are higher than the costs obtained by approaches that do not model maneuvers. However, the solutions provided by the proposed approach match better the actual operation of the system, while approaches that do not consider maneuvers require heuristic adjustments, leading to higher costs in the effective implementation of the solutions.

Conclusions
In this work, interior-point methods are used to solve a predispatch problem in a hydroelectric system. The contribution of this research is to solve these problems with line and bus manipulations executed simultaneously. When these manipulations occur, the network topology is modified. The characteristics of this problem and its importance for the Brazilian electricity system have motivated the development of this research.
The methodology used in the development of this study is the primal-dual interior-point method, which have previously allowed successful approaches for problems of optimal power flows.
In order to improve efficiency in the solution of the predispatch problem studied herein, we used a heuristic for the construction of a shallow spanning tree, so the reactance matrix used is sparser.
From the computational point of view, the effort to solve a problem with or without modifications on the network topology is similar. Even with the modifications in the matrices of the problem, the number of linear systems that need to be solved remains the same, compared to the problem without manipulations. Furthermore, the number of iterations required for convergence of the interior-point method depends on the importance that the manipulated branches and buses have on the system. The line manipulations presented results very close to the case of the simultaneous bus and line manipulations. In the latter, the number of iterations increased slightly, because the system must execute a more complex set of manipulations.
The results obtained showed the adequacy of the methodology, both in the numerical aspects and in the times of convergence. Indeed, the times required to attain the solution were kept below five minutes for the larger problems, for a implementation with Matlab.