## 3 Resiliency Measure Formulation  
The level of resilience (LoR) is the main factor that will be used to capture the evolution of system parameters through the changes of systems modes of operation under a sequence of fault and recovery actions.  
For a number of MGs under a sequence of faults/attacks (fault scenario, F), suppose the resulting system modes are denoted by \(N_{0}\rightarrow\)\(N_{1}\rightarrow\ldots\rightarrow\)\(N_{j}\), where \(N_{0}\) is the initial mode, while \(N_{i}\) is the mode after the \(i\)th fault and reconfiguration (\(i=1,\ldots,j\)).  
This work investigates a number of factors as a way to compare the resiliency of MGs. These factors are the voltage sag percentage, load served, recovery time, and time to reach power balance state.  
**Definition 1**.: _Given the sequence of mode switches: \(N_{0}\rightarrow\)\(N_{1}\rightarrow\ldots\rightarrow\)\(N_{m}\), (under a fault scenario F), the voltage sag [22] can be defined as follow:_  
\[\text{Sag}\%\ =\ \frac{\text{V}_{0}-\text{V}_{\text{m}}}{\text{V}_{0}}\% \tag{7}\]  
One of the other vital resilience factors is level of performance reduction (LoP\({}_{\text{R}}\)). LoP\({}_{\text{R}}\) is investigated through this study as the load percentage that is served during faults and recovery actions.  
**Definition 2**.: _Given the sequence of modes: \(N_{0}\rightarrow\)\(N_{1}\rightarrow\ldots\rightarrow\)\(N_{m}\), (under a fault scenario F), the LoP\({}_{R}\) reduction is given by:_  
\[\text{LoP}_{\text{R}}\ =\ \frac{\text{\sum P(loads)I}-\text{\sum P(loads)m}}{ \text{\sum P(loads)I}}\% \tag{8}\]  
Furthermore, Recovery Time (RT) is considered one of the vital resiliency factors in LoR formulation.  
The aforementioned factors have been investigated during the connected mode operation. Regarding the islanded mode, the time to power balance (\(T_{b}\)) factor has been tested. This factor indicates the time needed to meet the power balance state.  
Figure 3: Ring topology of MG\({}_{2}\).  
**Definition 3**.: _Given the sequence of modes: \(N_{0}{\rightarrow}N_{1}{\rightarrow}\ldots\rightarrow N_{m}\), \(T_{b}\) can be formulated as:_  
\[T_{b}\ =\ T\big{|}_{P_{g}\geq P_{c}}-T_{x} \tag{9}\]  
where, \(P_{g}\) is the generated power, \(P_{c}\) is the consumed power, \(t|_{P_{g}\geq P_{c}}\) is the time where the generated power is equal or greater than the consumed power. \(T_{x}\) is the time where the MG is operated in the islanded mode.  
A system is more resilient if it incurs a smaller sag percentage, or otherwise, a smaller loss of performance, or otherwise a smaller level of recovery-time, or otherwise, a smaller level of time to meet power balance state.  
**Definition 4**.: _Given a set of microgrids, \(MG\equiv\cup\ MG_{k}\); \(k\in\{1,\ldots,y\}\), where \(y\) is the number of the microgrids, and an attack/fault scenario F, we say that \(LoR((MG_{i},F)>LoR((MG-MG_{i},F)\) if:_  
\[[Sag\%\ (MG_{i},F)<Sag\%\ (MG-MG_{i},F)]\]  
\[\vee\ [[Sag\%\ (MG_{i},F)=Sag\%\ (MG-MG_{i},F)]\]  
\[\wedge\ [LoP_{R}\ (MG_{i},F)<LoP_{R}\ (MG-MG_{i},F)]]\]  
\[\vee\ [[Sag\%\ (MG_{i},F)=Sag\%\ (MG-MG_{i},F)]]\]  
\[\wedge\ [[Sag\%\ (MG_{i},F)=Sag\%\ (MG-MG_{i},F)]]\]  
\[\wedge\ [[Sag\%\ (MG_{i},F)=LoP_{R}\ (MG-MG_{i},F)]]\]  
\[\wedge\ [RT\ (MG_{i},F)=RT\ (MG-MG_{i},F)]\]  
\[\wedge\ [T_{b}\ (MG_{i},F)=T_{b}\ (MG-MG_{i},F)]]\]