# Operational Resilience Metrics for Complex Inter-Dependent Electrical Networks
## Appendix A  
Figure 11 summarizes the main procedures executed by RecSim. The _initializeSimulationParameters()_ procedure initializes all the parameters needed to configure a simulation. For example, these parameters (Figure 6) represent the efficiency of the SCADA system (\(BTS_{st}\), \(tlc_{t}\)), the efficiency of the restoration procedures (\(tr_{t}\), \(m_{t}\), \(PG_{t}\)) and the number \(|C|\) of technical emergency crews available. These parameters have been initialized according to the information provided by the EDN operator. In particular, within the proposed operational resilience assessment framework, these parameter values will be changed in order to assess the resilience of the EDN in different operational setting scenarios (see Section 5). The _loadEDN()_ procedure loads the EDN topology into RecSim. The network topology is represented as a map of MV lines. Each MV line, that is uniquely identified through its name, is represented as a tree data structure where the root element is represented by the MV line primary station. The EDN operator provided these data as excel csv files containing the network topology and the EDN components characteristics (e.g., the type of secondary substation). The _loadDependencies()_ procedure initializes the data structures used to represent the dependencies between the electrical distribution and the telecommunication network. In particular, the algorithm uses the _target_BTS_dict_ to store the dependency of the base transceiver station (BTS) elements to the secondary cabins (i.e., the _target_BTS_dict_ contains tuples such as \((BTS_{i},SS_{j})\) indicating the \(SS_{j}\) feeds the \(BTS_{i}\) element) and the _target_SS_dict_ to store the dependency of the SS elements to the BTS (i.e., the _target_SS_dict_ contains tuples such as \((SS_{i},BTS_{j})\) indicating the \(BTS_{j}\) provides the communication service to the \(SS_{i}\) element). The sets \(BTS_{st}\) and \(P\) (that is the set of secondary substations \(SS_{F}\)in damage state) are initialized by the procedures _loadBTSFunctioningStatus()_ and _loadPerturbation()_ respectively. Then, the _simulate()_ procedure computes the consequences of the perturbation scenario \(P\) depending on the reconfiguration actions that can be performed by the electrical operator, using the available resources (in term of emergency crews and SCADA system availability). The _simulate()_ algorithm is summarized in Figure 12.  
The simulator initializes the data structures _IntervationsQueue_ and _LineWithFailure_ that will store the set of interventions to be assigned to the technical emergency crews and the set of MV lines containing at least the \(ss\) in a damaged state (i.e., \(ss\in SS_{F}\)). Then, for each BTS in failure, the simulator updates the dependent remotely controlled secondary substations SCADA system as not functioning. Indeed, a remotely controlled secondary substations that cannot rely on the telco service is considered a normal secondary substation. Next, the simulator for each \(ss\in SS_{F}\) updates the _IntervationsQueue_ and _LineWithFailure_ data structures and, if needed, updates the functioning status of the BTS using the set _target_BTS_dict_. For each \(ss\in SS_{F}\) the procedure assigns a mobile power generator. The _simulateProtections()_ procedure simulates the behavior of the EDN protection devices. Indeed, the MV lines use such devices to protect the various electrical equipment that can be seriously damaged by voltage drops and/or line over-current. For the sake of clarity, the following explanation is related to single failures for each MV lines. The procedure takes in the input of the set \(SS_{F}\) of secondary substations (referred to also as _nodes_ in the following) that are in a damaged state and the topology of the network.