*2.4. Utility Model*

For MG operation, MGOs purchase deficit energy from the main grid depending on price and internal generation levels. Conversely, they sell excess energy to the main grid. The amount of power and exchange cost traded between the utility and the MG in each hour is expressed as:

$$P\_u(t) = P\_{buy}(t) \left[ b\_u(t) - P\_{sell} \left( b\_u(t) - 1 \right) \right] \tag{8}$$

$$\mathbf{C}\_{\mathsf{u}}(t) = \begin{cases} \begin{array}{l} \lambda\_{\text{sell}}(t) \times P\_{\text{u}}(t) \\ 0 \\ \lambda\_{\text{huy}}(t) \times P\_{\text{u}}(t) \end{array} & \begin{array}{l} \text{if} \ P\_{\text{u}}(t) < 0 \\ \text{if} \ P\_{\text{u}}(t) = 0 \\ \text{if} \ P\_{\text{u}}(t) > 0 \end{array} \end{cases} \tag{9}$$

Here, the power generation state of the MG *bu(t)* takes the value 1 when there is a deficit in power, and 0 when there is a surplus of power.

#### **3. Problem Formulation**

In the optimization for the CEED problem, two competing objective functions are mathematically formulated by nonlinear functions, which minimize both generation costs and emission function by fulfilling the equality and inequality constraints. In other words, the problem is formulated for the multiobjective function as the minimization of the operation costs and pollutant emissions. The emission function is converted to cost by a multiplying with a weight called the penalty factor.

#### *3.1. Objective Function*

#### 3.1.1. Generation Cost Function

The generation cost function is the sum of costs for each generator, including renewable energy source (RES). Conventional generators such as thermal generating units are generally expressed as the sum of a quadratic and sinusoidal function. Costs for PV and WT units, such as the available RES, are determined by considering investment and maintenance costs. The operation costs can be formulated as:

$$F(P) = \sum\_{t=1}^{24} \left[ \sum\_{i=1}^{I} \mathbb{C}\_{G,i}(t) + \sum\_{j=1}^{J} \mathbb{C}\_{s,j} P\_{s,j}(t) + \sum\_{k=1}^{K} \mathbb{C}\_{w,k} P\_{w,k}(t) + \mathbb{C}\_{\mathbf{u}}(t) \right] \tag{10}$$

$$P = \begin{bmatrix} P\_{\mathbb{G},1}, \dots, P\_{\mathbb{G},l}, P\_{\mathbb{s},1}, \dots, P\_{\mathbb{s},l}, P\_{w,1}, \dots, P\_{w,\mathbb{K}} \end{bmatrix}^T \tag{11}$$

$$\mathbf{C}\_{\mathbf{s}\_{\circ}\circ} = A\mathbf{C}\_{\mathbf{s}\_{\circ}\circ}\mathbf{I}\_{\mathbf{s}\_{\circ}\circ} + \mathbf{G}\_{\mathbf{s}\_{\circ}\circ} \tag{12}$$

$$\mathbf{C}\_{w\boldsymbol{\upbeta}} = A\mathbf{C}\_{w\boldsymbol{\upbeta}}I\_{w\boldsymbol{\upbeta}} + G\_{w\boldsymbol{\upbeta}} \tag{13}$$

Equation (11) denotes the vector of the real power output of each generator. Equations (12) and (13) represent the costs of power generation with renewable energy sources, which include installation and maintenance costs. *AC* is an annuitization coefficient, and it can be calculated using the following equation [32]:

$$A\mathcal{C} = \frac{r}{1 - \left(1 + r\right)^{-N}}\tag{14}$$

## 3.1.2. Emission Function

The quantity of atmospheric pollutants, such as CO2, SOx, and NOx emitted by a conventional generator can be expressed as the sum of a quadratic and exponential function:

$$E(P) = \sum\_{t=1}^{24} em(t) = \sum\_{t=1}^{24} \sum\_{i=1}^{I} \left[ \left[ \alpha\_i P\_{G,i}^2(t) + \beta\_i P\_{G,i}(t) + \gamma\_i + \zeta\_i \exp\left(\lambda\_i P\_{G,i}(t)\right) \right] \right] \tag{15}$$

In Equation (15), the emission dispatch function is considered as a convex polynomial, similar to the operation cost function. In addition, it is assumed that RES is not considered in the emission function because it does not release air pollutants [33].

#### 3.1.3. Combined Economic Emission Dispatch

As discussed above, the generation costs and emission dispatch function are two different objectives. Hence, a compromise solution is required to solve the CEED problem that minimizes generation costs and the emitted quantities of pollutants. To solve a multiobjective function, a penalty factor is used to reform the emission criteria into the generation cost. Mathematically, the penalty factor is a multiplied value that transforms two different functions into a single objective function. In our work, a DR program is considered for microgrid operation. Therefore, the costs of participating in the DR program are included in the CEED problem, as follows.

$$C(P) = \min \sum\_{t=1}^{24} \sum\_{i=1}^{l} \left[ F(P) + h\_i \times E(P) + \mathbb{C}\_{D\mathbb{R}}(t) \right] \tag{16}$$

$$C\_{DR}(t) = I(\Delta D(t)) + P(\Delta D(t))\tag{17}$$

Here, the penalty factor *hi* indicates the ratio (\$/kg) of the generation costs and emission quantity of each generator *i*. This factor is initially determined by considering the minimum and maximum of each objective function, and then it is updated to account for environmental constraints. Equation (13) indicates the costs of participating in the DR program; it includes incentive and penalty costs. In this paper, it is determined based on the proposed EBDR program.

#### *3.2. Constraints*

#### 3.2.1. Generation Capacity Constraint

The power output of each generation unit is restricted by lower and upper limits for stable operation:

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

$$P\_{\
u}^{\min}(t) \le P\_{\
u}(t) \le P\_{\
u}^{\max}(t) \tag{19}$$

$$P\_{s,j}^{\min}(t) \le P\_{s,j} \le P\_{s,j}^{\max}(t) \tag{20}$$

$$P\_{w\&}^{\text{min}}(t) \le P\_{w\&}(t) \le P\_{w\&}^{\text{max}}(t) \tag{21}$$

Equations (18)–(21) indicate the minimum and maximum power limits of DG, utility, PV, and WT, respectively.

#### 3.2.2. Power Balance Constraint

The total power generation must cover the total power demand in the presence of transmission line loss:

$$\sum\_{i=1}^{I} P\_{G,i}(t) + \sum\_{j=1}^{J} P\_{PV,j}(t) + \sum\_{k=1}^{K} P\_{WT,k}(t) = P\_D(t) - P\_{loss}(t) \tag{22}$$

$$P\_D(t) = D\_0(t) + \Delta D(t) \tag{23}$$

Equation (23) represents the power demand that is finally determined through the DR.
