## 2 Distributed Energy Storage Aggregation Model Based on Inner Approximation of Minkowski Sum
### Real-Time Optimization Scheduling Model
#### 3.3.2 Constraints
Objective function (52) endeavors to maintain a consistent storage level across all DES, with the constraints (53) indicates that partial response is allowed but over-response is prohibited. The solution of the problem can be obtained from the following equation:  
\[x_{r}^{*}= \begin{cases}0&v\in(-\infty,\alpha_{r}]\\ v-\alpha_{r}&v\in(\alpha_{r},(\alpha_{r}+\overline{x}_{r}))\\ \overline{x}_{r}&v\in[(\alpha_{r}+\overline{x}_{r}),\infty)\end{cases}  \tag{54}\]  
where \(x_{r}^{*}=\eta_{c}^{r}p_{\text{DES},t}^{r}\Delta t/E_{r}\) represents the SOC added by the \(r\)-th DES charging at \(p_{\text{DES},t}^{r}\) for \(\Delta t\) time; \(E_{r}\) is the capacity of the \(r\)-th DES; \(\overline{x}_{r}=\eta_{c}^{r}p_{\text{DES},\Delta t}^{r}\Delta t/E_{r}\) represents the SOC added by the \(r\)-th DES charging at rated power \(p_{\text{DES},c}^{r}\) for \(\Delta t\) time; \(\alpha_{r}=E_{\text{DES},t-1}^{r}/E_{r}\) represents the SOC of the \(r\)-th DES at the end of the \(t\)-1 time period. Writing \(x_{r}^{*}\) as \(x_{r}^{*}(v)\), \(x_{r}^{*}(v)\) is a segmented linear function of \(1/v\). \[\sum\limits_{r\in N}\frac{x_{r}^{*}(v)E_{r}}{\eta_{c}^{r}\Delta t}=p_{\text{ agg},t}^{c} \tag{55}\]  
Equation (55) has a unique root \(v^{*}\), which can be found by the WFA in Algorithm 1. If the aggregator receives a discharging command \(D_{t}^{d}\), the following problem is solved to determine the discharging power \(p_{\text{DES},t}^{r}\) of each DES:  
\[\min-\sum\limits_{r\in N}E_{r}\eta_{d}^{r}\log(1-\frac{E_{\text{DES},t-1}^{r} }{E_{r}}+\frac{p_{\text{DES},t}^{r}\Delta t}{\eta_{d}^{r}E_{r}}) \tag{56}\]\[ \begin{array}{ll}\text{s.t.}&0\leq p^{r}_{\text{DESd},t}\leq\hat{P}^{r}_{\text{ DESd},t},\forall r\\ &p^{d}_{\text{agg},t}=\sum\limits_{r\in N}p^{r}_{\text{DESd},t}\leq D^{d}_{t} \end{array}  \tag{57}\]  
where \(\hat{P}^{r}_{\text{DESd},t}=\min\Bigl{\{}p^{r}_{\text{DESd},t}\,(E_{r}-E^{r}_{ \text{DESd},t})\eta^{d}_{d}/\Delta t\Bigr{\}}\), \(p^{d}_{\text{agg},t}\) represents the aggregated discharging power at time \(t\). The solution to the problem can be obtained using the following equation:  
\[x^{*}_{r}= \begin{cases}0&v\in[\alpha_{r},\infty)\\ \alpha_{r}-v&\text{otherwise}\\ \overline{x}_{r}&v\in(-\infty,(\alpha_{r}-\overline{x}_{r})]\end{cases}  \tag{58}\]  
where \(x^{*}_{r}=p^{r}_{\text{DESd},t}\Delta t/\eta^{d}_{d}E_{r}\) denotes the SOC reduced by the time the \(r\)-th DES discharges\(\Delta t\) at \(p^{r}_{\text{DESd},t}\), \(\overline{x}_{r}=P^{r}_{\text{DESd},t}\Delta t/\eta^{d}_{d}E_{r}\) denotes the SOC reduced by the time the \(r\)-th DES discharges \(\Delta t\) at the rated power \(P^{r}_{\text{DESd},t}\); writing \(x^{*}_{r}\) as \(x^{*}_{r}(v)\), \(x^{*}_{r}(v)\) is a segmented linear function of \(1/v\). \[\sum\limits_{r\in N}\frac{x^{*}_{r}(v)\eta^{d}_{d}E_{r}}{\Delta t}=p^{d}_{\text {agg},t} \tag{59}\]  
Similarly, then the decomposition of the discharge power can be solved by the WFA. 1. Calculate \((\alpha_{r}+\overline{x}_{r})\) and \(\alpha_{r}\) (when charging) or \((\alpha_{r}-\overline{x}_{r})\) and \(\alpha_{r}\) (when discharging) for all ESS in this cluster, merge the two points with the same value, and count the total number of breakpoints as \(L\). The sorted sequence is \(\{v_{1},v_{1},\ldots,v_{L}\}\), which divides the range of \(v\) into \(L+1\) intervals. 2. For each interval \([v_{j},\ v_{j+1}]\)
3. Based on Equations \((\ref{eq:25})/(\ref{eq:25})\) Calculation \(x^{*}_{r}(v)\)
4. According to Equations \((\ref{eq:25})/(\ref{eq:25})\) find the \(v^{*}\)
5. if \(v^{*}\in[v_{j},\ v_{j+1}]\)
6. Record \(v^{*}\) and \(x^{*}_{r}(v)\)
7. else
8. Update \(j=j+1\) and return to step 3
9. end if
10. end for ```  
**Algorithm 1**Water-Filling Algorithm WFA