2.3.1. Objective Function

Nowadays, the environmental emission reduction comes with great importance in order to reduce emission levels [54]. In this work, the goal is to optimize two conflicting cost functions simultaneously, which are the operating cost and the emissions of the WT, PV, BG, and grid. The objective function is modeled as follows:

$$\text{Min}\begin{bmatrix} \text{OC}\_{\text{t}}(\text{P}\_{\text{BDG}\prime}, \text{P}\_{\text{pv}\prime}, \text{P}\_{\text{pv}\prime}, \text{P}\_{\text{grid}}) + \text{H. E}\_{\text{t}}\begin{pmatrix} \text{P}\_{\text{BDG}\prime} \; \text{P}\_{\text{pv}\prime} \; \text{P}\_{\text{pv}\prime} \; \text{P}\_{\text{grid}} \end{pmatrix} \end{bmatrix} \tag{20}$$

where *OC<sup>t</sup>* and *E<sup>t</sup>* are the total operational and emission costs in the MG for each hour (*t*), which are functions of the output powers of the renewable sources and grid; *PBG* is the output of BGs; *P<sup>w</sup>* is the scheduled output of WT units; *Ppv* is the scheduled output of PV units; *Pgrid* is the grid output power; and H is the price penalty factor (\$/Ton Co2). The price penalty factor was used [55], which is the ratio between the maximum fuel cost and the maximum emission of the associated generator

The total operational cost function is expressed in Equation (21) as

$$\text{OC}\_{t} = \sum\_{i=1}^{N\_{\text{pr}}} \text{C}\_{pw,i,t} + \sum\_{i=1}^{N\_{\text{pr}}} \text{C}\_{pv,i,t} + \text{C}\_{BG} \sum\_{i=1}^{N\_{BG}} \text{P}\_{\text{BG},i,t} + \text{C}\_{grid} \text{P}\_{grid,t} \tag{21}$$

[ The total emission cost function can be expressed in Equation (22) as follows:

$$E\_t = E\_w \sum\_{i=1}^{N\_w} P\_{w,i,t} + E\_{pv} \sum\_{i=1}^{N\_{pv}} P\_{pv,i,t} + E\_{BG} \sum\_{i=1}^{N\_{BG}} P\_{BG,i,t} + E\_{grid} P\_{grid,t} \tag{22}$$

where *N<sup>w</sup>* is the number of WT units; *Npv* is the number of PV units; *NBG* is the number of BG units; *Cpw* is the operational costs of WT (\$); *Cpv* is the operational costs of PV units (\$); *CBG* is the cost coefficients of the operation and maintenance of BG; *Cgrid* is the cost coefficients related to grid; and *Ew*, *Epv*, *EBG*, and *Egrid* are the emission coefficients related to WT, PV, BG, and the grid, respectively.
