Optimal operation of stand-alone microgrid considering emission issues and demand response program using whale optimization Algorithm

: Microgrids are new technologies for integrating renewable energies into power systems. Optimal operation of renewable energy sources in standalone micro-grids is an intensive task due to the continuous variation of their output powers and intermittant nature. This work addresses the optimum operation of an independent microgrid considering the demand response program (DRP). An energy management model with two different scenarios has been proposed to minimize the costs of operation and emissions. Interruptible/curtailable loads are considered in DRPs. Besides, due to the growing concern of the developing efﬁcient optimization methods and algorithms in line with the increasing needs of microgrids, the focus of this study is on using the whale meta-heuristic algorithm for operation management of microgrids. The ﬁndings indicate that the whale optimization algorithm outperforms the other known algorithms such as imperialist competitive and genetic algorithms, as well as particle swarm optimization. Furthermore, the results show that the use of DRPS has a signiﬁcant impact on the costs of operation and emissions.


Introduction
Recently, due to the high reliability, and the growing penetration of the distributed energy resources systems (DERS) into the power systems [1][2][3], a new concept called microgrid, which attracted a variety of researchers has been introduced [4,5].A microgrid which can be explained as a low-voltage network with loads and different small-scale production systems can generate the demanded heat and power of the local loads.Increasing the usage of renewable energy sources (RESS) has led to an increase in the need for lateral services i.e., spinning reserve, frequency regulation, and controlling ramp rates, which practically increase the operation cost [6].In this sense, it is worth mentioning that DRP is an important tool in the planning and operation of microgrids.DRP can change the electrical energy consumption from the normal pattern of consumers' power demand following the electricity price changes at different times, or also to pay incentives for lower energy consumption in cases with the high wholesale power price or compromised system's reliability [7].DRP with the ability to correct the consumption pattern can play a key role in energy supply and balance consumption and production [8].Therefore, considering the active and effective role of microgrids in a restructured power system, planning and optimal energy management in the new environment require extensive research and analysis.In this regard, this research addresses the optimum management of a microgrid in the presence of DERs and DRPS to reduce costs of operation and emission using the whale optimization algorithm (WOA) method.¬The simulation findings indicate that the WOA has a high competitive ability in comparison to the existing meta-heuristic algorithms in terms of optimization answers, convergence speed, and presenting the result more sensibly.It has also been determined that the use of DRPS has a significant impact on the costs of operation and emissions.This paper is categorized as follows, Section 2 discusses a literature review of the demand response programs in the microgrid.Section 3 discuss the problems and objectives of the proposed algorithm.It will be followed by demand response model, optimization methods, case of study, results, and finally the conclusion.Tables 1 and 2 are the list of acronyms and list of symbols respectively.

CC(t) Operation cost function W1, W2
The weight coefficient of operation cost and emission cost functions Pi(t) The output power of the i-th distributed generation resource in the period t The proposed price of the i-th distributed generation resource in the period t Ii(t) On and off status of the i-th distributed generation resource in the period t

SUi(t)
The cost of starting up and shutting down the i-th distributed generation resource in the period t The cost of demand reduction caused by the j-th demand response program in period t.

J
The number of demand response programs

X
The vector of variables including power output of resources and the power of charging and discharging of the battery

EMIDG(t) Emission cost function ine NDG
The number of distributed generations The amount of co2,so2,nox pollutants caused by the i-th distributed generation resources The prices of co2,so2,nox pollutants caused by the i-th distributed generation resources Pi DG(t) The total power generated by distributed generation resources  The distance of the i-th whale to the hunt

Literature Review
In this section, numerous studies that have been performed on the exploitation of microgrids in literature are reviewed.In [9], modeling various types of DRPs is considered in terms of the price elasticity of demand and the idea of customer profit.Besides, the DRPs implementation effect on the operation of grid-associated microgrids is studied.Furthermore, various scenarios are provided to model the different sources of uncertainties in microgrids, i.e., generation components failure, random outages of upstream line and transmission lines, error in predicting load demand, ambiguity in producing renewable-based (solar and wind) distributed generation components, and the likelihood of not responding the customers to the arranged disruptions.The optimum operation of a microgrid in a grid-connected state has been studied in [10].DRPS are utilized in this work considering time-of-use (TOU), price schemes, and emergency demand response programs (EDRPs).The combined integer linear programming is utilized for simulation purposes.In [11], a new reserve scheduling and stochastic energy management technique is provided for a microgrid considering different kinds of DRPS.In the suggested method, all kinds of commercial, industrial and residential customers can take part in DRPS including either reserve or energy scheduling.
Similarly, modeling the ambiguities associated with the RESs is performed through appropriate probability distribution functions as they are controlled by reserve offered by the distributed load and generations.Daily optimum scheduling problem of the networked microgrids regarding the intermittent nature of the load and generation is studied in the proposed energy management system (EMS) in [12].The optimum scheduling model, which is a combination of RTP and TOU price schemes of DRPs is solved utilizing a metaheuristic algorithm considering ambiguities of renewable energy sources and loads.Grid peak-shaving utilizing peak-time rebate structure demand response for microgrid energy administration is provided in [13].The highest profit for the microgrid with DRP such as manageable loads, diesel generators, and battery storage is obtained with this approach.This approach results in optimum microgrid energy management.This results in a lower cost of the main grid in comparison to other peak-shaving traditional programs.The peaktime rebate structure includes peak-time rebate incentive rewards and manageable loads demand response participation.In [14], a microgrid with RESs and fuel/battery microturbine, via the help of the multi-purpose algorithm adaptively modified particle swarm optimization (AMPSO), has been used.In its formularization, a non-linear model was used aiming at minimizing the cost and emission of the greenhouse gases, simultaneously.In [15], modeling an intelligent park microgrid is considered as containing photovoltaic (PV) power generation, integrated cooling/heating, and power system, responsive loads, and energy storage systems.The goal is to investigate the optimum operation approach of these components by considering the price-oriented demand reaction.In this sense, an enhanced model for the microgrid's economic operation is made which chiefly aims at minimizing the microgrid's operating cost and making complete utilization of clean energy regarding demand response and the distributed power generation.The genetic algorithm (GA) is used to solve this optimizing problem.Besides, the DRP and the clean energy utilization strategy determine the best solution for the best operation approach.
In [16], the authors provide a multi-objective optimization model to achieve the Pareto solutions taking into account both the emission and generation fuel costs.Nevertheless, both methods may lead to high financial and environmental costs.The concurrent arrangement of electrical vehicles and responsive loads is studied in [17] to decrease the emission and operation cost by the existing PV and wind powers in a microgrid.The suggested technique uses the electrical vehicles for peak-shaving and modifying the load curve while employing the responsive loads to meet the reserves required for compensating the intrinsic ambiguities of PV and wind powers.Additionally, an established two-stage model is suggested in order to determine the microgrid's anticipated operation cost.The effect of the participation level of customers in EDRP and the influence of illogical incentive values in the implementation of EDRP on the operation of the microgrid are provided in [18].Microgrid operation is investigated in [19] from a technical point of view.An economic operation approach for a grid-linked microgrid is suggested in [20] to minimize the operation cost for the operation course of 24 h ahead.In [21], the optimal power is calculated requiring a generation by the units in a microgrid to minimize the entire generation cost at the consumer's premises and enhance to minimize the entire generation cost at the consumer's premises and enhance the system's steady-state condition.In this paper, the scheduling optimization problem in microgrids, including operating and emissions costs, is studied while considering DRPs.Besides, technical, economic, and environmental issues of the microgrid are taken into account.The optimization problem is solved utilizing the WOA in the MATLAB environment.The results show that the WOA outperforms particle swarm optimization (PSO), imperialist competitive algorithm (ICA), and GA in solving the microgrid scheduling problem.It has also been determined that the use of DRPS has a significant impact on the costs of operation and emissions.In [9], energy management strategies (EMS) and system optimization were reviewed for wind energy and a stand-alone photovoltaic system combined with fuel cells.By integrating the system enhancement and EMS ARE, it is not common to discourse them separately in terms of system-level design.
Hence, this study deals with a discussion on the general optimization formulation framework and the categorization and reviewing a different kind of optimizing technique.
The impact of implementing the Time-of-Use Demand Response Program (TOU-DRP) on a separated microgrid was analyzed in [22] by taking into account various capacities of the installed wind power with and without energy storage unit.In this sense, various levels of participation of the customers in TOU-DRP, its impacts on operation cost, wind power spillage, and the unserved energy are comprehensively examined.In [23], optimal energy setting up of a stand-alone microgrid under system ambiguities is assessed and, then, numerous operational strategies are examined to study the system performance.The suggested optimization energy management system is mainly aimed at improving the energy use efficiency and also, decreasing the system fuel cost and gas emissions decrease through designing generations of energy resources every hour for the next day.To minimize the created emission and operation costs, the system is modeled as a constrained singleobjective optimization problem.The objective in [24] is a techno-economic analysis of energy, optimal sizing as well as a cost-effective stand-alone multi-carrier microgrid.In this regard, a long-term planning approach is stated considering reliability considerations and battery degradation.Using particle swarm optimization, the optimization problem is solved.In [25], the interconnected microgrids' operation is concentrated.In energy management, a step-wise demand response program (DRP) is taken into account to obtain a cost-effective operation.Moreover, for the power exchange between the interconnected microgrids, a novel pricing model is presented in terms of microgrid marginal pricing.In [26], provided a novel hybrid microgrid energy management strategy, which includes demand response and internal power market with multiple market configurations.This planning consists of interactions between incentive strategies, microgrids, and consumers.This is a stochastic linear programming technique with emission, demand cost and microgrid cost as the objective functions, where energy price, loads, wind speed and solar radiation considered as undefined factors.Microgrid system renewable energy resources economic, environmental and reliability benefits are evaluated in [27].This research focused on improving microgrid system green technologies benefits by minimizing annual load loss cost, cost of energy, life-cycle GHG emission cost and life-cycle cost.Operational model of microgrid consists of different generation resources connected to grid is developed in [28].The suggested technique is solved with set of Pareto solutions obtained using weighted sum method.ELECTRE and paired comparison matrix technique resulted in operator preferences best operation status.Hybrid AC/DC microgrids including multiple fuel options scheduling algorithm is discussed in [29].Particle swarm optimization multi-objective function consists of gas emission and operational cost.

Objective Function
The general objective function in terms of the operation cost and the emission cost which is defined as Equation ( 1), is the combination of the above functions [23].
where f 1 is the operation cost function and f 2 is the emission cost function.w 1 and w 1 which are the weight coefficients of each of these functions, specify the optimization priority.
The emission cost function involves the pollution cost caused by DERs.The considered pollutants include CO 2 [30], SO 2 [31], and NO x and the mathematical model of the emission cost function is defined according to Equation (4).Besides, the average cost of pollution resultant from non-renewable units is determined according to Equation (5).

Power Balance Constraint
The entire power generated by DERs and the demand reduction caused by DRP in each interval should be equivalent to the entire demand.
P DR (t) is the amount of active power participating in DRP defined according to Equation (7).

Minimum and Maximum Generated Power
The minimum and maximum power generated by each unit are limited by Equation ( 8).The limitation of solar and wind power generation also depends on the nominal capacity of these sources and the amount of radiation intensity and forecasted wind speed.The constraints on the power generation capacity of these resources are set out in Equations ( 9) and (10).
0 ≤ P WIND,t ≤ P w,t 3.2.3.Battery System Constraints Equation ( 11) indicates the battery capacity, which can vary depending on the amount of charge and discharge energy per hour for the next hour.Equation (12) indicates that battery can only be discharged or charged at any time.In Equations ( 13)-( 15), W ess,min and W ess,max show the minimum and the maximum amount of battery stored energy; P charge (t), P charge,max are the amount of battery charge power in the period t and maximum battery charge power; P discharge (t), P discharge,max are the amount of battery discharge power in the period t and maximum battery discharge power, respectively [32].

Demand Response Model
In this model [33], the load is classified into 3 types, i.e., residential (RC), commercial (CC), and industrial consumers (IC).DRP is based on the price packages and incentives to the customers for load reduction.The cost of incentive payment to residential, commercial, and industrial consumers due to load reduction in the period t is formulated in the following equations.Moreover, constraints express that the amount of load reduction by each consumer should be equal to or less than the maximum amount of their suggested load reduction.RP(r, t) = RC(r, t) in this article, participation in DRP is considered to be voluntary.

Optimization Method
Operation management of microgrids is a complex problem that should be solved by smart innovative methods.A meta-heuristic optimization algorithm is an innovative method that can be optimized with low modifications for optimization problems.Multicombinational algorithms significantly increase the ability of high-quality solutions for hard-core optimization problems.The common feature of these algorithms is the use of the exit mechanism from the local optimum.To solve the stated microgrid optimization problem, the WOA which is a novel technique to solve the optimization problems and is very competitive in comparison to the state-of-art meta-heuristic algorithms and usual approaches are being utilized.This algorithm inspired by the bubble-net hunting of humpback whales consists of three operators for simulating encircling prey, exploitation phase of bubble-net attacking, and exploration phase of the search for prey, which is represented by model Equations ( 25)-( 27), respectively.Humpback whales first detect the location of prey and surround it, then update their location according to the best search agent, or accidentally the whales swimming procedure around the prey, is in the form of a contraction circle and in a helix path.With a probability of 50% one of these two modes is selected in modeling.Applying the WOA to the problem under consideration is as follows: The WOA algorithm initiates with a group of random solutions.First, an initial population is generated as X i (i = 1, 2, . . .,n), and then, the fitness of each search agent is calculated.At each iteration, search agents update their locations based on either a randomly selected search agent or the best solution obtained so far.This behavior is provided as: The parameter is deduced from 2 to 0, to provide the exploration and exploitation phases.The best solution is selected when |A | < 1 and, then, the search agent is updated by Equation ( 26) while a random search agent is selected when |A | > 1. Next, the position of each search agent is updated by the Equation (27).Based on the value of p, WOA can shift between the circular (a-26) and the spiral movements (b-26).Finally, the WOA algorithm is ended by satisfying a termination criterion.

Case Study and Simulation Results
The microgrid structure is represented in Figure 1.According to this figure, it is clear that microgrid includes diesel generator (DG), fuel cell (FC), microturbine (MT), wind turbine (WT), and photovoltaic (PV) distributed generation resources.Besides, in the microgrid structure, a battery is used as an energy storage system.The cost and coefficients of different resources are presented in Table 3.  Regarding Figure 2, microgrid loads are divided into three types of RCs, CCs and ICs.In the selected microgrid, a WT with a nominal capacity of 15 kW, cut-in speed 3.5 m/s, nominal speed 17.5 m/s, and cut-off speed 18 m/s is considered.In Figure 3, the average wind speed predicted for the next 24 h is shown.The used PV capacity is 25 Kw which is of the SOLAREX MSX type.The amount of sunlight in the considered location for the next 24 h is also shown in Figure 4. Based on Figures 3 and 4, the predicted power of WT and PV for the next 24 h, can be calculated using the mathematical relations presented in Section 3. In calculating the output power of WT and PV, it is supposed that the power factor of these sources is one and does not produce reactive power.In the chosen microgrid, the minimum and maximum storage levels are set to 10% and 100% of the battery of 180 kWh capacity, respectively.Battery charging and discharging efficiency is also considered 94% [33].According to Table 3, the maximum discharge and charge power of the battery is also 30 kW, which is equivalent to one-sixth of the capacity of the battery.The suggested packages for DRP [35] are represented in Table 4.A maximum of 30% participate is assumed in these programs.Table 4. Suggested packages for demand response [33].

Level
Interruptible Load Range Price ($)

Simulation and Data Analysis
The following scenarios are considered to solve the microgrid energy management problem using DRPs and WOA.
Scenario 1: Enhancing the operation cost and the emissions cost regardless of DRP Scenario 2: Enhancing the operation cost and the emission cost considering DRP Then, the results of the above scenarios are compared and the effect of using DRP is investigated.

Scenario 1
In this scenario, the efficiency of the WOA algorithm in solving the problem is evaluated by comparing it to the results of GA [36,37], PSO [38,39], and ICA [40,41] algorithms.To compare WOA performance to these algorithms, the problem is modeled without demand response.Given the fact that the considered microgrid has 6 units and each unit is scheduled for 24 h, the problem variables are 24 × 6 = 144.For all four algorithms, the population is 100 and the maximum number of iterations is set to 100.Each algorithm runs ten times and, finally, the best answer, the worst answer and the average answer of each run are computed and stored.This information is presented for the algorithms in Table 5.For these simulations, both w1 and w2 values in the cost function are considered to be 0.5.It is assumed that the importance of reducing the operation cost and emission cost is the same.Based on the presented result in Table 5, it can be seen that the best answer, the worst answer and the average answer of the WOA are the best as compared to the other three algorithms.Furthermore, the results show the optimal scheduling of the distributed resources at minimum costs of operation and emission.In Figure 5, the value of the cost function based on the number of repetitions, for ten runs for every four algorithms, is shown.Based on this figure, it is clear that for all answers, the convergence rate of the WOA is better than other algorithms.
Besides, in Figures 6 and 7, the predicated power and purchasing power of PV and WT are shown for each of the four algorithms, respectively.Predicated solar and wind power means the power generated by these resources according to their nominal capacities and hourly forecast curves for solar radiation and wind speed.As it is known, due to the low cost of PV operation, the maximum use of them is optimally detected.Figure 7 shows that in all algorithms, wind power has been used to a large extent, among which the WOA algorithm has the highest rank in utilizing this power.In Figure 8, the power of charge, discharge power, and stored energy per hour are shown for each of the four algorithms.According to Figure 8, the battery is discharged at peak times and charged at off-peak periods.This will reduce the amount of power generation from more expensive sources or sources of pollution.Now that the effectiveness of the WOA is cleared in solving this operation management problem and to achieve accurate results, we multiply the population by 5, set it to 500, solve the problem with 100 repetitions of the WOA, and, finally, obtain the optimal amount of each resource in this case.It is assumed that the importance of reducing the costs of operation and emission is the same.Accordingly, the weight coefficients w1 and w2 are set to 0.5.For this scenario, the operation cost is $335.91 and the emission cost is $102.41. Figure 8 shows the objective function values versus the number of repetitions of the WOA algorithm.Table 6 also shows the optimal power of each resource for each hour.In this table, the positive and negative values for the battery show the discharge and charge power, respectively.
In Figure 8, the charge power, discharge power, and stored battery power are shown per hour.Matching this shape with the load curve shown in Figure 2, it is clear that the battery is charged at off-peak periods and discharged at peak time.In Figures 9 and 10, the predicted power and the purchasing power are shown for WT and PV. Figure 10 and Table 6 show that PV power is used more than other resources.The reason is that the emission cost of this resource is lower than other resources.It is also clear that the most available WT power is used.In this sense, according to Table 3, the operation cost of WT is much less than other sources too, such as diesel generators.Therefore, like PV, the use of WT power is optimized to reduce emissions.

Scenario 2
In this scenario, the problem under study is solved using WOA.In this sense, DRP is also considered.As mentioned, it has been assumed that up to 30% of consumers are involved in DRP.Considering the power output of the resources and the amount of power consumed by residential, commercial and industrial consumers within 24-h, the number of variables is 216 and the number of population and repetitions are 500 and 100, respectively.For this scenario, the value of the total cost function for each WOA repetition is represented in Figure 11.The cost of operation and the cost of emission were $250.5 and $64.270, respectively.In this regard, $29.243 of the operating cost, is related to the demand response cost.In Table 6, the optimal amount of resource power and also the amount of demand reduction per hour have been shown.In Figure 12, the amount of charge power, discharge power and stored energy in the battery is shown for each hour.The battery is charged at off-peak periods and is discharged during peak intervals.

Investigating the Effect of Demand Response
In Figure 13, the amount of load for all customers is shown for each hour, before and after the demand response.According to Figure 14, it is clear that the demand response occurred both at peak times and off-peak periods.The reason for using demand response is to reduce the pollution because, in some hours, the power of some resources with high pollution, such as diesel generators, is small.Moreover, by carrying out DRPS, it is possible to turn off these resources during off-peak periods, which will significantly reduce the operation and emission costs.According to Figure 15, the most use of demand response has occurred in peak hours.This has been done to reduce the use of expensive energy resources and also to reduce emissions.In Table 7, the costs of operation and emission for scenarios 1 and 2 have been compared.According to Table 7, using the DRP has reduced operating costs by $85.41, which is equivalent to 25.4% of the total operating cost.Moreover, it has also reduced the emission cost by $38.39 which is equivalent to 37.4% of the total emission cost.Accordingly, it is worth mentioning that the results indicate a significant improvement.

Conclusions
In this research, an optimum operation management model for a stand-alone microgrid considering DRP is proposed.The aim is to minimize the operation and emission cost, simultaneously.To manage the energy of the microgrid, incentive-based DRP has been used.The optimization problem is solved with the WOA in the MATLAB environment.First of all, the model is simulated for WOA and the three optimization algorithms without considering of the DRP; PSO, ICA and GA, to assess the WOA's performance.The findings showed that the WOA as compared to other algorithms has proved better performance for worst, best and average taken results.Furthermore, the results showed the optimal scheduling of the distributed resources at minimum costs of operation and emission.Then, the microgrid energy management model was performed considering DRP.Simulation results showed that using DRP has reduced the operating costs and emission cost by 25% and 34%, respectively.DRP provides better utilization of the microgrid, both in terms of operating costs and emission cost, which proves the importance of DRPS.

Figure 5 .
Figure 5. Convergence comparison of the algorithms for ten runs with a population of 100 and several replicates of 100.

Figure 6 .
Figure 6.Predicated and purchased power of PV.

Figure 7 .
Figure 7. Predicated and purchased power of WT.

Figure 8 .
Figure 8. Charge power, discharge power, and stored battery energy during optimization.

Figure 9 .
Figure 9. Predicated and purchased power of wind turbine in scenario 1.

Figure 10 .
Figure 10.Predicated and purchased power of PV in scenario 1.

Figure 11 .
Figure 11.The total cost function of scenario 2 (the population of 500 and 100 repetitions).

Figure 12 .
Figure 12.Charge power, discharge power and stored battery power in scenario 2.

Figure 13 .
Figure 13.Predicated and purchased power of wind turbine in scenario 2.

Figure 14 .
Figure 14.Predicated and purchased power of PV in scenario 2.

Figure 15 .
Figure 15.The amount of microgrid load before and after of DR.

Table 1 .
List of acronyms.

Table 2 .
List of symbols.

Table 6 .
Optimal power of each source for each hour in scenario 1.