*2.1. Structure Description*

The micro energy grid includes energy production, conversion, storage equipment, and energy consumers. Energy production equipment includes the wind power plant (WPP), photovoltaic power generation (PV) and conventional gas turbine (CGT). Energy conversion equipment includes power-to-gas (P2G), power to heating (P2H), heating to cooling (H2C), and power to cooling (P2C). Energy storage equipment includes a gas storage tank (GS), power storage battery (PS), heat storage tank (HS), and cold storage tank (CS). At the same time, in order to motivate users under a flexible load to participate in the optimal operation of the MEG, the price-based demand response (PBDR) and incentive-based demand response (IBDR) are implemented. The former is used to guide terminal users to use electricity reasonably through the performance of a differentiated time-of-use price, while the IBDR is mainly used to provide an emergency energy supply to the MEG. In the MEG, power electronics converters are required for some voltage adaptations—for instance, the PV generation—and the type of grid is AC. All the power from different devices must be converted into AC. Figure 1 shows the structure of the micro energy grid.

**Figure 1.** Structure of the micro energy grid.

According to Figure 1, MEGs are connected with an upper power grid, gas grid, heat grid and cold grid. An MEG can interact with upper energy grids. When there is excess energy in MEGs, it can be sold to upper energy grids to obtain economic benefits. Conversely, when the internal energy of an MEG is insufficient, energy will be bought from superior energy grids. Because the real-time price of different energy is different, the MEG will reasonably choose the energy sale or purchase scheme according to the different prices of electricity, heating, cooling, and gas, so as to achieve the goal of maximizing operating benefit. However, the output power of WPP and PV has strong uncertainty and high environmental economics. Therefore, maintaining the balance of the operational benefit and risk will be a key issue for formulating the optimal operation plan of the MEG.

#### *2.2. Energy Devices Operation Model*

The energy devices operation model includes the energy production (EP) operation model, energy conversion (EC) operation model and energy storage (ES) operation model.

#### 2.2.1. EP Operation Model

EP equipment contains WPP, PV, and CGT. WPP is decided by the wind speed and PV is decided by the solar radiation, while CGT mainly produces heat vapor by consuming natural gas for the power supply and heat supply. Generally speaking, CGT includes two types: following thermal load (FTL) and following electric load (FET). This paper sets CGT to operate in FTL mode. The output models of different devices are as follows:

#### (1) WPP operation model

Wind power generation is determined by the wind speed. The WPP generation output is calculated according to the real-time wind speed and fan parameters:

$$\begin{aligned} \prescript{}{}{\mathcal{G}}\_{\text{WPP},t}^{\*} = \begin{cases} 0, & \upsilon\_{l} \le \upsilon\_{in} \\ \frac{\upsilon - \upsilon\_{in}}{\upsilon\_{R} - \upsilon\_{in}} \underline{\mathcal{G}}\_{R'} \upsilon\_{in} \le \upsilon\_{l} \le \upsilon\_{R} \\\ \underline{\mathcal{G}}\_{R'} & \upsilon\_{R} \le \upsilon\_{l} \le \upsilon\_{out} \\\ 0, & \upsilon\_{l} \ge \upsilon\_{out} \end{cases} \end{aligned} \tag{1}$$

### (2) PV output model

PV power generation is determined by the solar photovoltaic radiation. On the basis of photoelectric conversion principles, PV output power is calculated as follows:

$$\mathbf{g}\_{PV,t}^{\*} = \eta\_{PV} \times \mathbf{S}\_{PV} \times \boldsymbol{\theta}\_{t} \tag{2}$$

(3) CGT output model

When natural gas enters the gas turbine combustion chamber, it generates hot steam to drive the turbine to work by combustion, and the exhausted hot gas can provide heating energy to users through a heat recovery device. As for the principle of the gas turbine, existing research is very mature [18]. This paper directly quotes power and heating supply models in reference [19]. The specific model is as follows:

$$\log \text{GGT}\_{,t} = V\_{\text{CGT},t} H\_{\text{n\%}} \eta\_{\text{CGT},t} \tag{3}$$

$$Q\_{\rm CGT,t} = V\_{\rm CGT,t}(1 - \eta\_{\rm CGT,t} - \eta\_{\rm loss})\eta\_{\rm hr} \tag{4}$$

#### 2.2.2. EC Operation Model

EC mainly includes power-to-gas (P2G), power-to-cooling (P2C), power-to-heat (P2H), and heat-to-cooling (H2C) convertors. The operating power model of various types of EC equipment has already been constructed in our previous works [19].

#### (1) P2G device

P2G can utilize the curtailment output of WPP and PV to convert CO2 into CH4, which realizes the interconnection of the power grid and gas network. P2G is divided into two processes: electrolysis and methanation. Electrolysis uses excess electricity to generate hydrogen by electrolyzing water and injecting it into the natural gas pipeline or a storage device. On the basis of electrolysis, the methanation process uses the hydrogen to react with carbon dioxide to form methane and water under the action of a catalyst. Figure 2 shows the technical principles of P2G-GS operation.

**Figure 2.** Technical principles of P2G-GS operation.

The CH4 generated by P2G can be injected into a natural gas network, conventional gas turbines (CGT), gas boilers (GB), and a gas storage tank (GST). The detailed operation model is as follows:

$$V\_{P2G,t} = \lg p\_{2G,t} \eta\_{P2G} / H\_{n\_{\overline{\infty}}} \tag{5}$$

Furthermore, the proportions of natural gas generated by P2G and injected into the CGT, GS and natural gas network are η*CGT P*2*G*,*t* , η*GS P*2*G*,*t* , and η*NG P*2*G*,*t* .

### (2) Other devices

There is a certain efficiency in the conversion between different energies. Although the efficiency is not constant, it usually does not change much when the equipment runs steadily. According to reference [20], it can be regarded as constant. The mathematical model of the energy conversion unit is expressed as:

$$
\begin{bmatrix} V\_{P2G,t} \\ Q\_{P2C,t} \\ Q\_{P2H,t} \\ Q\_{H2C,t} \end{bmatrix} = \begin{bmatrix} \mathcal{g}p\_{2G,t} & 0 & 0 & 0 \\ 0 & \mathcal{g}p\_{2C,t} & 0 & 0 \\ 0 & 0 & \mathcal{g}p\_{2H,t} & 0 \\ 0 & 0 & 0 & Q\_{H2C,t} \end{bmatrix} \begin{bmatrix} \eta p\_{2G} \\ \eta p\_{2C} \\ \eta p\_{2H} \\ \eta H2C \end{bmatrix} \tag{6}
$$

#### 2.2.3. ES Operation Model

ES mainly includes power storage (PS), heat storage (HS), cooling storage (CS), and gas storage (GS). According to the relevance between the energy supply and energy demand, different types of energy storage equipment can use their own energy storage facilities to store and release energy. The specific operation model is as follows:

$$S\_{ES,t} = \left(1 - \eta\_{ES,t}^{loss}\right) S\_{ES,t-1} + \left[ES\_t^{input}\eta\_{ES}^{input} - ES\_t^{output}/\eta\_{ES}^{output}\right] \tag{7}$$

## *2.3. DR Operation Model*

The DR operation model mainly includes the price-based demand response (PBDR) operation model and the incentive-based demand response (IBDR) operation model.

#### 2.3.1. PBDR Operation Model

The PBDR guides the terminal users to use energy reasonably by implementing a peak-valley time-of-use price, which can realize "peak-cutting and valley-filling". According to microeconomic principles, the PBDR can be calculated by the price elasticity of demand [10], as follows:

$$E\_{st} = \frac{\Delta L\_s / L\_s^0}{\Delta P\_t / P\_t^0} \begin{cases} E\_{st} \le 0, s = t \\ E\_{st} \ge 0, s \ne t \end{cases} \tag{8}$$

where when *s* = *t*, *Ee*,*h*,*<sup>c</sup> st* is self-elasticity; when *s t*, *Ee*,*h*,*<sup>c</sup> st* is cross-elasticity. Correspondingly, the change of energy demand load after PBDR is calculated as follows:

$$L\_t^{after} = L\_t^{before} \times \left\{ E\_{tt} \times \frac{\left[P\_t^{after} - P\_t^{before}\right]}{P\_t^{before}} + \sum\_{s=1 \atop s \neq t}^{24} E\_{st} \times \frac{\left[P\_s^{after} - P\_s^{before}\right]}{P\_s^{before}}\right\} \tag{9}$$

where Δ*L a f ter <sup>t</sup>* indicates the amount of load change after PBDR.

#### 2.3.2. IBDR Operation Model

The IBDR is signed by the MEG operator and terminal users in advance. When emergency energy demand occurs, the operator can directly control the energy usage behavior of the terminal users and give some financial compensation. According to reference [10], demand response providers (DRPs) are involved in the demand response stage by stage, mainly on the basis of different energy prices. Therefore, the operation of DRPs should meet the following principles:

$$D\_{i}^{k,j,\text{min}} \le \Delta L\_{i,t}^{k,j} \le D\_{i,t'}^{k,j}, j = 1 \tag{10}$$

$$0 \le \Delta L\_{i,t}^{k,j} \le \left(D\_{i,t}^{k,j} - D\_{i,t}^{k,j-1}\right), j = 2,3,\dots,J \tag{11}$$

$$
\Delta L\_t^{kJB} = \sum\_{i=1}^{I} \sum\_{j=1}^{J} \Delta L\_{i,t}^{k,j} \tag{12}
$$

#### **3. Basic Dispatching Model of the Micro Energy Grid**

The section covers the construction of the basic scheduling optimal model for the micro energy grid, aimed at maximizing the economic revenue of operation considering the constraints of the energy power balance, device operation, and system reserve balance.

#### *3.1. Objective Functions*

The micro energy grid is mainly supplied by WPP, PV and CGT. Through conversion and storage equipment, it can meet electricity, heating, cooling and gas load demands together. WPP and PV have the characteristics of a low marginal cost of power generation and zero emissions of pollution. This paper chooses maximizing the operating revenue as the operational optimization goal of the MEG. The specific objective function is as follows:

$$\text{max}R = \sum\_{t=1}^{24} \left\{ R\_{EP,t} + R\_{EC,t} + R\_{ES,t} + R\_{DR,t} + R\_{Carbon,t} \right\} \tag{13}$$

The remaining carbon emission rights can be traded externally when the carbon emissions of the MEG are less than the maximum emission trade allowance (META). For EP, the operating revenue is equal to the energy supply income minus the energy supply cost. The energy supply revenue is equal to the product of the electricity quantity and its price. The marginal cost of WPP and PV is basically close to zero. The energy supply cost of CGT includes the fuel consumption cost and start-stop cost, which is calculated as follows:

$$\begin{aligned} \mathbf{C\_{GT,t}} &= \mathbf{C\_{GT,t}^{fuel}} + \mathbf{C\_{GT,t}^{ad}} \\ &= \begin{Bmatrix} a\mathbf{g}\_{\text{GGT,t}} + \theta\_{h}^{\epsilon} \mathbf{Q\_{GGT,t}} \\ b\mathbf{g}\_{\text{GGT,t}} + \theta\_{h}^{\epsilon} \mathbf{Q\_{GGT,t}} \end{Bmatrix} + c \end{aligned} + \left\{ \begin{bmatrix} \mu\_{\text{GGT,t}}^{u} (1 - \mu\_{\text{GGT,t-1}}^{u}) \mathbf{C\_{GGT,t}^{u}} \\ \mu\_{\text{GGT,s}}^{d} (1 - \mu\_{\text{GGT,s+1}}^{d}) \mathbf{C\_{GGT,s+1}^{d}} \end{bmatrix} \right. \end{aligned} \tag{14}$$

For EC and ES, the operating revenue is equal to the energy output (energy release) income minus the energy input (energy storage) cost. The calculation is as follows:

$$R\_{\rm EC(S),t} = Q\_{\rm EC(S),t}^{output} p\_{\rm EC(S)}^{output} \eta\_{\rm EC(S)}^{output} - Q\_{\rm EC(S),t}^{input} p\_{\rm EC(S)}^{input} / \eta\_{\rm EC(S)}^{input} \tag{15}$$

For DR, operation revenue includes PBDR income and IBDR income. The former can increase the energy supply, while the latter is mainly to reduce the penalty cost of a power shortage. The calculation is as follows:

$$R\_{DR,t} = R\_{PBDR,t} + R\_{IBDR,t} = \sum\_{t=1}^{24} \left[ p\_t^{before} L\_t^{before} - p\_t^{after} L\_t^{after} \right] + \sum\_{k \in \{\text{non-heating}\}} \left\{ \Delta L\_t^{kIB} p\_t^{kIB} - \Delta L\_t^{k,short} p\_t^k \right\} \tag{16}$$

$$R\_{\text{Carbon},t} = \left\{ \left[ a\_{\text{GCT}} + b\_{\text{GCT}} \left( \mathbf{g}\_{\text{GCT},t} + \theta\_h^\varepsilon \mathbf{Q}\_{\text{GCT},t} \right) + \mathbf{c}\_{\text{GCT}} \left( \mathbf{g}\_{\text{GCT},t} + \theta\_h^\varepsilon \mathbf{Q}\_{\text{GCT},t} \right)^2 \right] - \mathbf{Q}\_{\text{MTEA},t} \right\} \mathbf{p}\_{\text{Carbon},t} \tag{17}$$

#### *3.2. Condition Constraints*

To achieve an optimal supply of electricity, heating and cooling, it is necessary to comprehensively consider the energy supply and demand balance constraint, EP, EC, ES operation constraint, and system rotation reserve constraint of MEGs. The specific constraints are as follows:

(1) Energy supply and demand balance constraint

$$\mathbf{g}\_{\rm CGT,i} + \mathbf{g}\_{\rm WPP,i} + \mathbf{g}\_{\rm PV,i} + \mathbf{g}\_{\rm PS,i}^{\rm output} + \mathbf{g}\_{\rm P2C,i}^{\rm output} + \mathbf{g}\_{\rm LPG,i} = L\_{\rm I}^{\epsilon} + \mathbf{g}\_{\rm ES,j}^{\rm input} + \mathbf{g}\_{\rm P2G,i}^{\rm input} + \mathbf{g}\_{\rm P2G,j}^{\rm input} + \Delta L\_{\rm I}^{p,PB} + \Delta L\_{\rm I}^{t,IB} \tag{18}$$

$$\mathbf{Q}\_{\rm GGT,t} + \mathbf{Q}\_{\rm P2H,t}^{\rm output} + \mathbf{Q}\_{\rm HS,t}^{\rm output} + \mathbf{Q}\_{\rm LHG,t} = \mathbf{L}\_t^h + \mathbf{Q}\_{\rm HS,t}^{\rm input} + \mathbf{Q}\_{\rm H2C,t}^{\rm input} + \Delta \mathbf{L}\_t^{h.\rm PB} + \Delta \mathbf{L}\_t^{h.\rm IB} \tag{19}$$

$$\mathbf{Q}\_{\rm P2C,t}^{\rm output} + \mathbf{Q}\_{\rm H2C,t}^{\rm output} + \mathbf{Q}\_{\rm CS,t}^{\rm output} + \mathbf{Q}\_{\rm LICG,t} = L\_t^{\rm c} + \mathbf{Q}\_{\rm CS,t}^{\rm input} + \Delta L\_t^{\rm c,PB} + \Delta L\_t^{\rm c,IB} \tag{20}$$

#### (2) CGT operation constraints

For CGT, the relevance of the power generation and heating supply power is called the "electrical heating character." Under a given thermal power, the power generated has some adjustability. This is because under a given amount of steam extracted, CGT adjusts the output power of the entire steam turbine by adjusting the amount of condensation steam to generate electricity. However, the larger the amount of steam extracted, the smaller the proportion of condensing steam required to generate electricity, so the adjustment range is smaller. The specific constraints are as follows:

$$\max \left| g\_{\rm CGT}^{\rm min} - c\_{\rm min} Q\_{\rm CGT}, c\_{\rm m} \left( Q\_{\rm CGT} - Q\_{\rm CGT}^{\rm 0} \right) \right| \le g\_{\rm CGT} \le g\_{\rm CGT}^{\rm max} - c\_{\rm max} Q\_{\rm CGT} \tag{21}$$

$$\boldsymbol{\mu}\_{\text{CGT},t} \Delta \mathbf{g}\_{\text{CGT}}^{-} \le \left( \mathbf{g}\_{\text{CGT},t} + \boldsymbol{\theta}\_{h}^{\epsilon} \boldsymbol{Q}\_{\text{CGT},t} \right) - \left( \mathbf{g}\_{\text{CGT},t-1} + \boldsymbol{\theta}\_{h}^{\epsilon} \boldsymbol{Q}\_{\text{CGT},t-1} \right) \le \boldsymbol{\mu}\_{\text{CGT},t} \Delta \mathbf{g}\_{\text{CGT}}^{+} \tag{22}$$

where *c* is the reduction of power caused by extra extraction of the unit heating supply when the steam inlet amount is constant. *cm* = Δ*gCGT*/Δ*QCGT* is the elasticity coefficient of electricity power and heating power under backpressure operation. *Q*<sup>0</sup> *CGT* is a constant.

#### (3) EC operation constraints

EC includes P2H, P2C, H2C, and P2G. According to Equation (8), the energy conversion relevance of different devices can be established. Different energy conversion devices have their own power constraints; the details are as follows:

$$
\mu\_{P2G,t} V\_{P2G,t}^{\text{min}} \le V\_{P2G,t} \le \mu\_{P2G,t} V\_{P2G,t}^{\text{max}} \tag{23}
$$

$$
\mu\_{\rm EC,t}^{\rm output} Q\_{\rm EC,t}^{\rm output,min} \le Q\_{\rm EC,t}^{\rm output} \le \mu\_{\rm EC,t}^{\rm output} Q\_{\rm EC,t}^{\rm output,max} \tag{24}
$$

$$u\_{\rm EC,t}^{input} Q\_{\rm EC,t}^{input,\rm min} \le Q\_{\rm EC,t}^{input} \le u\_{\rm EC,t}^{input} Q\_{\rm EC,t}^{input,\rm max} \tag{25}$$

#### (4) ES operation constraints

ESD includes ES, HS, CS, and GS. Energy storage capacity constraints should also be considered when various types of energy storage equipment store or release energy. The specific constraints are as follows:

$$S\_{ES,t}^{\min} \le S\_{ES,t} \le S\_{ES,t}^{\max} \tag{26}$$

$$
\mu\_{ES,t}^{output} Q\_{ES,t}^{output,\min} \le Q\_{ES,t}^{output} \le \mu\_{ES,t}^{output} Q\_{ES,t}^{output,\max} \tag{27}
$$

$$
\mu\_{ES,t}^{input} \mathbf{Q}\_{ES,t}^{input, \text{min}} \le \mathbf{Q}\_{ES,t}^{input} \le \mu\_{ES,t}^{input} \mathbf{Q}\_{ES,t}^{input, \text{max}} \tag{28}
$$

#### (5) System reserve constraints

MEGs are set to operate according to the "following thermal load" mode, so some electrical load reserve capacity and cooling load reserve capacity need to be reserved. In addition, the randomness of WPP and PV also requires MEGs to reserve certain capacity. The specific constraints are as follows:

$$\left[\mathbf{g}\_{\text{MEG,f}}^{p,\text{max}} - \mathbf{g}\_{\text{MEG,f}}^{p} + \mathbf{g}\_{\text{PS,f}}^{\text{output}} + \left[\mathbf{L}\_{t}^{p,after} - \mathbf{L}\_{t}^{p,before}, \mathbf{0}\right]^{+} + \Delta \mathbf{L}\_{t}^{p,\text{IB}} \geq r\_{\text{P}} \mathbf{L}\_{t}^{p} + r\_{\text{WPP}}^{\text{up}} \mathbf{g}\_{\text{WPP,f}} + r\_{\text{PV}}^{\text{up}} \mathbf{g}\_{\text{PV,f}} \tag{29}$$

$$\left[g\_{\rm MEG,t}^{p} - g\_{\rm MEG,t}^{p,\rm min} + g\_{\rm PS,t}^{\rm input} + \left[L\_t^{p,after} - L\_t^{p,before}, 0\right]^- \geq r\_{\rm WPP}^{dn} g\_{\rm WPP,t} + r\_{\rm PV}^{dn} g\_{\rm PV,t} \tag{30}$$

$$\left[\left(\mathbf{g}\_{M\text{EG},t}^{\varepsilon,\text{max}} - \mathbf{g}\_{M\text{EG},t}^{\varepsilon} + \mathbf{g}\_{\text{CS},t}^{\text{output}} + \left[L\_t^{\varepsilon,\text{after}} - L\_t^{\varepsilon,\text{before}}, 0\right]^+ \right.\right. \tag{31}$$

(6) Other operation constraints

An MEG also needs to consider the operation constraints of PBDR and IBDR, including maximum output power constraints, start-stop time constraints, and uphill-downhill power constraints. CGT operation also needs to consider start-stop time constraints. The specific constraints are described in reference [10].

#### **4. Risk Aversion Model of the Micro Energy Grid**

To describe the uncertainty of the wind power plant (WPP), photovoltaic power generation (PV), and load, the conditional value at risk (CVaR) method and robust stochastic optimization theory are introduced to construct a risk aversion model for the micro energy grid in this section.

#### *4.1. Uncertainty Factors Analysis*

There are three uncertainty factors in the proposed MEG, which are *gWPP*,*t*, *gPV*,*t*, and *Lt* . Simulating the uncertainty is the key to formulating an optimal dispatching strategy for the MEG. Generally speaking, the load demand mainly consists of two parts: the forecast value and the forecast deviation. Considering that the forecast deviation obeys a normal distribution, load demand can be calculated as follows:

$$L\_t = L\_t^f + \Delta L\_t^\varepsilon \tag{32}$$

where if Δ*Le <sup>t</sup>* obeys <sup>Δ</sup>*Le <sup>t</sup>* <sup>∼</sup> [0, <sup>δ</sup><sup>2</sup> *L*,*t* ], δ is the load forecast standard deviation, then the load demand will obey *Lt* <sup>∼</sup> [*L<sup>f</sup> <sup>t</sup>* , <sup>δ</sup><sup>2</sup> *L*,*t* ]. In the proposed MEG, there are various flexible loads such as the electricity, heating, cooling and gas, and energy storage equipment, which can cope with load uncertainty, so this paper does not take the uncertainty of the load demand into account.

For WPP and PV, the uncertainty is mainly caused by the natural wind speed and photovoltaic radiation intensity. Simulating the natural wind and photovoltaic radiation intensity is the key to simulating uncertainty. Referring to [21], the Weibull and Beta distribution function can simulate the wind speed and photovoltaic radiation intensity respectively, as follows:

$$f(v) = \frac{q}{\mathfrak{P}} \Big(\frac{v}{\mathfrak{P}}\Big)^{q-1} e^{-(v/c)^{\mathfrak{P}}} \tag{33}$$

$$f(\theta) = \begin{cases} \frac{\Gamma(\omega)\Gamma(\psi)}{\Gamma(\omega) + \Gamma(\psi)} \theta^{\omega - 1} (1 - \theta)^{\psi - 1}, 0 \le \theta \le 1, \omega \ge 0, \psi \ge 0\\ 0 & \text{, otherwise} \end{cases} \tag{34}$$

This obtains the distribution function of the above uncertainty factors, which allows us to analyze the uncertainty factors of the MEG. This paper uses the conditional risk at value method and robust stochastic optimization theory to describe the uncertainty factors of the objective function and constraints, respectively, and constructs the risk avoidance optimization model, which provides a basis for decision makers who have different risk attitudes, so that they can properly formulate optimal scheduling strategies.

#### *4.2. Risk Aversion Optimal Model*

The conditional value at risk method is used to represent the uncertainty factors of the objective function in this paper. Compared with the traditional value at risk (VaR) method, it can represent a risk distribution situation at the exterior of the confidence level, which is helpful to overcome the limitation of VaR only being able to measure the risk under the confidence level but not at the tail. A detailed introduction of the CVaR method can be found in the author's paper [22]. This paper constructs an objective function with the CVaR method. The objective function is designed as follows:

$$F\_{\beta}(E,\alpha) = \alpha + \frac{1}{1-\beta} \int\_{y \in \mathbb{R}^m} (L(E,y) - \alpha)^+ p(y) dy \tag{35}$$

where α indicates the threshold value of risk determination. β indicates the objective function confidence of MEG operation. If Equation (37) achieves the minimum, it is the CVaR value. α indicates the VaR value. *L*(*E*, *y*) = −*R*(*E*, *y*) indicates the loss function of MEG operation. *E<sup>T</sup>* = [*EMEG*,*t*(1), *EMEG*,*t*(2), ··· , *EMEG*,*t*(*T*)] indicates the decision vector, and *yT* = [*gWPP*,*t*, *gPV*,*t*, *Lt*] indicates the multivariate random vector. *R*(*E*, *y*) indicates the income function of MEG operation. According to Equation (35), the risk caused by the uncertainty factor in the objective function can be described.

In order to describe the uncertainty factors in the constraints, the conventional constraints need to be transformed into stochastic constraints. This paper used robust stochastic optimization theory to set deviations of predicted power of WPP and PV as δ*WPP* and δ*PV*. Correspondingly, *gWPP*,*<sup>t</sup>* and *gPV*,*<sup>t</sup>* will fluctuate in intervals [(1 − δ*WPP*,*t*) · *gWPP*,*t*,(1 + δ*WPP*,*t*) · *gWPP*,*t*] and [(1 − δ*PV*,*t*) · *gPV*,*t*,(1 + δ*PV*,*t*) · *gPV*,*t*]. In order to facilitate analysis, RE was introduced to represent WPP and PV, and δ*RE*,*<sup>t</sup>* was introduced to represent δ*WPP*,*<sup>t</sup>* and δ*PV*,*t*, then the uncertainty force was as follows:

$$-\left[\underline{g}\_{\text{RE},l}(1-\boldsymbol{\varrho}\_{\text{RE},l}) \pm \boldsymbol{e}\_{\text{RE},l} \cdot \boldsymbol{g}\_{\text{RE},l}\right] = -\left[\underline{g}\_{\text{WPP},l}(1-\boldsymbol{\varrho}\_{\text{WPP}}) \pm \delta\_{\text{WPP},l} \cdot \boldsymbol{g}\_{\text{WPP},l}\right] - \left[\underline{g}\_{\text{PV},l}(1-\boldsymbol{\varrho}\_{\text{PV}}) \pm \delta\_{\text{PV},l} \cdot \boldsymbol{g}\_{\text{PV},l}\right] \tag{36}$$

Further, since the WPP and PV uncertainty variables mainly appear in Equation (18), the system net load demand is set to be *Mt* which can be calculated by Equation (37) as follows:

$$M\_{\rm I} = -\left(L\_t^\varepsilon + \mathbf{g}\_{\rm ES,t}^{input} + \mathbf{g}\_{\rm P2G,t}^{input} + \mathbf{g}\_{\rm P2H,t}^{input} + \mathbf{g}\_{\rm P2C,t}^{input} + \Delta L\_t^{p, \rm PB} + \Delta L\_t^{p, \rm IB}\right) - \mathbf{g}\_{\rm PS,t}^{output} - \mathbf{g}\_{\rm P2G,t}^{output} - \mathbf{g}\_{\rm CGT,t} \tag{37}$$

Equation (17) can be rewritten according to Equations (38) and (39), as follows:

$$-\left[\mathcal{g}\_{RE,t}(1-\mathcal{q}\_{RE})\pm\mathcal{e}\_{RE,t}\cdot\mathcal{g}\_{RE,t}\right]\leq\mathcal{M}\_t\tag{38}$$

Referring to [23], for the flexibility of the stochastic model, auxiliary variables θ*RE*,*t*(θ ≥ 0) and the robust coefficient Γ*RE*,Γ ∈ [0, 1] were introduced to establish load supply and demand equilibrium constraints based on robust stochastic optimization theory, as follows:

$$-\left(\mathbf{g}\_{\rm RE}\mathbf{i} + \delta\mathbf{s}\_{\rm RE}\mathbf{g}\_{\rm RE}\mathbf{i}\right) \le -\mathbf{g}\_{\rm RE}\mathbf{i} + \Gamma\_{\rm RE}\delta\_{\rm RE}\mathbf{j}\left|\mathbf{g}\_{\rm RE}\mathbf{i}\right| \le -\mathbf{g}\_{\rm RE}\mathbf{i} + \delta\mathbf{s}\_{\rm RE}\theta\_{\rm RE}\mathbf{i} \le M\_{\rm l}\tag{39}$$

Finally, according to the objective function in Equation (35), combined with the constraints of Equations (40) and (19)–(31), a risk aversion optimization model with the CVAR method and robust stochastic optimization theory could be established. The specific model is as follows:

$$\begin{aligned} \min F\_{\beta}(G, \alpha) &= \alpha + \frac{1}{N(1-\beta)} \sum\_{k=1}^{N} z\_{k} \\ \text{s.t.} \begin{cases} \begin{aligned} &Eq.(19) - Eq.(31) \\ &Eq.(37) - Eq.(39) \\ & z\_{k} = L(E, y) - \alpha \\ & z\_{k} \ge 0 \\ & \text{other constraints} \end{aligned} \end{aligned} \tag{40}$$

#### **5. Example Analyses**

This paper chose the Xinxiang Active Distribution Network Demonstration Project in Jining, China as the example object to analyze the validity and applicability of the proposed model.

#### *5.1. Basic Data*

The Xinxiang Active Distribution Network Demonstration Project includes 1000 kW PV, 800 kW WPP, and 2000 kW CGT. The cost parameters of CGT operation were selected according to reference [21]. In order to facilitate the model solution, the CGT operation cost function was divided into two stages, and the slope coefficients were 0.55 ¥/kW and 0.15 ¥/kW, respectively. In order to meet the demand of the multi-energy load of electricity, heat and cold, the demonstration project was equipped with P2H 1500 kW, P2C 1000 kW, H2C 1500 kW, and P2G 150 kW. The maximum energy storage and release power of PS and HS in this demonstration project was 200 kW and 300 kW, the storage capacity was 1000 kW h, the maximum energy storage and release power under CS was 300 kW, and the energy storage capacity was 1000 kW/h. In addition, the demonstration project was equipped with a 500 m<sup>3</sup> gas storage tank, and the maximum gas storage and supply power were both 150 kW. The energy efficiency of the different energy equipment was 96%. Considering that CGT operation can generate carbon emissions, this paper took 85% of the total carbon emissions from MEG operation as the MTEA, and chose a different energy load demand and real-time price of a typical load day as the basic data of the energy supply. Figure 3 is the electricity, heating, cooling, and gas load demand on a typical load day.

**Figure 3.** Electricity, heating, cooling, and gas load demand and real-time price on a typical load day.

Considering that EP, EC, ES and other energy equipment are dispatched and operated by the same entity, the WPP, PV, and CGT power generation price were 0.54 ¥/kW·h and 0.83 ¥/kW·h. The CGT power supply price and heating supply price were 0.35 ¥/kW·h and 0.25 ¥/kW·h. To promote the interconnection of WPP and PV, the EC electricity consumption price was set to 0.25 ¥/kW·h, and the EC heating consumption price was set to 0.2 ¥/kW·h when converting energy. The electricity, heating and cooling prices provided by the demonstration project were executed at real-time prices of different energy markets, as shown in Figure 3. To analyze the influence of uncertainty, the WPP and PV parameters were set according to reference [10], and 10 typical WPP and PV output scenarios were generated by scenario simulation and the reduction method proposed in reference [19]. The most possible scenario was chosen as the input data, and the prediction deviation was set to 2%. Figure 4 is the available output of WPP and PV on a typical day.

**Figure 4.** Available output of WPP and PV on a typical day. WPP: wind power plant; PV: photovoltaic power generation.

Thirdly, the model proposed in this paper includes 12 variables (four for production equipment, four for conversion equipment, and four for storage equipment), each of which includes 24 dimensions (24 h per scheduling period). To study the feasibility of CvaR and robust stochastic optimization theory in controlling WPP and PV uncertainty, confidence β and the robust coefficient Γ were both set to 0.8, and three simulation scenarios were compared for analysis:


Finally, in order to analyze the optimal effect of the demand response of MEG operation, peak, flat, and valley periods of different load types of electricity, heating, and cooling were divided according to reference [21], and corresponding time-of-use (TOU) prices were set. Among them, the peak period price increased by 25%, the valley period price decreased by 25%, and the flat period price remained unchanged. The price elasticity of electricity, heating, and cooling was selected according to reference [21]. For the incentive demand response, the up-rotating reserve price and the down-rotating reserve price of the electricity, heating and cooling reserve markets were 0.85 ¥/kW·h and 0.25 ¥/kW·h, 0.55 ¥/kW·h and 0.15 ¥/kW·h, and 0.45 ¥/kW·h and 0.15 ¥/kW·h, respectively. To avoid an excessive response of PBDR and IBDR, which would result in a "peak-to-valley upside down" phenomenon of the load curve, the total output of PBDR and IBDR should not exceed 10%, and the output power should not exceed 100 kW.

According to the above basic data, this paper used GAMs software to call CPLEX11.0 solver to solve the proposed model. The time for solving the above three simulation scenarios was less than 20 s by using the Lenovo IdeaPad 450 series notebook computers with 4 GB RAM and a Core T6500 processor.

#### *5.2. Example Results*

#### 5.2.1. Scheduling Results of Case 1

This scenario did not take the uncertainty effects of WPP and PV into account when analyzing the complementary effect among different energy components. The main optimization objectives of this scenario include maximizing the operational benefits and minimizing carbon emissions. Under the mode of following thermal load, the heating and cooling load are mainly satisfied by CGT, while the residual heating and cooling load are mainly satisfied by excess electricity through P2H and P2C. Table 1 shows the scheduling results of the micro energy grid of Case 1.


**Table 1.** Scheduling results of the micro energy grid of Case 1.

According to Table 1, if uncertainty risks are not considered, more WPP and PV will be scheduled to satisfy the electricity load, and the remaining power will be converted into heating and cooling through P2H and P2C. Since the unit electricity energy can convert more cooling energy and obtain higher energy supply benefits, 14,649 kW·h electricity energy is converted into cooling energy. Since the cooling load is mainly converted by P2C and H2C, and there is no direct supply of cooling source, and the scheduled power of CS is higher than PS and HS at ±3600 kW. P2G can realize the cascade supply of electricity–gas–heating–cooling to obtain higher economic benefits by converting electricity energy into CH4, which will supply electricity and heating in CGT. Through the complementary operation of EP, EC, ES and other different energy components, the MEG can realize the coordinated supply of electricity, heating, and cooling, and the economic benefit of the MEG is 47,538.05¥. However, CGT and utility power grid (UPG) also generate 4.4 tons of carbon emissions. Figure 5 is the output distribution of the micro energy grid of Case 1.

According to Figure 5, the output distribution of micro energy grid at different times was analyzed. As far as electricity load is concerned, it was mainly satisfied by WPP, PV, and CGT, and PS stored electricity during valley times and released electricity during peak times. At the same time, since CGT operates in the mode of following thermal load, the MEG needed to buy electricity from UPG during peak times to satisfy the balance of power supply and demand. As far as heating load is concerned, CGT was the main source of heating, and the residual heating load is satisfied by P2H. HS stored heating during valley times and released heating during peak times. To satisfy the demand of cooling load, part of the heating entered H2C. As far as cooling load is concerned, P2C is the main source of cooling. This is because the unit electricity energy can be converted into more cooling energy. CS mainly stored cooling during valley times and released cooling during peak times. Through the coordinated operation of different energy components, the MEG was able to realize the optimal supply of electricity, heating, cooling, and other loads.

**Figure 5.** Output distribution of the micro energy grid of Case 1.

#### 5.2.2. Scheduling Results of Case 2

This scenario analyzed the feasibility of the CVaR method when describing the uncertainty of WPP and PV. The CVaR method can transform the objective function using uncertain variables and construct the minimum risk objective function. Compared with Case 1, this scenario mainly considered three objective functions, which are maximizing economic benefits, minimizing operational risks, and minimizing carbon emissions, in order to discuss the MEG's optimal scheduling scheme. Table 2 shows the dispatching results of the micro energy grid of Case 2.


**Table 2.** Dispatching results of the micro energy grid of Case 2.

According to Table 2, the MEG scheduling results, considering uncertainty, were analyzed. When considering uncertainty, the MEG will reduce dispatching of WPP and PV and increase electricity bought from UPG to reduce uncertainty risk. Compared with Case 1, the WPP and PV grid-connected power were reduced by 585 kW·h and 370 kW·h, respectively, and the power provided by UPG increased by 848 kW·h, resulting in an increase of 0.53 tons of carbon emissions. When the CGT operates in the mode of following thermal load, the remaining power of WPP and PV is converted into heating to obtain more economic benefits. Overall, if taking the uncertainty of WPP and PV into account, MEG tends to buy electricity from UPG to avoid risk, and the remaining electricity is

converted into heating to realize the coordinated supply of electricity, heating, and cooling, which brings about a lower risk value to MEG operation than electricity energy. Further, this case analyzed the MEG output scheme considering uncertainty. Figure 6 is the output distribution of the micro energy grid of Case 2.

**Figure 6.** Output distribution of the micro energy grid of Case 2.

According to Figure 6, the MEG output distribution considering uncertainty was analyzed. When considering the uncertainty, the grid-connected power of WPP and PV decreased. At the same time, less power entered into P2G, which led to a decrease in GST power generation output, but the power supplied by UPG during peak times was significantly improved. From the perspective of different loads, since the surplus electricity is converted into heating, the heating energy provided by P2H increases, but the cooling load supply structure remains basically unchanged. This shows that when uncertainty is considered, the power output structure will change greatly, while the heating source and cooling source output structure will change relatively little. Further, the MEG scheduling results under different confidence levels were analyzed.

According to Table 3, it can be seen that as the increase of the confidence in grid-connected power of WPP and PV decreases, the power supply of UPG increases gradually. Correspondingly, the objective function values increase. This shows that benefits and risks are concomitant. If the decision makers expect to obtain high environmental and economic benefits, they have to bear more operational risks. On the contrary, if decision makers pursue the safe and steady operation of the MEG, they have to sacrifice some of the potential economic benefits. In general, CVaR can describe uncertainty, and provide a basis for decision makers who have different risk attitudes by setting a confidence level to establish the optimal scheduling strategy of the MEG.


**Table 3.** Scheduling results of the micro energy grid under different confidence levels.
