Constraints for Active Supply and Demand Balance

The supply–demand balance constraint for the considered hybrid microgrid is formulated as

$$\sum\_{j \in \mathcal{S}\_{\rm TG}} P\_{\rm TG,i}(t) + \sum\_{j \in \mathcal{S}\_{\rm WT}} P\_{\rm WT,j}(t) + \sum\_{k \in \mathcal{S}\_{\rm SL}} P\_{\rm SL,k}(t) + \sum\_{r \in \mathcal{S}\_{\rm BS}} P\_{\rm BS,r}(t) = \sum\_{s \in \mathcal{S}\_{\rm DM}} P\_{\rm DM,s}(t) \tag{6}$$

where *SDM* is the set of all load cells in the AC/DC hybrid microgrid, and *PDM*,*s*(*t*) is the load demand value of load unit *s* at the moment *t*. Besides, the DC sub-grid and AC sub-grid of the microgrid must also meet the constraints of the active balance equation.

a. Constraint for DC side active balance:

$$\sum\_{k \in S\_{SL}} P\_{SL,k}(t) + \sum\_{r \in S\_{RS}} P\_{BS,r}(t) + P\_{AC-DC}(t) = \sum\_{s \in S\_{DCDM}} P\_{DCDM,s}(t) \tag{7}$$

where *PAC*<sup>−</sup>*DC*(*t*) is the interaction power between the AC and DC sub-grids through the commutation line and *SDCDM* is the set of DC load cells.

b. Constraints for AC side active balance:

$$\sum\_{j \in S\_{\rm TG}} P\_{\rm TG,i}(t) + \sum\_{j \in S\_{\rm WT}} P\_{\rm WT,j}(t) - P\_{\rm AC-DC}(t) = \sum\_{s \in S\_{\rm ACMM}} P\_{\rm ACDM,s}(t) \tag{8}$$

where *SACDM* is the set of AC load cells, and *PACDM*,*s*(*t*) is the load value of DC load unit *s* at moment *t*.

Constraints for Traditional Generator Set Operation

a. Active power upper and lower bound:

$$P\_{TG,i}^{\min}(t) \le P\_{TG,i}(t) \le P\_{TG,i}^{\max}(t) \tag{9}$$

where *P*min *TG*,*i* (*t*) and *P*max *TG*,*i* (*t*) are the active adjustable lower limit and upper limit of the conventional generator set at the moment *t*, respectively.

b. Constraint for output climbing:

$$-\Delta P\_{TG,i}^d \le P\_{TG,i}(t) - P\_{TG,i}(t-1) \le \Delta P\_{TG,i}^u \tag{10}$$

where Δ*P<sup>u</sup> TG*,*<sup>i</sup>* and <sup>Δ</sup>*Pd TG*,*<sup>i</sup>* are the maximum of active power during the time period [*<sup>t</sup>* <sup>−</sup> 1,*t*] of the traditional generator set *i*.

Constraints for Operating the Energy Storage Unit

a. Charging and discharging power upper and lower bounds:

$$
\underline{P}\_{BS,r} \le P\_{BS,r}(t) \le \overline{P}\_{BS,r} \tag{11}
$$

where *PBS*,*r*(*t*) is the output power of the *r*th BS at moment *t*, it is positive at the time of discharge and negative at the time of charging. *PBS*,*<sup>r</sup>* and *PBS*,*<sup>r</sup>* are the upper and lower bounds of the charging and discharging power of the *r*th BS, respectively.

b. Energy storage unit state of charge constraints:

$$\text{SOC}\_{BS\_{\mathcal{F}}}^{\text{min}} \le \text{SOC}\_{BS\_{\mathcal{F}}}(t) \le \text{SOC}\_{BS\_{\mathcal{F}}}^{\text{max}} \tag{12}$$

where *SOC*max *BS*,*<sup>r</sup>* and *SOC*min *BS*,*<sup>r</sup>* are the upper and lower constraints the *r*th BS, respectively.

c. Energy storage unit capacity continuity constraints:

The relationship between the value of the energy storage unit at the moment and the previous moment can be expressed as

$$SOC\_{BS,r}(t) = \begin{cases} SOC\_{BS,r}(t-1) - \frac{P\_{BS,r}(t)\eta\_r^{ch}\Delta T}{E\_r} & P\_{BS,r}(t) < 0\\ SOC\_{BS,r}(t-1) - \frac{P\_{BS,r}(t)\Delta T}{E\_r\eta\_r^{dis}} & P\_{BS,r}(t) \ge 0 \end{cases} \tag{13}$$

where η*ch <sup>r</sup>* and η*dis <sup>r</sup>* are the charging and discharging efficiencies of the *r*th BS respectively, *Er* represents the maximal capacity bound of the *r*th BS, and Δ*T* is the time interval from time *t* − 1 to time *t*.

When considering the constraint for power capacity of the energy storage unit, the upper and lower limits of the active energy for energy storage unit are shown as

$$\begin{cases} P\_{BS,r}^{\max}(t) = \min(\overline{P}\_{BS,r}, P\_{BS,r}^{ch}(t)) \\ P\_{BS,r}^{\min}(t) = \max(\underline{P}\_{BS,r'}, P\_{BS,r}^{dis}(t)) \end{cases} \tag{14}$$

where *P*max *BS*,*r*(*t*) and *<sup>P</sup>*min *BS*,*r* (*t*) are the power required by the *r*th BS to charge to the upper limit and discharge to the lower limit during the time period [*t* − 1,*t*], respectively. *P*max *BS*,*r*(*t*) and *<sup>P</sup>*min *BS*,*r* (*t*) denote the upper and lower limits of the *r*th BS at the moment *t*, respectively.

#### Wind Generator Photovoltaic Output Constraints

The adjustable ranges of the active output of wind power and photovoltaic power generation units are expressed as

$$0 \le P\_{WT,j}(t) \le P\_{WT,j}^{st}(t) \tag{15}$$

$$0 \le P\_{SL,k}(t) \le P\_{SL,k}^{st}(t) \tag{16}$$

AC and DC Tie Line Constraints

The power constraints for the commutation connection line of AC and DC sub-grids at the moment *t* are given as

$$P\_{\rm AC\\_DC}^{\rm min} \le P\_{\rm AC\\_DC}(t) \le P\_{\rm AC\\_DC}^{\rm max} \tag{17}$$

where *P*max *AC*\_*DC* and *<sup>P</sup>*min *AC*\_*DC* are the limit of the power transmitted connection line, and if *<sup>P</sup>*min *AC*\_*DC* is a negative value, it indicates the upper limit of the power delivered from the DC sub-grid to the AC sub-grid.

## 3.2.3. Solutions

In our paper, for processing the single period distributed economic dispatching model, the Lagrangian multiplier method is used. Let λ be the Lagrangian multiplier; at first, the inequality constraints are ignored, then the considered optimization problem is given as

$$\begin{array}{lcl} \min L &=& \sum\_{i \in S\_{TG}} \mathbb{C}\_{i} (P\_{TG,i}) + \sum\_{j \in S\_{WT}} \mathbb{C}\_{j} \Big( P\_{WT,j} \Big) + \sum\_{k \in S\_{SL}} \mathbb{C}\_{k} \Big( P\_{SL,k} \Big) + \sum\_{r \in S\_{BS}} \mathbb{C}\_{r} (P\_{BS,r}) \\ &+ \lambda \Big( \sum\_{s \in S\_{DM}} P\_{DM,s} - \sum\_{i \in S\_{TG}} P\_{TG,i} - \sum\_{j \in S\_{WT}} P\_{WT,j} - \sum\_{k \in S\_{SL}} P\_{SL\_{k}} - \sum\_{r \in S\_{BS}} P\_{BS,r} \Big) \end{array} \tag{18}$$

By applying the Karush-Kuhn-Tucker (KKT) first-order optimality condition, the partial derivative of the decision quantity and Lagrangian multiplier can be obtained:

$$\begin{array}{lcl}\frac{\partial L}{\partial T\_{TG,i}} = \frac{\partial C\_{i}(P\_{TG,i})}{\partial P\_{TG,i}} - \lambda = 2a\_{TG,i}P\_{TG,i} + b\_{TG,i} - \lambda = 0\\ \frac{\partial L}{\partial P\_{WT,i}} = \frac{\partial C\_{i}(P\_{WT,i})}{\partial P\_{WT,i}} - \lambda = 2a\_{WT,i}(P\_{WT,i} - P\_{WT,i}^{st}) - \lambda = 0\\ \frac{\partial L}{\partial P\_{SL,k}} = \frac{\partial C\_{i}(P\_{SL,k})}{\partial P\_{SL,k}} - \lambda = 2a\_{SL,k}(P\_{SL,k} - P\_{SL,k}^{st}) - \lambda = 0\\ \frac{\partial L}{\partial P\_{BS,i}} = \frac{\partial C\_{i}(P\_{BS,i})}{\partial P\_{BS,i}} - \lambda = 2a\_{BS,i}P\_{BS,r} - \lambda = 0\\ \frac{\partial L}{\partial \lambda} = \sum\_{s \in S\_{TM}} P\_{DM,s} - \sum\_{j \in S\_{WT}} P\_{TG,j} - \sum\_{j \in S\_{WT}} P\_{SL,k} - \sum\_{r \in S\_{RS}} P\_{RS,r} = 0\end{array} \tag{19}$$

When the operating incremental costs are equal, the Lagrangian function, *L*, takes the minimum value and the resulting λ is the optimal incremental costs. The corresponding operating cost factors are integrated to obtain the following unified form:

$$2\overline{a}\_{i}\mathcal{P}\_{i} + \tilde{b}\_{i} - \lambda = 0, \qquad i \in \mathcal{S}\_{TG} \cup \mathcal{S}\_{WT} \cup \mathcal{S}\_{SL} \cup \mathcal{S}\_{BS} \tag{20}$$

that is

$$P\_i = \frac{\lambda - \tilde{b}\_i}{2\tilde{a}\_i} \tag{21}$$

where *a*˜*<sup>i</sup>* and ˜ *bi* are the operating cost coefficient of the unit *i* after integration, and *P*˜*<sup>i</sup>* is the active output of the unit *i*.

#### **4. Two-Layer Consensus Strategy**

⎧

⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎩

Due to the fact that the distributed control method does not need to set the control center, which only exchanges information between adjacent nodes and shares information, at last, the state of each node can reach consensus. Different from the traditional centralized control strategy, the distributed methods are able to effectively avoid some disadvantages caused by the failure of the control center, so they are more efficient and flexible.

In the microgrid, for simplicity, the power mismatch between the total generated power and total power demand is defined as

$$\Delta P = \sum\_{s \in S\_{\rm DM}} P\_{\rm DM,s}(t) - \sum\_{i \in \mathcal{S}\_{\rm TG}} P\_{\rm TG,i}(t) - \sum\_{j \in \mathcal{S}\_{\rm WT}} P\_{\rm WT,j}(t) - \sum\_{k \in \mathcal{S}\_{\rm SL}} P\_{\rm SL,k}(t) - \sum\_{r \in \mathcal{S}\_{\rm BS}} P\_{\rm BS,r}(t) \tag{22}$$

where the DC side and AC side power deviations can be expressed as

$$\Delta P\_{\rm DC} = \sum\_{s \in S\_{\rm DCDM}} P\_{\rm DCDM,s}(t) - \sum\_{k \in S\_{\rm SL}} P\_{\rm SL,k}(t) - \sum\_{r \in S\_{\rm RS}} P\_{\rm BS,r}(t) - P\_{\rm AC-DC}(t) \tag{23}$$

$$
\Delta P\_{\text{AC}} = \sum\_{s \in S\_{\text{ACDM}}} P\_{\text{ACDM},s}(t) - \sum\_{i \in S\_{TG}} P\_{TG,i}(t) - \sum\_{j \in S\_{WT}} P\_{WT,j}(t) + P\_{AC-DC}(t) \tag{24}
$$
