## 2 Mathematical Model of Distribution Network
### The Operation Constraints of Distribution Network
\[C_{\text{SOE,}i}(t+\Delta t)=C_{\text{SOE,}i}(t)-\left(P_{\text{ESS,}d,i}(t)/ \eta_{\text{d,}i}+P_{\text{ESS,}c,i}(t)\times\eta_{c,i}\right)\times\Delta t \times 100/S_{\text{ESS,}i}^{\text{N}} \tag{3}\]  
where, on the \(i\)-th power node, the initial SOE, rated power, rated capacity and charging and discharging efficiency of the ESS have been described as \(C_{\text{SOE,}i}^{\text{init}}P_{\text{ESS,}i}^{\text{N}}\), \(S_{\text{ESS,}i}^{\text{N}}\), \(\eta_{c,i}\) and \(\eta_{\text{d,}i}\). Equation (4) shows the energy balance relationship and initial state of charge in each typical day. The starting and ending SOEs of the ESS are \(C_{\text{SOE,}i}(0)\) and \(C_{\text{SOE,}i}(T)\). \[C_{\text{SOE,}i}(0)=C_{\text{SOE,}i}(T)=C_{\text{SOE,}i}^{\text{init}} \tag{4}\]  
The energy storage output power has been defined by Expression (5). \[P_{\text{ESS,}i}(t)=P_{\text{ESS,}d,i}(t)+P_{\text{ESS,}c,i}(t) \tag{5}\]  
Figure 1: The DES under the IEEE 33 distribution network. In addition to meeting the above equation constraints, the actual operation of the distributed energy system needs to meet some inequality constraints [28; 29]. Firstly, the actual power must be less than or equal to its rated power for DG as shown in Inequality (6). The maximum and minimum active power of the \(i\)-th DG are \(P^{\min}_{\text{DG},i}\) and \(P^{\max}_{\text{DG},i}\), respectively. Then, \(Q^{\min}_{\text{DC},i}\) and \(Q^{\max}_{\text{DG},i}\) are the maximum and minimum active power. \[\left\{ \begin{array}{l}P^{\min}_{\text{DG},i}\leq P_{\text{DG},i}(t)\leq P^{ \max}_{\text{DG},i}\\ Q^{\min}_{\text{DC},i}\leq Q_{\text{DC},i}(t)\leq Q^{\max}_{\text{DC},i}\\ \end{array} \right. \tag{6}\]  
Similarly, the Inequality (7) represents that the actual power is less than or equal to its rated power for ESS, and the SOE range of the \(i\)-th ESS is [\(C^{\text{L}}_{\text{SOE},i}\), \(C^{\text{D}}_{\text{SOE},i}\)]. At time \(t\), the binary variables indicating the charging and discharging statuses of the \(i\)-th ESS have been defined by \(u^{c}_{i}(t)\) and \(u^{d}_{i}(t)\). They have limited the ability of the ESS to charge and discharge energy at the same time. \[\left\{ \begin{array}{l}0\leq P_{\text{ESS},\text{d},i}(t)\leq u^{d}_{i}(t) \times P^{\text{N}}_{\text{ESS},i}\\ -u^{c}_{i}(t)\times P^{\text{N}}_{\text{ESS},i}(t)\leq P_{\text{ESS},c}(t)\leq 0 \\ u^{c}_{i}(t)+u^{d}_{i}(t)\leq 1\ \ \ \ \ u^{c}_{i}(t)=0 or1\ \ \ \ u^{d}_{i}(t)=0 or1\\ C^{\text{L}}_{\text{SOE},i}\leq C_{\text{SOE},i}(t)\leq C^{\text{U}}_{\text{ SOE},i}\\ \end{array} \right. \tag{7}\]  
In terms of new energy generation station, the output power must be less than or equal to the maximum power that can be output from the new energy field station at the current moment as shown in Inequality (8). The maximum active power of the \(i\)-th new energy generation station has been described as \(P^{\text{ref}}_{\text{New},i}(t)\). \[0\leq P_{\text{New},i}(t)\leq P^{\text{ref}}_{\text{New},i}(t) \tag{8}\]  
Meanwhile, considering the requirements of power grid operation, it is necessary to limit the voltage of power grid nodes and branch currents, as shown in Inequality (9) where the maximum value of the node voltage and the branch current have been defined as \(U_{\max}\) and \(I_{\max}\), respectively. The minimum value of the node voltage is \(U_{\min}\). \[\left\{ \begin{array}{l}U_{\min}\leq U_{i}(t)\leq U_{\max}\\ 0\leq I_{ij}(t)\leq I_{\max}\\ \end{array} \right. \tag{9}\]  
In addition to the above common inequality constraints, the distributed power supply and energy storage system can output both active and reactive power, and the actual output of active and reactive power shows a quadratic inequality relationship with the rated power of DG and ESS, as shown in Inequality (10) where the rated power of the DG and ESS on the \(i\)-th power node are \(S^{\text{N}}_{\text{DG},i}\) and \(P^{\text{N}}_{\text{ESS},i}\), respectively. \(|\cdot|\cdot|\)\({}_{2}\) represents the 2-norm of the vector. \[\left\{