# Considering the Life-Cycle Cost of Distributed Energy-Storage Planning in Distribution Grids
## 3 ESS Installation Site and Capacity Optimization
### The First-Stage Optimization  
In this study, the overall optimization objective is to minimize the average annual cost of the ESS life cycle, on the premise that the ESS operates to stabilize voltage fluctuations. In the first stage, in order to effectively resolve the voltage fluctuations caused by the PV, the operation of ESSs are optimized with the objective of capital investment and line losses minimization, at time t. Then, the minimum installation capacity at the corresponding location is obtained. The installation sites are determined by the minimum installation capacity of the ESS at the pre-selected locations, including the critical load nodes, the end of the feeder, the DER busbars, and the primary substation, etc. The power output of individual storage at time \(t\) is considered as the rated power, and the capacity is calculated as the time over which the storage delivers full power, as in Equation (2), to meet the requirement of the ESS output at time \(t\). The capital investment is the main concern at this stage, including the capital cost of the storage unit, the power conversion system (PCS), and the necessary supporting facilities. The cost of the storage unit and the cost of the necessary supporting facilities is proportional to the energy storage capacity and the cost of the power conversion equipment is proportional to the power rating of the system [17]. The cost of the ESS can be calculated as Equation (3). \[E_{i}=\frac{\mu_{C}C_{E}|P_{ESS,i}(t)|\Delta t\eta_{PCS}\sqrt{\eta}}{D}+\frac{ \mu_{D}C_{E}|P_{ESS,i}(t)|\Delta t}{D\eta_{PCS}\sqrt{\eta}} \tag{2}\]  
Figure 2: Schematic diagram of the proposed two-stage optimal planning strategy. \[Cost1=C_{bat}+C_{PCS}+C_{BOP} \tag{3}\]  
\[C_{bat}=\sum_{i=1}^{N_{tot}}C_{E}E_{i} \tag{4}\]  
\[C_{PCS}=\sum_{i=1}^{N_{tot}}C_{P}|P_{ESS,i}(t)| \tag{5}\]  
\[C_{BOP}=\sum_{i=1}^{N_{tot}}C_{B}E_{i} \tag{6}\]  
where the capacity of ESS at node \(i\) is represented by \(E_{i}\) and \(D\) is the maximum depth of discharging. The \(\mu_{C}/\mu_{D}\) is the charging/discharging sign of the ESS, when the ESS is charging, \(\mu_{C}\) is 1 and \(\mu_{D}\) is 0, and when the ESS is discharging, \(\mu_{C}\) is 0 and \(\mu_{D}\) is 1. \(\eta_{PCS}\) is the nominal efficiency of the power conversion system and \(\eta\) is the round-trip efficiency. \(\Delta t\) is the duration of the charging/discharging. \(P_{ESS,i}(t)\) is the real charging/discharging power of node \(i\) at time \(t\), and \(Cost1\) is the capital investment of ESS, \(C_{bat}\) is the cost of the storage unit which can be calculated by Equation (4). \(C_{E}\) is the price of ESS capacity per kW.h. The second term \(C_{PCS}\) is the cost of the power conversion equipment which can be calculated by Equation (5), and \(C_{P}\) is the charging cost per kW. The last term \(C_{BOP}\) is the cost of the necessary supporting facilities which can be calculated by Equation (6), and \(C_{B}\) is its cost per kW.h. Then Equation (3) can be rewritten as Equation (7). \[Cost1=\sum_{i=1}^{N_{tot}}\left(C_{E}E_{i}+C_{P}|P_{ESS,i}(t)|+C_{B}E_{i}\right) \tag{7}\]  
The Optimization objective function of the GA combined with SA is presented as follows. \[f1=\min\left[Cost1+C_{loss}+\left\{ \begin{array}{ll}0&\text{if \ voltage is within limits}\\ C_{\text{pun}}&\text{if \ the voltage is outside the limits}\end{array} \right.\right] \tag{8}\]  
where \(C_{loss}\) is the cost of line losses which can be calculated by the active power of the line loss multiplied by the average electricity price and \(C_{pun}\) is the cost of punishment applied by the utility for unsolved voltage issues. The objective of the optimization is to minimize the ESS capital cost and line loss cost at this stage, so the fitness function of the GA can be represented by the reciprocal of the objective function as Equation (9). \[Fit1=\frac{1}{Cost1+C_{loss}+\left\{ \begin{array}{ll}0&\text{if \ voltage is within limits}\\ C_{\text{pun}}&\text{if the voltage is outside the limits}\end{array} \right.}