## 2 Modeling of Multi-Microgrid Energy Management  
As an important subject of integrated distributed renewable energy [22], the power exchange of a MMG at the PCC has great uncertainty, which will impact the distribution network. To this end, this paper constructs a MMG energy management model. The interaction between the MMG and the distribution network is shown in Figure 1. The information is transmitted between the distribution network and the MMG through a two-way communication network. The DSO releases retail electricity prices to the MMG in real time, and each MG feeds back its electricity purchase or sales based on the retail price. The objective of the DSO is to improve the profit of distribution network through an appropriate retail electricity price strategy, while smoothing the power exchange curve at the PCC. The DSO sets the retail price by solving the following problems:  
\[\text{Max}\ E\Big{(}(1-\alpha)f_{t}^{d}\big{/}f_{base}^{d}-\alpha\varphi_{t}^ {d}/\varphi_{base}^{d}\Big{)} \tag{1}\]  
\[f_{t}^{d}=\Big{(}\lambda_{t}^{d}-\lambda_{t}^{c}\Big{)}\tau\sum_{m=1}^{N_{m}} \varepsilon_{m}P_{m}^{b}(t) \tag{2}\]  
\[\varphi_{t}^{d}=\big{|}P^{x}(t)-P^{st}\big{|}\mathbb{I}\big{(}\big{|}P^{ex}(t) -P^{st}\big{|}\geq P_{thr}\big{)} \tag{3}\]  
\[P^{ex}(t)=\sum_{m=1}^{N_{m}}\Big{(}\varepsilon_{m}P_{m}^{b}(t)-P_{m}^{s}(t)/ \varepsilon_{m}\Big{)} \tag{4}\]  
Figure 1: Multi-microgrid energy management system framework. factor of the line. It is always greater than one, because the network gateway for settlement is at the PCC. In addition, the MG also needs to meet the following constraints:  
\[P_{j}^{\text{g,min}}\leq P_{j}^{\text{g}}(t)\leq P_{j}^{\text{g,max}} \tag{13}\]  
\[0\leq\sum_{z\in Z}P_{z}^{\text{D}}(t)\leq k_{d}P^{load}(t) \tag{14}\]  
\[P^{\text{B,min}}\leq P^{\text{B}}(t)\leq P^{\text{B,max}} \tag{15}\]  
\[SOC(t+1)=SOC(t)+\varepsilon_{c}P^{\text{B}}(t)\tau\mathbb{I}\Big{(}P^{\text{ B}}(t)\geq 0\Big{)}/cap+P^{\text{B}}(t)\tau\mathbb{I}\Big{(}P^{\text{B}}(t)<0 \Big{)}/\varepsilon_{disc}cap \tag{16}\]  
\[\text{Max}\ E\Big{(}(1-\alpha)f_{t}^{d}\big{/}f_{base}^{d}-\alpha\varphi_{t}^ {d}/\varphi_{base}^{d}\Big{)} \tag{1}\]0  
\[\text{Max}\ E\Big{(}(1-\alpha)f_{t}^{d}\big{/}f_{base}^{d}-\alpha\varphi_{t}^ {d}/\varphi_{base}^{d}\Big{)} \tag{1}\]1  
where Equation (13) is the constraint on the output of controllable unit; \(P_{j}^{\text{g,min}}\) and \(P_{j}^{\text{g,max}}\) are the output lower and upper limit of unit \(j\), respectively. Equation (14) is a constraint on the power of the demand response block. \(K_{d}\) is the proportion of the load participating in the demand response, and the power curtailment of the demand response cannot exceed the limit. Equation (15) limits the power exchange \(P^{\text{B}}\) of the energy storage battery. \(P^{\text{B}}\)\(>\) 0 means that the MG charges the battery, and \(P^{\text{B}}\)\(<\) 0 means that the battery provides power support to the MG. \(P^{\text{B,min}}\) and \(P^{\text{B,max}}\), respectively, represent the power limits of discharge and charging of the battery. Equation (16) is the model of an energy storage system. \(\varepsilon_{C}\) and \(\varepsilon_{Disc}\) represent the charging and discharging efficiency of the energy storage battery, respectively. Additionally, \(cap\) represents the capacity of the battery. The logic function represents the current state of charge and discharge of battery, and \(SOC\) changes with the charging and discharging process. Equation (17) limits the range of \(SOC\). \(SOC^{min}\) and \(SOC^{max}\) represent the lower and upper limits of \(SOC\), respectively. Equation (18) is the balance constraint of the MG power. \(P^{Wind}\) and \(P^{PV}\) represent the output of the wind power generator and photovoltaic panel, respectively. It is necessary for all power systems to meet the power balance constraints, and the same for multi-microgrid systems. Power-flow constraints are satisfied in power systems with a demand response [23] and distributed energy systems [24].