## 4 Methodology
### Integrated Simulation Framework for Security of Supply Analysis
The algorithm used for checking the connectivity is based on the well-known minimum spanning tree algorithm and is described in detail in [8]. After obtaining a feasible solution for the power system, the resulting hourly power generation of GFPPs is converted into a hourly gas demand profiles and provided as input to the gas model. The gas model needs an initial state for running the transient simulation. This state can either be a solution of a steady state simulation or the terminal state of a transient simulation. If an initial state is not available the algorithm uses the initial loads of the generated gas demand profiles for GFPPs to compute a steady state solution. This solution is then used as an initial state for the transient simulation. After each transient or steady state simulation the algorithm checks if the fuel gas pressures at GFPP nodes are sufficient to operate the facilities. If an insufficient fuel gas pressure is detected, the affected GFPP is shut-down and the power system model is recomputed. The algorithm is terminated if no pressure violations are detected after the transient gas simulation. Finally, the amount of energy not supplied is calculated as an indicator of the impact of the disruption event. The gas and electric model described above are connected through an interface which enables the communication and data exchange between the two simulators (i.e., MATPOWER as power system simulator and SAInt as transient gas simulator, see Figure 3). The time integration of the combined model is performed separately for both systems and the interconnection between both systems is established through data exchange at discrete time and space points. The timing of the power model is based on the discrete event simulation concept. It is assumed that the configuration of the power system (e.g., the state of generation units and lines) remains unchanged between events and changes only at the time of the specific event. If no events are scheduled or triggered in the course of the simulation the time step of the power system corresponds to a reference time step of 1 hour. In contrast to the power system, the time integration of the transient gas model, is based on a dynamic time step adaptation method (DTA), which adapts the time resolution with respect to the control changes of controlled gas facilities during the solution process. The DTA allows capturing rapid changes in the gas system (shut-down of a power plant or compressor station etc.) with a higher time resolution. In this context, the gas model can be viewed as a quasi-continuous system, where the values of the state variables (i.e., nodal pressure \(p\), element flows \(Q\) and nodal loads \(L\)) between two discrete time points are approximated by linear interpolation. If no events are scheduled or triggered in the course of the simulation the time step of the gas system corresponds to a reference time step of 15 min. The gas and power system simulator used in the simulation framework have both been tested and verified. The gas simulator SAInt was benchmarked against a commercial software in previous publications [52; 53] and the power system simulator MATPOWER [51] is well known and accepted by the scientific community. In the following section, the proposed framework is applied to perform a contingency analysis for an integrated gas and power system network.