## 3 Optimization Problem Formulations
### Emergency-Mode Operation Formulation  
The MG is considerably more vulnerable to unexpected fluctuations in loads and renewable energy generation when it is disconnected from the main grid than that when it is connected. Therefore, the MG operation in the emergency mode should consider the uncertainty in loads and renewable energy generation captured by forecasting errors. The objective function of the emergency-mode operation is expressed in Equation (21). The objective function is constructed to minimize the sum of operating costs over all periods of the islanded mode operation. The predicted start time of the outage (_STO_) is the first time in the islanded mode operation. The continuous _STO_ is set to operate the preparation mode MG conservatively, and it reflects some possible inaccuracies in the _STO_. In Equation (21), \(X^{EM}\) represents the set of decision variables related to the emergency-mode operation problem. \[ \begin{split} f^{EM}(X^{EM})&=\sum_{l=1}^{L}\{\sum_{g =1}^{G}\sum_{t_{lgs}=t_{0l}}^{STO_{l}+T_{S}}(C_{g}^{gen}\cdot P_{g,t_{lgs}}^{ STO_{l}}+C_{g}^{SU}\cdot y_{g,t_{lgs}}^{STO_{l}}+C_{g}^{SD}\cdot z_{g,t_{lgs}}^{STO_{l}}) \}\\ &\quad+\sum_{l=1}^{L}\{\sum_{t_{lgs}=t_{0l}}^{STO_{l}+T_{S}}(C_{t _{lgs}}^{ELSA,STO_{l}}+C_{t_{lgs}}^{ELSB,STO_{l}})\}.\end{split}  \tag{21}\]  
Equations (22)-(37) represent the emergency-mode operation conditions. The power balance of the system in the emergency mode is represented by Equation (22), and load shedding reflecting forecast error is captured by Equations (23) and (24). Equations (23) and (24) define the expected cost of load shedding (ECLS) based on the type of load. \(\phi_{\tilde{e}_{lgs}^{A}}\) and \(\phi_{\tilde{e}_{lgs}^{B}}\) represent the Probability density function (PDFs) of \(\widehat{e}_{t_{lgs}}^{A}\) and \(\widehat{e}_{t_{lgs}}^{B}\), respectively. \(\Phi_{\tilde{e}_{lgs}^{A}}\) and \(\Phi_{\tilde{e}_{lgs}^{B}}\) are the Cumulative density function (CDF) of \(\widehat{e}_{t_{lgs}}^{A}\) and \(\widehat{e}_{t_{lgs}}^{B}\), respectively. \(\widehat{e}_{t_{lgs}}^{A}\) represents the sum of the forecast error. We assume the forecast error of renewable generators to be independent Gaussian distribution with zero mean. \(P_{t_{lgs}}^{ELSASTO_{l}}\) and \(P_{t_{lgs}}^{ELSB,STO_{l}}\) represent the expected load shedding (ELS) based on the type of load. These are nonlinear and nonconvex with respect to \(P_{t}^{tA,STO_{l}}\) and \((P_{t}^{tB,STO_{l}})\). However, ECLS, which is included in the objective function, is nonlinear and convex with respect to \(P_{t}^{tA,STO_{l}}\) and \((P_{t}^{tB,STO_{l}})\). A more detailed explanation is provided in Appendix A. \[ \begin{split}\sum_{g=1}^{G}P_{g,t_{lgs}}^{STO_{l}}+P_{t_{lgs}}^{ WTT}+P_{t_{lgs}}^{PV}+\eta\cdot P_{t_{lgs}}^{dch,STO_{l}}-P_{t_{lgs}}^{ch,STO_{l}} \geq P_{t_{lgs}}^{tA,STO_{l}}+P_{t_{lgs}}^{tB,STO_{l}},\forall_{t,t_{lgs}}. \end{split}  \tag{22}\]  
\[ \begin{split}\left\{\begin{array}{l}C_{t_{lgs}}^{ELSA,STO_{l}}= C^{LSA}\cdot\Phi_{\tilde{e}_{lgs}^{A}}\cdot(P_{t_{lgs}}^{ELSA,STO_{l}}), \forall_{t,t_{lgs}}.\\ \\ \text{where }P_{t_{lgs}}^{ELSA,STO_{l}}=(P_{t_{lgs}}^{LA}-P_{t_{lgs}}^{ tA,STO_{l}})+\sigma^{2}\cdot\frac{\[PERSON]_{\tilde{e}_{lgs}^{A}}(P_{t_{lgs}}^{ LA}-P_{t_{lgs}}^{tA,STO_{l}})}{\[PERSON]_{\tilde{e}_{lgs}^{A}}}.\end{array}\right.\end{split}  \tag{23}\]  
\[ \begin{split}\left\{\begin{array}{l}C_{t_{lgs}}^{ELSB,STO_{l}}= C^{LSB}\cdot\[PERSON]_{\tilde{e}_{lgs}^{B}}\cdot(P_{t_{lgs}}^{ELSB,STO_{l}}), \forall_{t,t_{lgs}}.\\ \\ \text{where }P_{t_{lgs}}^{ELSB,STO_{l}}=(P_{t_{lgs}}^{LA}-P_{t_{lgs}}^{ tB,STO_{l}})+\sigma^{2}\cdot\frac{\Phi_{\tilde{e}_{lgs}^{A}}(P_{t_{lgs}}^{LB}-P_{t_{ lgs}}^{tB,STO_{l}})}{\Phi_{\tilde{e}_{lgs}^{A}}}.\end{array}\right.\end{split}  \tag{24}\]  
We use piecewise linearized Equations (23) and (24) to represent the problems as MILP because these equations have exponential terms. An example of piecewise linearization of \(C^{ELSA}\) is illustrated in Figure 3.  
For resilience enhancement, the critical load must be supplied power under forecasting uncertainty.