Comparing Corrective and Preventive Security-Constrained DCOPF Problems Using Linear Shift-Factors

This study compares two efficient formulations to solve corrective as well as preventive security-constrained (SC) DC-based optimal power flow (OPF) problems using linear sensitivity factors without sacrificing optimality. Both SCOPF problems are modelled using two frameworks based on these distribution factors. The main advantage of the accomplished formulation is the significant reduction of decision variables and—equality and inequality—constraints in comparison with the traditional DC-based SCOPF formulation. Several test power systems and extensive computational experiments are conducted using a commercial solver to clearly demonstrate the feasibility to carry out the corrective and the preventive SCOPF problems with a reduced solution space. Another point worth noting is the lower simulation time achieved by the introduced methodology. Additionally, this study presents advantages and disadvantages for the proposed shift-factor formulation solving both corrective and preventive formulations.


Introduction
Carpentier introduced the optimal power flow (OPF) problem in 1960 [1]. The optimal result obtains the economic dispatch and transmission power flows. The power flow solution must meet technical power generation and transmission network limits. Several optimization algorithms have been presented in the technical literature to solve operation and planning problems based on this conventional mathematical formulation [2][3][4].
In real-time operation, power system operators (Independent System Operators (ISOs) and Regional Transmission Organizations (RTOs)) must execute a lot of N−1 power flows very quickly taking into account generation and transmission (lines or tranformers) failures to obtain a safe condition after a contingency event [5]. Security studies should guarantee that not only the power flow result will be maintained below the thermal limit but also overloading conditions in the transmission elements will be mitigated to avoid undesirable operational effects. This study is only focused on transmission contingencies.

Technical Literature Analysis
Power system planners and operators have typically used the direct-current OPF (DCOPF) problem. A DCOPF problem is a simplified linear approach modelling nonlinear transmission constraints based on approximations regarding voltage (magnitudes and angles), admittances and reactive power [6]. Nowadays, the most common transmission network formulation is the so-called DC model [7]. i The first approach is larger than the classical DC-based OPF problem because new variables (power unit generation) and constraints (power flow post-contingency conditions) are added in the optimization problem to model the pre-contingency and the post-contingency (N−1) power system states. Nonetheless, the optimal solution usually requires that the ISO redispatches power generation of several units in a very short time to avoid operational overcost as well as overloading conditions. For this reason, the ISO must be able to handle many corrective generation actions without affecting power system security [14][15][16][17]. ii For the preventive approach, one set of decision variables (power unit generation) is only needed to model the SCOPF formulation. With this assumption, the ISO does not need to redispatch the power generation because the preventive model avoids power generation changes between preand post-contingency power system states. However, there is an overcost in the pre-contingency state in comparison with the previous formulation. For more information, References [5,6,11,18,19] could be reviewed in detailed.

Contributions
References [6,7] introduce the N−1 preventive security analysis by using shift-factors and line outage distribution factors. While the security problem only includes the worst contingency, a ranking of contingencies should be modelled in the security-constrained analysis to avoid risky operational conditions and technical transmission problems to supply adequately the load of the customers for an unlikely line or transformer failure. Based on our knowledge, the corrective formulation is not applied in the technical literature using shift-factors. Hence, it would be very attractive to accomplish several analyses and comparisons with short-and large-scale power systems to validate scalability and simulation performance using both CL-and SF-based formulations and a commercial solver (Gurobi). Therefore, the following issues have been solved in this study-(1) the corrective SCOPF problem is solved using shift-factors and a comparative analysis for both corrective and preventive formulations has been carried out using different-scale test power systems; and (2) a realistic case is successfully solved (National Electric Power System of Chile). Simulation results have demonstrated superior performance when the SF-based formulation is applied to the SCOPF problem in comparison with the CL-based formulation. Notice that the introduced formulation could bring better performance and practical advantages solving large-scale problems as well as complicated problems such as stochastic OPF, stochastic unit commitment and generation planning methodologies.
This study is organized as follows. In Section 2, a detailed study shows different OPF problems applying the classical formulation and the introduced formulation. Section 3 presents the corrective and preventive SCOPF simulations using shift-factors. Besides, results and comparisons are achieved using several test power systems. Section 4 concludes the study.

Security-Constrained Optimal Power Flow Problem
In this section, corrective and preventive SCOPF problems are mathematically presented in detailed. In addition, the optimization problem does not include the DC power losses.

Corrective SCOPF Problem Using the Classical DC-Based Formulation
This optimization problem is modelled using the following objective function: Subject to: Equations (2) and (3) represent nodal power balance constraints for the pre-and the post-contingency conditions, respectively. Equations (4) and (5) define power flows in the transmission elements and (6) and (7) limit these power flows for both conditions. Equation (8) models the ramp-up and ramp-down power unit generation limits and (9) and (10) limit the minimum and the maximum power unit generation. Constraints (11) and (12) limit voltage bus angles for both pre-and post-contingency conditions, respectively. Last, slack reference is defined for both conditions using (13) and (14).
In this mathematical formulation, the decision variables (n) are active power generation, voltage angles and transmission power flows for pre-and post-contingency analyses.
The equality constraints (n e ) are the following: The inequality constraints (n i ) are the following:

Preventive SCOPF Problem Using the Classical DC-Based Formulation
In this mathematical formulation, the post-contingency condition is the same that the pre-contingency condition. With this assumption, the ramp-up and ramp-down constraints (8) are not necessary to add in the optimization problem. Nevertheless, transmission power flows are different because these values represent the pre-contingency power system state and the post-contingency state. As a result, there is only one set of decision variables as follows: p pre = p post = p, v pre = v post = v and δ pre = δ post = δ. Hence, the optimization problem considers a different objective function and it is subject to the following constraints: The number of decision variables n and equality n e and inequality n i constraints are calculated using n = n B + n G + n L + n L−1 , n e = 2n B + n L + n L−1 + 1 and n i = 2(n B + n G + n L + n L−1 ).

Corrective SCOPF Problem Using the SF-Based Formulation
In this section, the corrective SCOPF problem is introduced using shift-factors. For this optimization problem, the classical DC-based set of transmission network constraints is reformulated using the inverse of admittance matrix avoiding to compute voltage bus angles and nodal transmission constraints. Therefore, nodal balance constraints are turned into only one equality constraint modelling both pre-contingency (25) and post-contingency states (26). Additionally, transmission power flows for both (27) and (28) conditions are obtained using shift-factors and net power injected.
The objective function is presented in (1a) and the optimization problem is subject to the following constraints: where SF pre = B f pre × Xbus For this mathematical formulation, decision variables are exclusively the power unit generation. As a result, there are n e = 2 and n i = 2(3 n G + n L + n L−1 ). According to the lower number of variables and constraints, this formulation achieves a very compact SCOPF optimization problem.

Preventive SCOPF Problem Using the SF-Based Formulation
With previous assumptions given in Section 2.2, the OPF problem is subject to the following constraints: For this formulation, there are n e = 1 and n i = 2(n G + n L + n L−1 ).

Computing the Post-Contingency Shift-Factors
To compute more efficiently the SF post matrix, this study implements previous definition given in Reference [6] to determine post-contingency transmission constraints using Equation (36).
Lastly, LODF factors are computed as follows: Even though line outage distribution factors are only computed with pre-contingency shift-factors; that is, network data before the transmission outage, islanding conditions could be detected finding out states where the denominator of (37) is zero.

Simulation Results
Several simulations are conducted using short-and large-scale electrical power systems to find out the performance of both corrective and preventive SCOPF formulations. To formulate the optimization problem, Python [20] has been used. Moreover, Gurobi [21] is used as a commercial solver on a computer with the following characteristics: Intel Core i7 3930 (3.20 GHz) six core with RAM 32 GB.

SCOPF Formulation Applied to an Example Power System (6-Bus)
The first security-constrained simulation takes into account the 6-bus power system presented by Wood and Wollenberg [8]. Transmission network data can be seen in [8] or in MatPower [22].
In comparison with the original generation system, three new power units are located at each load bus (G 4 , G 5 and G 6 ). Figure 1 shows the electrical power system. Technical data for the power generation system are given in Table 1. Besides, ramp-up and ramp-down characteristics are incorporated in the last two columns for each power unit. Solving the classical OPF problem, the optimal cost is C total = 3003.17 $/h. The power generation solution is P 1 = 50.0 MW, P 2 = 37.5 MW, P 3 = 45.0 MW, P 4 = 5.0 MW, P 5 = 67.5 MW and P 6 = 5.0 MW. Figure 2 shows the power flow solution. According to the power flow solution, there is no congestion in transmission elements. PyPower [23] is used to validate the solution and both solutions are the same.  To realize possible transmission effects, the maximum transmission limits are changed to 40 MW in lines 1-4, 2-4 and 3-6. With this new capacity, the OPF problem also obtains the same solution (operational cost, power unit generation and transmission power flows). This new transmission capacity is used to develop the N−1 power system security.

DC-Based and SF-Based SCOPF Formulations
In the first analysis, both classical (CL) and introduced (SF) problems are implemented to model the SCOPF. These formulations are subject to one pre-and eleven post-contingency constraints.

•
Corrective SCOPF problem-for this analysis, power generation data are incorporated in the formulation assuming that the ISO has 10 min to eliminate overloading transmission effects and to recover the steady-state power system security. The main advantage of the corrective formulation is related to the operator clearly knows the post-contingency economic dispatch. This solution considers not only technical generation constraints but the variable fuel cost of each power unit. Indeed, the new power generation setting will achieve a safety and robust security-constrained N−1 solution no matter which transmission element failure.
Two cases are conducted to determine effects when ramps constraints are added in the SCOPF problem. These optimization problems have been solved using the SF-based formulation. Results are the following: Without ramp constraints-the operational cost is 3003.17 $/h for the pre-contingency condition and 3487.87 $/h for the post-contingency condition and the optimal total cost is C total = 6491.04 $/h. Actually, the pre-contingency cost is the same than the traditional OPF problem (3003.17 $/h).

Case 2
Including ramp-up and -down constraints-the cost is 3146.35 $/h for the pre-contingency condition and 3487.87 $/h for the post-contingency condition and the total cost is C total = 6634.22 $/h. For this case, the number of decision variables is 12 and the number of constraints is 280. Table 2 shows the results, operational cost and power dispatch for each SCOPF solution. Positive values imply that the power unit generation must decrease its dispatch. With this information, the ISO rapidly decides (10 or 20 min) which generator would economically change the power unit setting to optimally eliminate overloading conditions. Because PyPower does not formulated the security-constrained analysis, it is not possible to contrast this power generation solution.
Because of ramp constraints, the ISO will be not able to achieve a safe post-contingency steady-state with the solution obtained in Case 1). Therefore, the system operator will need to decrease the load of the customers or/and turn-on fast reserve power units.
Notice that the ramp-down constraint of power unit 5 (44.14 − 24.14 = 20 MW) is active with a shadow price of 6.36 $/MWh. Therefore, the pre-contingency cost is higher (143.18 $/h) than the traditional OPF problem. Additionally, the power generation solution for the post-contingency condition is the same for both cases.
In comparison with the SF-based formulation, simulation results obtained by the CL-based formulation are the same. Therefore, both formulations achieve the same optimal solution; that is, these optimization problems are equivalent.
Incorporating the ramp constraints in the CL SCOPF problem, the number of decision variables is 205 and the number of constraints is 483. Comparing with the SF formulation, there is a very significant reduction of 94.1% and 42.0%, respectively. Figure 3 displays the pre-and the post-contingency solutions when line 1-2 is outage. Both solutions could be compared to realize redispatch effects in the transmission network for generation two, four, five and six (grey color).  Using the post-contingency power generation solution (Table 2), eleven N−1 power flows are computed. For detailed information, Table 3 shows the power flow solution for each outage.  • Preventive SCOPF problem-the main advantage of this formulation is related to the operator does not need to modify the post-contingency power dispatch.
Using the SF-based formulation, the number of decision variables is 6 and the number of constraints is 280. The optimal cost obtained by Gurobi is C total = 3487.87 $/h which was previously obtained. In the solution, there is no congestion in the pre-contingency condition. However, there is congestion in transmission line 2-4 (when line 1-4 is out) and line 3-6 (when line 2-6 is out).
Gurobi achieves the same solution solving the CL-based SCOPF formulation. Nevertheless, the number of decision variables is 199 and the number of constraints is 459.
To compare corrective and preventive SCOPF solutions, the power dispatch obtained in the pre-contingency condition must be compared for both solutions. The preventive overcost is 342.52 $/h (9.82%). Therefore, there is an important operational saving cost obtained by the corrective formulation.

Corrective SCOPF Using a Ranking of Contingencies
In real power systems, all contingencies do not result in a post-contingency alert condition [8]. To figure out the SCOPF problem, several authors have used as security criterion the most severe contingency [6].
Regarding The outage of these transmission elements produce a risky operational condition and probably technical problems to supply adequately the load of the customers. In the next analysis, each line of this ranking will be added in the SCOPF problem. Table 4 displays the number of decision variables and constraints and the objective function solving the SCOPF problem.  Finally, the post-contingency analysis including two N−1 candidate lines is developed. The SCOPF problem incorporates two major contingencies: line 1-4 and line 2-6. This framework adds in the optimization problem simultaneously one set of pre-contingency constraints and two sets of post-contingency constraints. For this optimization problem, the achieved solution is the optimal (the same solution considering the outage of all lines). Table 4 also shows a reduction of 35.7% in constraints with respect to the original problem. In addition, both problems have the same number of decision variables.
As a result, the SCOPF problem should be modelled not only with the worst contingency but also with two or more contingencies to avoid risky operational conditions and technical problems to supply the load of the customers.

SCOPF Methodology Applied to Different-Scale Power Systems
We employ different electrical power test systems to determine the performance of both corrective and preventive SCOPF formulations using the SF-based as well as the CL-based frameworks: 14-bus system (five generators and twenty transmission lines); 57-bus system (seven generators and eighty transmission lines); 118-bus system (fifty-four generators and one hundred eighty-six transmission lines); and 300-bus system (sixty-nine generators and four hundred eleven transmission lines). PyPower shows technical information.

Corrective and Preventive Formulations
Because PyPower does not include ramp generation constraints, we have selected these limits using random numbers provided by a normal distribution function with a mean of 7 MW/min and a variance of 1. Table 5 shows simulation results for both corrective and preventive analyses applying the CL and the SF formulations. For each SC problem, we have included the objective function (OF), the number of decision variables (n), constraints (n i + n e ) and the average simulation time considering 200 trials.
For both 14-bus and 57-bus power systems, the security-constrained problem models the outage of all transmission lines.
Considering the higher simulation time obtained by a complete N−1 analysis, a reduced number of contingencies should be used to solve the security problem applied to large-scale power systems. In the 118-bus and the 300-bus systems, we have modelled the N−1 analysis using 176 transmission and 100 transmission candidate lines, respectively. This assumption is accomplished not only by the bigger number of variables and constraints but also by the higher simulation time. For all power systems, there is an important improvement in the simulation time. Comparing both classical and SF-based formulations applied to the 300-bus system, SF-based formulation achieves the best performance with an efficiency of 6.97 times using the corrective formulation and 7.02 times using the preventive formulation.
Simulation results have shown the corrective formulation obtains the lower OF in comparison with the preventive formulation.
Notice that the reactance bus matrix needs an inverse method.Therefore, the main disadvantage of the proposed methodology is the time computing to obtain the SF matrix. However, the security-constrained analysis could be carried out using an off-line SF matrix; that is, the SF matrix does not need to compute each N−1 time. Therefore, an external file could be used to save these matrixes improving the formulation time.
The LODF matrix could be computed using basic mathematical operations-Equation (37). Therefore, the computation time is not significant.

Another Classical DC-Based Preventive Formulation Applied to the 300-Bus Power System
In the following analysis, we use a different preventive SCOPF formulation. For this approach, power flow variables are eliminated from the optimization problem using two admittance bus matrixes (Bbus pre and Bbus post ). Consequently, there are only two sets of nodal balance constraints for the preand post-contingency analyses. Besides, the primitive-admittance incidence matrix for the pre-contingency B f pre and the post-contingency B f post conditions is substitute to determine transmission power flows.
Simulating 200 trials, the average simulation time is 0.7648 s for the preventive SCOPF problem which is 19.22% lower than the original CL-based formulation. For this mathematical problem, the number of decision variables is 30,369 and the number of constraints is 113,361. Therefore, the new classical formulation causes a reduction of 57.69% in the number of decision variables and a reduction of 26.76% in the number of equality and inequality constraints. Although there is an improvement in the simulation performance, this time is still higher (5.67 times) than the SF-based formulation.
Based on simulations, the introduced SF-based formulation achieves the best simulation time to carry out the corrective formulation and the preventive formulation applied to the SCOPF problem. This improvement is obtained by the lower number of decision variables as well as by the lower number of equality and inequality constraints. Therefore, this framework could be recommended to solve very large-scale power systems.

Corrective and Preventive SCOPF Methodology Applied to the Chilean Electrical Power System
The Chilean Interconnected Power System (in Spanish, SEN: Sistema Eléctrico Nacional) is used to validate both SCOPF formulations. Concerning the lower simulation time accomplished previously, the SF-based methodology is only applied to the SCOPF problem.
In January, 2019, the SEN generation capacity was 21,189.95 MW. In 2019, the peak load was 9382.7 MW. Review the Regulatory Company webpage (CNE: www.cne.cl) or the ISO webpage (CEN: www.coordinador.cl) to obtain more technical information. The electrical power system contains one hundred fifty-nine buses, three hundred twenty-one transmission lines from 110 to 500 kV and two hundred sixty-seven generation power units (thermal, hydro and renewable energy). The webpage link https://infotecnica.coordinador.cl displays detailed technical and economic information about the Chilean study case.
For the power generation system, there are one hundred three renewable power units. For hydro, wind and solar, a capacity factor of 20%, 20% and 30% are selected, respectively. For thermal units, random numbers model ramp generation constraints for each power unit. Additionally, one hundred transmission lines are randomly selected to formulate the N−1 security-constrained analysis.
Even though the security cost is similar, the OPF formulation only considers one load time-period. Moreover, the unit commitment solution obtained by the ISO should be incorporated in the OPF problem to realize real saving costs.

Conclusions
This study analyzed two very effective methodologies to solve both corrective and preventive security-constrained DC optimal power flow problems using shift-factors. We used these factors to formulate pre-and post-contingency steady-state conditions. The optimal solution was found with lower number of decision variables and constraints in comparison with the traditional (CL) SCOPF formulation. To validate simulation time, a lot of analyses were conducted to determine which methodology obtained the best performance solving the SCOPF problem with different-scale test power systems.
The research group believes that the introduced security-constrained methodology could be applied to formulate deterministic and stochastic power system issues where the transmission topology does not change. For instance, unit commitment, generation planning, among other power system problems.
Funding: This research was funded by Universidad Técnica Federico Santa María, Chile, grant number USM PI_M_18_14 and The APC was funded by the same research project.

Acknowledgments:
The author would like to thank the associate editor and the anonymous reviewers for their valuable comments.

Conflicts of Interest:
The author declares no conflict of interest.

S base
Power system base value S base = 100 MW C total Total security-constrained operational cost ($/h) C pre Pre-contingency variable cost ($/h) C post Post-contingency variable cost ($/h) Voltage angle at bus k for the post-contingency condition-corrective formulation p g Power generation dispatched by unit g for the preventive formulation v g Unserved energy at bus g for the preventive formulation δ k Voltage angle at bus k for the preventive formulation