## 2 Problem Formulation
### Capacity Configuration Model of Energy Storage  
The capacity evaluation model is established in this section to identify the installation capacity of an energy storage system as maintaining a certain reliability level. The lower-level objective function is given as  
\[\min_{C_{ES}}f\big{(}N_{ES}{}^{*},C_{ES},Reliability_{p.u.}{}^{*}\big{)} \tag{7}\]  
where \(Reliability_{p.u.}{}^{*}\) is a certain reliability of the distribution network and can be determined by the operators and \(C_{ES}\) is the installation capacity of energy storage. The lower-level optimization is identical to the energy storage capacity allocation problem associated with the optimal values of the upper-level decision variable \(N_{ES}{}^{*}\), the location of energy storage. Equation (7) aims to obtain the minimum installation capacity of energy storage that satisfies the required system reliability.  
In addition to the failure rate of wind turbines, the intermittent characteristic also causes the fluctuation of the output power of wind turbines; therefore, it should be considered in the evaluation of the contribution of renewable energy to generator adequacy. Hence, the system average interruption duration index (SAIDI) during period \(T\) is utilized to represent the reliability of the distribution network. Therefore, SAIDI in period \(T\) before energy storage system installation is shown below  
\[SAIDI_{0}=\sum_{t=1}^{T}N_{t}/N_{A} \tag{8}\]  
where \(N_{A}\) is the total number of the customers in the distribution network and \(N_{t}\) is the period of user outage at time \(t\). In addition, \(N_{t}\) is described as  
\[N_{t}=\left\{\begin{array}{l}N_{t},\ if\ \left[\sum_{i=1}^{n_{G}}P_{G,i}(t)+ \sum_{j=1}^{n_{WT}}P_{WT,j}(t)\right]<P_{LOAD}(t)\\ 0,\ if\ \left[\sum_{i=1}^{n_{G}}P_{G,i}(t)+\sum_{j=1}^{n_{WT}}P_{WT,j}(t)\right] \geq P_{LOAD}(t)\end{array}\right. \tag{9}\]  
At time \(t\), the total available capacity of conventional generator is \(P_{G}(t)\), the total available capacity of the wind power generator is \(P_{WT}(t)\), and the load demand is \(P_{LOAD}(t)\).  
After the energy storage system is installed, \(\Delta N_{t}\) is calculated as  
\[\Delta N_{t}=\left\{\begin{array}{l}\Delta N_{t},\ if\ P_{ES}(t)<\Delta P_{ LOAD}(t)\\ 0,\ if\ P_{ES}(t)\geq\Delta P_{LOAD}(t)\end{array}\right. \tag{10}\]  
where \(\Delta P_{LOAD}(t)\) is the added load demand to offset the influence of the added energy storage on the system reliability.  
In Equation (10), the added load \(\Delta P_{LOAD}(t)\) is used to balance the effects of the energy storage system on power system reliability. The power system with the added load and energy storage system should reach the reliability of the original system.  
\[N_{t}=\left\{\begin{array}{l}N_{t},\ if\ \left(\left[\sum_{i=1}^{n_{G}}P_{G,i}(t)+ \sum_{j=1}^{n_{WT}}P_{WT,j}(t)+k\times C_{ES,j}\right]<P_{LOAD}(t)+\Delta P_ {LOAD}(t)\right)\\ 0,\ if\ \left(\left[\sum_{i=1}^{n_{G}}P_{G,i}(t)+\sum_{j=1}^{n_{WT}}P_{WT,j}(t)+k \times C_{ES,j}\right]\geq P_{LOAD}(t)+\Delta P_{LOAD}(t)\right)\end{array}\right. \tag{11}\]  
Therefore, the relationship between system reliability and available generator capacity is  
\[SAIDI=f(P_{G},P_{W},P_{LOAD})=f(P_{G},P_{W},P_{LOAD},C_{ES},\Delta P_{LOAD} (t)) \tag{12}\]  
The objective function is subjected to constraints Equations (13)-(26). The constraints of the optimization problem include power flow, stability and security constraints. The optimization results of Equation (7) are influenced by two types of factors: the power system status factor and the power system operation status.  
The constraints of the energy storage installation capacity model include the constraints of system balance, conventional generators, wind power generation and energy storage.