## 4 Methodology
### Integrated Simulation Framework for Security of Supply Analysis
In this paper, this cascading failure phase, starting with the initiating event is modeled, where the cascading contingencies occurrence are affected by operator actions and the times between subsequent events are considered in a range of tens of seconds to 1 h. Various system adjustments that are considered include the post-contingency redispatch of active and reactive resources, cascade tripping of an overloaded transmission line, tripping or re-dispatching of generators due to load/generation imbalance, and load shedding at load buses to prevent a complete system blackout when insufficient voltage magnitudes are observed. The initial state of the model is obtained by solving the standard AC optimal power-flow problem as described in Equations (5)-(15), which yields the optimum hourly generator dispatch for given hourly loads, cost functions for each generator and bus voltage and line loading constraints. To execute this task MATPOWER 6.01b AC-OPF algorithm is applied [51]. Any change from the initial state caused by a contingency event, such as a (simultaneous) failure of one or more transmission lines, failure of a generation unit or decreased amount of generation capacity due to lack of gas supply, can be introduced in the model by defining a scenario event for the corresponding facility, which is composed of an event time, an event parameter and its corresponding value. Whenever a contingency is observed in the system, an imbalance between total generation and total load may occur. In order to re-balance the system, the model redistributes the missing or excess power to the remaining facilities in the power grid. The power re-dispatch is obtained by running the AC-OPF model, while considering the new topology triggered by a previous disruption (e.g., lines and generation units may be disconnected). However, since the system is under a stressed state, the AC-OPF algorithm may deliver an infeasible solution, that does not satisfy the convergence criteria, since system constraints such as line overloading or voltage limits cannot sustain the desired system loads. In order to allow the system to find a converged solution, the bus voltage (\(|V|\geq|V^{min}\)) and line capacity constraints (\(S_{f}\cdot S_{f}^{*}\leq S^{max2}\) & \(S_{t}\cdot S_{t}^{*}\leq S^{max2}\)) in the standard AC-OPF formulation are relaxed for the re-dispatching process. The re-dispatching process is followed by a two step feasibility checking procedure. In step one, bus voltage violations are mitigated by performing load shedding at the affected buses and recomputing the relaxed AC-OPF until no voltage violations are detected, so called under-voltage load shedding. The model assumes that there is enough time for the operator to implement under voltage load shedding to prevent a voltage collapse which is the root cause of most of the major power system disturbances [64; 65; 66]. The model sheds load in blocks of 2% for the corresponding bus until the relaxed bus voltage constraint is satisfied. If a violation is not eliminated although the load sheds more than 50% of its original load, we assume complete failure of the affected bus and set the load value to zero [8]. The second step of the feasibility checking procedure follows after all bus voltage violations have been remedied in the first step. During the re-dispatching process new failures may occur at certain components as they become overloaded. In this paper the overloads are aimed to be strictly avoided for all component contingencies. This means that it is assumed that the probability for line trip is 1 when line flow exceeds its thermal capacity with a tolerance parameter. The second step involves disconnecting overloaded transmission lines from the power grid and recomputing the relaxed AC-OPF until a feasible solution is obtained. It should be noted that, the connectivity of the network is checked in every simulation step prior to the AC-OPFcomputation in order to detect isolated facilities.