Keywords

1 Introduction

Nowadays, electric power is mostly generated centrally in bulk quantity by large generation plants linked with long transmission lines that bring electric power to the end users via the utility grid. Smart grid is an electrical system that aims to distribute electric power from the producers to the consumers efficiently [1]. Since today’s producers and consumers are very sophisticated actors in terms of their behaviour in the supply- demand dynamics, smart grid is a very complex system that deploys different communication protocols to deal with nonlinearity, security and bidirectional power flow [2]. Despite recent advances in the modern technology of communication protocols and monitoring devices, supervision of a large complex system remains very difficult [1, 3,4,5,6,7,8]. In general, smart grid is best facilitated within a microgrid, which is a relatively small scale localised energy network with the ability of connecting to or isolating from the main grid. A microgrid has the following characteristics [9,10,11,12]: Managing sources and demand locally; Reducing the expenditure of the whole system by offering economic dispatch and optimally scheduling of demand and micro-sources.

High penetration of intermittent renewable sources in the distribution network will deteriorate the immunity of network stability during various network contingencies [13, 14]. As a consumer of electricity when hooked on a charging station, EVs are also classified as a mobile energy storage system that distributes within a microgrid, and as such, produce significant uncertainty to the network [15]. Fixed and mobile storage devices, power exchange with the utility grid, lowest pollution treatment, and losses reduction of the network [16].

This paper focuses on primarily on the implementation of the ‘microgrid operator’.

2 A Modular Power Management of the Microgrid Structure

The hierarchical structure of classical management methodology has been chosen as it fits well with the description of problems in this work. In Fig. 1. the modular structure involves several processes ranging from long-term period segment decisions of the MGO to very high-speed control of the power electronic of the PES to facilitate the power management by addressing each major part of the process independently. Then, the modular structure consolidates the multidisciplinary process to form a complete system. The structured format describes hierarchical tiers corresponding to the level of management mission, and is seen as the upside-down structure on the left-hand side of Fig. 2.

Fig. 1.
figure 1

Concept of a modular management structure

Fig. 2.
figure 2

Hierarchical and decision timeframes of management model

The complete modular structure can be described as a hierarchical decision epoch as presented in lower part of 错误!未找到引用源。 MGO-strategy is a plan of action designed to achieve a long-term or overall aim of the power generation from DGs of the MG network to balance the electrical demand.

3 Implementation of the Algorithm

The output of the optimisation model is the optimal configuration of the microgrid. The procedure to achieve optimal operation is listed below and explained in Fig. 3.

Fig. 3.
figure 3

Interrelationship of operational control of MGO

The decision of power amount from the DGs of an optimisation algorithm makes based on the fuel price, the maintenance cost, the startup cost, and pollutants treatment cost. The wind turbine and the photovoltaic are assumed to generate free emission. Because of the wind speed is very low in the Baghdad environment. Therefore, the wind turbine is not efficient. The output power of the wind turbine is very small or cut off at a wind speed below 3 m/s. Therefore, the wind turbine is replaced with the photovoltaic cell in this study.

4 Electric Vehicle Model

Energy storage system is the powertrain of the EVs which have bi-directional power flow characteristic. Therefore, the EVs provide a great opportunity to discharge some power of energy storage system to synergize the DGs of the MG in balancing the net demand. Discharging the EVs helps the microgrid to maintain the stability and reliability of the system.

Prediction the discharging power of the EVs depends mainly on the spatial characteristics of the EVs, the range of discharging state of charge of the energy sources, the required energy for next journey of the EVs after unplugged from the microgrid. The CSO is responsible for the centralised smart charger. The objective function of the CSO is either achieving minimum charging the cost of the EVs as applied in Eq. ( 1 ) or achieving a maximum discharging cost of the EVs as applied in Eq. ( 2 ). Further information about the operation of CSO to optimise charging and discharging power of the EVs is provided in CSO optimization paper.

$$ {Min} - {Cost} = \mathop \sum \limits_{{{i} = {t}_{a} }}^{{{t}_{d} }} \mathop \sum \limits_{{{j} = 1}}^{N} {\alpha }.{s}_{1} .{\varepsilon }_{1} .{P}_{{{ch}, {ij}}} .\Delta {t}.{F}.{\rho }.{C}_{{{rate},{p},{ch}}} + {\alpha }.{s}_{1} .{\varepsilon }_{2} .{Q}_{{{ch}, {ij}}} .\Delta {t}.{F}.{\rho }.{C}_{{{rate},{q},{ch}}} $$
(1)
$$ {Max} - {Cost} = \mathop \sum \limits_{{{i} = {t}_{a} }}^{{{t}_{d} }} \mathop \sum \limits_{{{j} = 1}}^{N} {D}.{\beta }.{s}_{2} .{P}_{{{dis}, {ij}}} .\Delta {t}.{F}.{C}_{{{rate},{p},{dis}}} + {D}.{\beta }.{s}_{2} .{Q}_{{{dis}, {ij}}} .\Delta {t}.{F}.{C}_{{{rate},{q},{dis}}} $$
(2)

5 Diesel Generator Model

The power cost and carbon dioxide emission of a diesel generator are relatively higher than other DGs. The fuel cost of diesel generator power can be modelled as quadric polynomial as shown in the Eq. ( 3 ).

$$ {C}_{{{dg},{i}}} = \mathop \sum \limits_{{{i} = 1}}^{N} {\alpha }_{i} + {\beta }_{i} {P}_{{{dg},{i}}} + {\gamma }_{i} {P}_{{{dg},{i}}}^{2} $$
(3)

6 Cost Formulation

The operating cost of the Microturbine and fuel cell usually includes fuel cost, maintenance cost, and startup/shutdown cost in ($/h) as shown in Eq. 4 [18]. The fuel cost of the Microturbine and fuel cells are calculated as shown in equation 错误!未找到引用源。 [19]

The maintenance cost of the Microturbine, the fuel cell, and the diesel generator are proportion to the supplied power based on forecasting with minimal real life situation of microsources. Thus, the maintenance cost of unit \( i \) in time interval \( t \) is shown in equation 错误!未找到引用源。 The DGs startup cost depends mainly on time the unit which has been off before it is startup again. The startup cost of the generators is calculated from the equation 错误!未找到引用源。

$$ {CF}\left( {P} \right) = \mathop \sum \limits_{{{i} = 1}}^{N} ({C}_{i} {F}_{i} + {OM}_{i} + {SC}_{i} ) $$
(4)
$$ {C}_{{{MT},{i}}} = {C}_{nl} \mathop \sum \limits_{J} \frac{{{P}_{J} }}{{{\eta }_{lJ} }} $$
(5)
$$ {OM}_{i} = {K}_{om} \mathop \sum \limits_{{{i} = 1}}^{N} {P}_{i} $$
(6)
$$ {SC}_{{{i},{t}}} = {KSC}_{i} \times ({\delta }_{{{dgi},{t}}} - {\delta }_{{{dgi},{t} - 1}} ) $$
(7)

Where

$$ SC_{i,t} \ge 0\quad \quad \quad \delta_{dgi} = \left\{ {\begin{array}{*{20}l} 1 \hfill & {if\, DG\;ON} \hfill \\ 0 \hfill & {otherwise} \hfill \\ \end{array} } \right. $$

The pollutant treatment cost of the microgrid including The cost of the emission of carbon dioxide CO2 and particulate matter such as sulphur dioxide SO2, nitrogen oxide NOx can be described as in Eq. 8.

$$ {E}\left( {P} \right) = {E}1\left( {P} \right) + {E}2\left( {P} \right) $$
(8)
$$ {E}1\left( {P} \right) = \mathop \sum \limits_{{{i} = 1}}^{N} \mathop \sum \limits_{{{k} = 1}}^{N} \left( {{C}_{k} {\gamma }_{ik} } \right){P}_{i} + \mathop \sum \limits_{{{k} = 1}}^{N} \left( {{C}_{k} {\gamma }_{{{grid},{k}}} } \right){P} $$
$$ {E}2\left( {P} \right) = \mathop \sum \limits_{{{i} = 1}}^{N} \mathop \sum \limits_{{{k} = 1}}^{N} \left( {{C}_{{{co}2}} {\gamma }_{{{ico}2}} } \right){P}_{i} + \mathop \sum \limits_{{{k} = 1}}^{N} \left( {{C}_{{{co}2}} {\gamma }_{{{grid},{co}2}} } \right){P}_{grid} $$

7 Multiobjective Functions

Multiobjective optimisation is a technique to find the optimum solution between different objectives. Usually, the objectives are conflict and possibly contradict. That means there is no decision variables which can set all the objectives function simultaneously. The multiobjective function is used to search the efficient decision variables of optimisation function. A general mathematical formulation of multi-objective optimisation which has n-dimensional decision variables is expressed as shown in the Eq. 9. There is a different method to solve multi-optimization problems. One of them is the weighting method. The general idea of the weighting method is to associate each objective function with a weighting coefficient and minimise the weighted sum of the objectives. The multiobjective roles in this approach are transformed into a single objective function.

$$ { \hbox{min} }\left\{ {{f}_{1} ({x}),{f}_{2} ({x}), \ldots ,{f}_{k} ({x})} \right\} $$
(9)
$$ subject\, to \begin{array}{*{20}c} {g_{i} \left( x \right) \le 0,i = 1,2, \ldots ,q} \\ {h_{j} \left( x \right) = 0,j = 1,2, \ldots ,p} \\ \end{array} $$

Where \( {x} = ({x}_{1} ,{x}_{2} , \ldots ,{x}_{n} ) \) is n dimensional decision variables

  • \( {f}_{k} ({x}) \) is the k-th objective function

  • \( {g}_{i} \left( {x} \right) \le 0 \) is inequality constraints

  • \( {h}_{j} \left( {x} \right) = 0 \) is equality constraints

Mathematically, the economic dispatch/environmental pollutant of microgrid problem are considered in this paper. The mathematical equation is formulated to find the lowest operation cost, the lowest environment pollutions (sulphur dioxide SO2 and nitrogen oxide NOx), and the lowest carbon dioxide (CO2) of the generation unit as shown in Eq. 10.

$$ {\text{objective function}} = { \hbox{min} }\mathop \sum \limits_{t} \left\{ {w_{1} (CF\left( {P\left( t \right)} \right) + \delta_{g} P_{grid} (t)) + w_{2} E1\left( {P\left( t \right)} \right) + w_{3} E2\left( {P(t)} \right)} \right\} $$
(10)

Where \( w_{1} ,\,w_{2} ,\,w_{3} \) are the weight coefficient of the fuel cost, pollutant treatment cost, and carbon dioxide treatment cost objective functions respectively.

The criteria to calculate the judgment matrix of the objective function is based on an analytic hierarchy process (AHP) method which was analytically proposed on [20] and shown in Table 1.

Table 1. The criteria of the judgment matrix

The objective function is classified into three levels; operating cost as the first level, pollutants treatment cost as the second level, and carbon dioxide treatment cost as the third level. The rank of the criteria subjective is explained below: The operating cost is five times as important as the pollutants treatment cost. The operating cost is three times as important as the carbon dioxide treatment cost. The pollutants treatment cost is two time as important as the carbon dioxide treatment cost. The judgment values of the criteria subjective matrix (11 ) are \( w_{1} = 0.64833,\,w_{2} = 0.22965 \), and \( w_{3} = 0.12202 \).

$$ J = \left[ {\begin{array}{*{20}c} 1 & 3 & 5 \\ {{1 \mathord{\left/ {\vphantom {1 3}} \right. \kern-0pt} 3}} & 1 & 2 \\ {{1 \mathord{\left/ {\vphantom {1 5}} \right. \kern-0pt} 5}} & {{1 \mathord{\left/ {\vphantom {1 2}} \right. \kern-0pt} 2}} & 1 \\ \end{array} } \right] $$
(11)

The objective function of the optimisation problem is subject to: Generation and consumption balance: The microgrid operator should balance between the total load demand and the total power generation as represented by the Eq. (12). Ramp rate limit: The ramp rate should be meet at each sampling time as expressed in equation 错误!未找到引用源。

$$ \mathop \sum \limits_{t} \left( {CF\left( {P(t)} \right) + \delta_{g} P_{grid} (t)} \right) = P_{d} (t) $$
(12)
$$ - DR_{i} \Delta T \le P_{i} (t + 1) - P_{i} (t) \le UR_{i} \Delta T $$
(13)

Generating capacity: For stable operation, each DG should limit output power according to its capacity as shown in equation 错误!未找到引用源。 Charging station limit: The battery state at each sampling time can be represented based on the state of charge into either charging, discharging or not act. The decision of battery state is made by CSO depending on how many numbers of EVs connected to the network at instance time, the resources capacity of each EV, and the state of charge of the resources. The objective function of discharging mode is formulated to get the maximum discharging power cost as shown in equation 错误!未找到引用源。

$$ P_{i,min} \left( t \right) \le P_{i} (t) \le P_{i,max} (t) $$
(14)
$$ P_{EVs,min} (t) \le P_{cs,i} (t) \le P_{EVs,max} (t) $$
(15)
  • Exchange power with utility grid:

    The power exchange between microgrid and utility grid at connected mode bidirectional where each direction either purchasing or selling has its tariff and limits. It is not possible to purchase and sell at the same time. Therefore, binary number \( \delta_{g,b} \left( t \right) \in [0\; 1] \) and \( \delta_{g,s} \left( t \right) \in [0\; 1] \) is introduced selling and purchasing modes where \( \delta_{g,b} \left( t \right) + \delta_{g,s} \left( t \right) = 1 \). The exchange power between the microgrid and utility grid can be represented as in Eq. ( 16 ).

    $$ \left\{ {\begin{array}{*{20}c} {P_{g,smin} (t) \le P_{g,s} (t) \le P_{g,smax} (t)} \\ {P_{g,bmin} (t) \le P_{g,b} (t) \le P_{g,bmax} (t)} \\ \end{array} } \right. $$
    (16)
  • Emission limit

    The total environment pollutant should not exceed certain limit for each DG as shown in equation 错误!未找到引用源。

  • Starts and stops limit

    For stable operation of the DGs, some start-up of each generator should be limit to a certain number based on generator type as shown in equation 错误!未找到引用源。

    $$ E\left( {P(t)} \right) \le L_{j} $$
    (17)
    $$ \mathop \sum \limits_{i} N_{start - stop,i} \le N_{{start - stop,{ \hbox{max} }}} $$
    (18)

8 The Mathematical Model for the Microgrid Optimization Problem

The optimisation algorithm of the DGs deals with non-linear, non-convex, and highly dimension problems. It is also dealing with the unit commitment problem. The achievement should be balance the supply of the thirteen DGs, CSO operation, the exchange power with the utility grid, and the consumer electrical demand with the lowest cost of operation and pollutants treatment. The cost function of the Microturbine and fuel cell are linear while the cost function of the diesel generator and utility grid are non-linear. The main utility grid (UG) is treating as another source connected to microgrid with its operation prices and pollutants treatment in the optimisation problem. It also balances the difference between the consumer demand and the microsources output power, whenever the DGs could not cover the consumer demand. On the other hand, the microgrid DGs could operate as stability balance of the utility grid whenever the voltage and frequency stability reach to collapse point to enhance the stability margin.

The states between the microgrid and the utility grid could be either exchange power from the microgrid to the utility grid (buying power) or exchange power from the utility grid to the microgrid (selling power). If no exchange power between the microgrid or utility grid means that either the point of common coupling isolates the systems from each other or the microgrid covers itself with cheaper operating cost than utility grid without penalty of power to sell. Therefore, the condition term of exchange power between the microgrid and the utility grid are defined as in equation 错误!未找到引用源。 and 错误!未找到引用源。

$$ {F}_{{{ug},{s}}} = {C}_{{{ug},{s}}} .{P}_{{{ug},{s}}} $$
(19)
$$ {F}_{{{ug},{b}}} = {C}_{{{ug},{b}}} .{P}_{{{ug},{b}}} $$
(20)

Where \( {\delta }_{{{ug},{b}}} \left( {t} \right) + {\delta }_{{{ug},{s}}} \left( {t} \right) = 1 , {\delta }_{ug} \in [0\;1] \)

$$ \left\{ {\begin{array}{*{20}c} {{\delta }_{{{ug},{b}}} \left( {t} \right).{P}_{{{ugmin},{b}}} \left( {t} \right) \le {P}_{{{ug},{b}}} \left( {t} \right) \le {\delta }_{{{ug},{b}}} \left( {t} \right).{P}_{{{ugmax},{b}}} (t)} \\ {{\delta }_{{{ug},{s}}} \left( {t} \right).{P}_{{{ugmin},{s}}} \left( {t} \right) \le {P}_{{{ug},{s}}} \left( {t} \right) \le {\delta }_{{{ug},{s}}} \left( {t} \right).{P}_{{{ugmax},{s}}} (t)} \\ \end{array} } \right. $$

The EVs have dual functions from the view of the optimisation problem, which are either behaves as electrical demand or resources. The charging station operator sends the states of the connected EVs such as the total electrical demand required to charge them as well as the available power could be discharged from them. The MGO collects the information from all CSO within the microgrid. The discharging decision takes based on the voltage variation, frequency variation, or both. After activating the discharging option, the MGO treats the CSO as a resource of the power. Therefore the power available on the EVs connected at CSO compete with the other DGs according to the objective function. The CSO formula includes the operation cost where the emission cost equal to zero as shown in Eq. (21 ). Further detail about CSO is available in CSO optimization paper.

$$ {F}_{cso} = \left( {{C}_{{{ug},{s}}} .{\delta }_{{{cso},{d}}} + {C}_{{{ug},{b}}} .{\delta }_{{{cso},{c}}} } \right).{P}_{{{cso},{i}}} $$
(21)

Where

$$ \delta_{cso,d} = \left\{ {\begin{array}{*{20}l} 1 \hfill & {if \,discharge\, mode\, is \,applied} \hfill \\ 0 \hfill & {\quad \quad \quad \quad \quad \quad otherwise} \hfill \\ \end{array} } \right. $$
$$ \delta_{cso,c} = \left\{ {\begin{array}{*{20}l} 1 \hfill & {if\, charge\, mode \,is \,applied} \hfill \\ 0 \hfill & {\quad \quad \quad \quad \quad \quad otherwise} \hfill \\ \end{array} } \right. $$

The unit commitment application is applied to schedule the DG operation at every period of executed optimisation algorithm. It is introduced a binary variable \( u_{a} \) to express logical statement of the unit commitment implementation.

Where

$$ u_{a} = \left\{ {\begin{array}{*{20}l} 1 \hfill & {if\, unit \,commetment\, is \,applied} \hfill \\ 0 \hfill & {\quad \quad \quad \quad \quad \quad otherwise} \hfill \\ \end{array} } \right. $$
$$ u_{n} = \left\{ {\begin{array}{*{20}l} 1 \hfill & {if\, unit\, commetment \,is\, not\, applied} \hfill \\ 0 \hfill & {\quad \quad \quad \quad \quad \quad \quad otherwise} \hfill \\ \end{array} } \right. $$

The proposed cost function of microgrid in connected mode with DGs, CSO, UG, and unit commitment consideration is formulated as in equation 错误!未找到引用源。

$$ \begin{aligned} CF(P)\, & = \,w_{1} \left( {\sum\nolimits_{{t = 1}}^{{24}} {\sum\nolimits_{{i = 1}}^{N} {(u_{a} \delta _{{dgi}} + u_{n} )(C_{i} F_{i} (t) + OM_{i} + SC_{{i,t}} ) + F_{{cso,i}} (t) + F_{{ug}} (t)\delta _{{ug}} } } } \right) \\ & + \left( {\sum\nolimits_{{i = 1}}^{N} {\sum\nolimits_{{k = 1}}^{N} {(u_{a} \delta _{{dgi}} + u_{n} )((w_{2} C_{k} \gamma _{{ik}} + w_{3} C_{{co2}} \gamma _{{ico2}} )P_{i} } } } \right) \\ & + \sum\nolimits_{{k = 1}}^{N} {(w_{2} C_{k} \gamma _{{grid,k}} + w_{3} C_{{co2}} \gamma _{{grid,co2}} )P_{{grid}} \delta _{{u,g}} )} \\ \end{aligned} $$
(22)

9 Case Study

A case study can offer a useful insight to simplify a very complex problem by focusing on the snapshot operation of a typical network.

Figure 4 shows the distribution network under study. It consists of 7 feeders and 49 busbars to supply the electricity loads of a local community in the City of Baghdad.

Fig. 4.
figure 4

Typical microgrid structure

  • Interfacing power electronics and communication electronics allowing bi-directional flow of power at the selected nodes connected with DGs.

  • A pseudo-isolated operating mode such that the entire local loads are met by thirteen DGs located at selected nodes as shown in the case study. The DGs compromised as one diesel generator, three fuel cell, four microturbine, five photovoltaic cells, and two electric vehicle charging stations. The wind turbine excluding from this study because the analysis shows that the output power of wind turbine is very small due to low wind speed in Baghdad environment.

The typical aggregated daily load curve pattern of the microgrid network under study based on appliances ownership is shown in Fig. 5 [21]. There is some fluctuation in demand during the day time. The DGs to meet the daily load have chosen according to type and efficiency of DG in [22], the solid oxide fuel cell has much better efficiency than micro gas turbine for range 10–100 kW. The power range location of DGs have chosen based on the voltage stability distributed location algorithm as shown in Table 2. The parameters of the DGs are shown in Table 3.

Fig. 5.
figure 5

Daily load curve

Table 2. Distributed generators type, range, and location
Table 3. Parameter content of the grid equipment

After midday, the tariff is started to reduce gradually until reaching to minimum at midnight; then it is kept constant until early morning as shown in Fig. 6

Fig. 6.
figure 6

Utility grid Tariff

10 Results

The main objective function minimises the operation cost and the treatment pollutant cost of the microgrid with different weight; the operation cost has a higher weight than the treatment cost. Therefore, the results classify into two scenarios as described below: Scenario A: Minimum operational and pollutant treatment policy with unit commitment consideration at Isolated mode. Scenario B: Minimum operational and pollutant treatment policy of microgrid with unit commitment consideration at connected mode.

  • A. Scenario: Minimum operation and pollutant treatment policy with unit commitment consideration at isolated mode

The microgrid in isolated mode should cover all sensitive demand without any exchange power with the utility grid where the point of common coupling has isolated the microgrid from the utility grid. The isolated mode cost function with unit commitment consideration is formulated as in equation 错误!未找到引用源。.

$$ {CF}\left( {P} \right) = {w}_{1} \left( {\sum\nolimits_{{{t} = 1}}^{24} {\sum\nolimits_{{{i} = 1}}^{N} {\left( {{u}_{a} {\delta }_{dgi} } \right)\left( {{C}_{i} {F}_{i} \left( {t} \right) + {OM}_{i} + {SC}_{{{i},{t}}} } \right)} } + {F}_{{{cso},{i}}} ({t})} \right) + \left( {\sum\nolimits_{{{i} = 1}}^{N} {\sum\nolimits_{{{k} = 1}}^{N} {\left( {{u}_{a} {\delta }_{{{dg},{i}}} } \right)\left( {\left( {{w}_{2} {C}_{k} {\gamma }_{ik} + {w}_{3} {C}_{{{co}2}} {\gamma }_{{{ico}2}} } \right){P}_{i} } \right)} } } \right) $$
(23)

Figure 7 shows the Hourly optimal power schedule of DGs at isolated mode with unit commitment consideration. Figure 8 reveals the hourly operating cost of the DGs, pollutants treatment cost, and the carbon dioxide treatment cost of the microgrid at isolated mode with unit commitment consideration. The total operation and emission cost is presented in Table 4.

Fig. 7.
figure 7

Hourly optimal power schedule of DGs

Fig. 8.
figure 8

Hourly total DGs operating cost

Table 4. Daily cost of total DGs operating cost

There are 74 electric vehicles at each CSOs could deliver power to the network at voltage deviation time. Figure 8 showed the difference of using the diesel generator instead of the CSOs to compensate the voltage stability where using the diesel generator recorded higher price than using the CSOs.

  • B. Scenario: Minimum operation and pollutant treatment policy of microgrid with grid connected mode operation and unit commitment consideration at connected mode

The operation of the microgrid at connected mode is expressed as the island mode connected to infinity bus. Therefore, there is a penalty of power could move bidirectionally between the microgrid and utility grid. The direction of power decides according to the cooperation between the DMS and MGO according to availability, required, and total cost. The proposed cost function of the microgrid in connected mode with unit commitment consideration is formulated as in 错误!未找到引用源。 Figure 9 shows the hourly optimal schedule power of the DGs and exchange power with the utility grid.

Fig. 9.
figure 9

Hourly optimal power schedule of DGs

The objective function of the optimization problem decides the sufficient power amount to buy or sell from the microgrid. For example after 6:0. Figure 10 depicted the whole hourly operation and pollutant treatment cost of the islanded microgrid with considering unit commitment operation. The operation, emission, and total cost of microgrid are shown in Table 5. The total cost of the EVs is slightly better than replacing them with DE. At high penetration of the EVs, the cost difference between using EVs and DE become clear as the DE cost curve quadratic which increases nonlinearly when power increased.

Fig. 10.
figure 10

Hourly total DGs operating cost

Table 5. Daily cost of total DGs operating cost
$$ \begin{array}{*{20}l} {F\left( P \right) = w_{1} \left( {\sum\nolimits_{t = 1}^{24} {\sum\nolimits_{i = 1}^{N} {\left( {u_{a} \delta_{dgi} } \right)\left( {C_{i} F_{i} \left( t \right) + OM_{i} + SC_{i,t} } \right) + F_{cso,i} \left( t \right) + F_{ug} \left( t \right)\delta_{ug} } } } \right) + \left( {\sum\nolimits_{i = 1}^{N} {\sum\nolimits_{k = 1}^{N} {\left( {u_{a} \delta_{dg,i} } \right)\left( {(w_{2} C_{k} \gamma_{ik} + } \right.} } } \right.} \hfill \\ {\left. {w_{3} C_{co2} \gamma_{ico2} } \right)\left. {P_{i} } \right)\left. { + \sum\nolimits_{k = 1}^{N} {\left( {w_{2} C_{k} \gamma_{grid,k} + w_{3} C_{co2} \gamma_{grid,co2} } \right)} P_{grid} \delta_{ug} } \right)} \hfill \\ \end{array} $$
(24)

11 Conclusion

This paper presented a holistic approach to the managing electric vehicles charging/discharging within microgrid in three major processes of hierarchical arrangement. The paper focused on the first part of hierarchical management which is microgrid operator. MGO is proposed an optimal management system to minimise the total operation and emission pollutants cost of the hybrid microgrid. The results show that considering of unit commitment in optimisation problem reduced the total cost of the microgrid operation and increased the flexibility of optimal microgrid optimisation. Furthermore, it is not necessary that the utility grid operation cost less than the other DGs. Finally, it can be seen that discharging electric vehicles reduced the total operation cost of the microgrid.