Optimal Scheduling of Microgrid with Distributed Power Based on Water Cycle Algorithm

Microgrid, taking advantage of distributed power generation technology, plays an important role in maximizing the utilization of renewable energy. Based on the problems of the energy crisis, environmental contamination and the high operating cost of the microgrid, the microgrid model can effectively ease energy pressure. We can dispatch the output of each part in the microgrid to obtain the optimal economy. Since many traditional optimization algorithms have limitations of local optimization, multiple iterations, and slow convergence speed, this paper proposes a method that applies the Water Cycle Algorithm (WCA) to optimize the dispatch of the microgrid to minimize the operating cost. The mathematical model of each distributed power is established. The interactive power between the microgrid and large grid is also considered. The lowest generation cost considering environmental benefits is taken as the objective function. Water cycle algorithm is implemented to obtain the optimal solution under various constraints. Some optimization algorithms such as Genetic Algorithm (GA), Interior Search Algorithm (ISA), and Differential Search Algorithm (DSA) were used for results evaluation. By comparing the results obtained from four different algorithms, a case study shows the WCA possesses the advancements of better convergence performance, faster calculation and higher precision compared to the other algorithms. The results demonstrate that the WCA applied to determine the optimal scheduling of the microgrid can achieve a better result than some other algorithms with an acceptable accuracy and efficiency.


Introduction
To increase the utilization rate of renewable energy and solve problems of the energy shortage and environmental pollution, many countries have begun to fix attention on renewable energy power generation technologies. The concept of distributed generation technology was first proposed by Euramerican experts. The advantages of DG are environmental friendliness, low cost, and favorable system reliability [1]. It can effectively solve energy and environmental problems. However, because of the instability of renewable energy output, the huge challenges will be brought to the stability of the grid when it is connected to the grid [2]. The Consortium for Electric Reliability Technology Solutions (CERTS) pioneered the concept of microgrid (MG) [3]. It can fully play the role of DG in keeping the system operate stably and decreasing the influence of DG permeability on the power grid. The microgrid and the large grid can support each other, and the microgrid can serve as a supplement to the grid, that can provide users with higher power quality. It will increase the power generation cost with the addition of microgrid. To optimize the output of the microgrid to make the operation of microgrid more economical, many scholars have put forward various methods.
The optimal scheduling of distributed power in the microgrid can be deemed to be an optimization problem. Optimal scheduling of the microgrid is a multi-constraint, multi-dimensional and highly nonlinear combinatorial optimization problem. Thus, an intelligent algorithm is required. Modiri-Delshad et al. [4] proposed an Iterated-based algorithm to effectively solve the microgrid economic scheduling problem by gradually regenerating the optimum value. Related research [5][6][7] shows that particle swarm optimization (PSO) and binary PSO (BPSO) have been applied to microgrids for stabilizing voltage and frequency, controlling power flow to reduce cost, settling unit commitment and solving multi-objective uncertainty problems. However, PSO has the drawback of often being caught in the local optimum and is not efficient for a multi-objective mathematical model. Multi-layer ant colony optimization (MACO) is applied in [8] to settle the minimum power generation cost problem of the microgrid. It has better performance than PSO in terms of convergence speed and computational efficiency. A new multi-cross learning based chaotic differential evolution (MLCDE) algorithm is proposed in [9] to obtain the optimal solution for the operation of the microgrid. By using the algorithm, the solution space of continuous decision variables could be searched greatly in all dimensions, thus getting rid of the local optimum. Marzband et al. [10] implemented Multidimension Imperialist Competition Algorithm (MICA) for energy management system (EMS) to make the lowest power generation cost and cut down Marginal Clearing Price (MCP) while the microgrid was connected to the grid. Maharsi et al. [11] proposed a cost-based power distribution scheduling optimization in a microgrid using genetic algorithm (GA) to acquire the optimal solution. However, GA tends to cause premature convergence problems. A Differential Evolution (DE) algorithm is proposed in [12] to optimize the performance and minimize the operating cost of a microgrid based on EMS. Its convergence speed is preferable to traditional PSO. It is effective to apply a parallel distributed optimization algorithm to optimize the dispatching of microgrids to attain the minimum microgrid cost [13]. Interior Search Algorithm (ISA) is implemented [14] to ascertain the optimum hour-by-hour dispatching for the microgrid system to achieve its minimum running cost. It can obtain a relatively exact value.
In view of some shortcomings of the above algorithms, this paper proposes a heuristic evolutionary algorithm, Water Cycle Algorithm (WCA). This method has also been implemented in many fields. Hato et al. [15] employed WCA to acquire the optimal parameters of Proportional-Integral (PI) controllers for Doubly Fed Induction Generator (DFIG), which can resolve the problem of time-domain conditions and nonlinear running constraints. The study shows that it can avoid the disadvantages of GA and PSO and get a better result. A technique based on WCA is proposed in [16] that can efficiently acquire the optimal parameters of photovoltaic modules because of its few iterations and fast convergence. Elhameed and El-Fergany [17] presented an effective way of resolving single objective and multiple objectives of economic load dispatch (ELD) by using WCA. It can work efficiently to solve multi-objective optimization problems with equality and inequality constraints. Makeen et al. [18] applied it to smart hybrid microgrid Integration and can get the global optimal results. The efficiency of WCA has been promoted compared with some other optimal algorithm such as PSO and GA when they are applied to settle complex problems. Water cycle optimization algorithm has been implemented to resolve the issue of economical emission dispatch unit commitment. It performs well and obtains better solutions than GA [19].
We can know from the current research that the water cycle algorithm is superior to some other algorithms in terms of global optimization, the number of iterations, accuracy, and convergence speed. It is appropriate for the problems which contain equality and inequality constraints, as well as solving linear and nonlinear problems. It has a more prominent effect when it is applied to complex systems. Based on the current research, this paper establishes an optimal dispatching model of microgrid according to each component of the microgrid, considering the characteristics and output constraints of the microgrid. For an actual microgrid system as a case, this paper applies the water cycle algorithm to optimize the operation of the microgrid to get the best optimal economy. The results obtained are contrasted with the results acquired by the Genetic Algorithm (GA), Interior Search Algorithm (ISA) and Differential Search Algorithm (DSA). Case studies prove the advancement of WCA in optimal dispatching of the microgrid. The models of distributed power and energy storage systems in microgrids is introduced in Section 2; The optimized scheduling model of the microgrid is established in Section 3; The water cycle algorithm (WCA) and some other optimization algorithms such as GA, ISA, and DSA are presented in Section 4. A case study to analyze the advancement of WCA in is presented in Section 5; Finally, conclusions are drawn in Section 6.

The Structure of the Microgrid
The microgrid is a complete system, which is connected to the grid through the Point of Common Coupling (PCC). The microgrid contains various forms of power generation, such as renewable energy generation (wind power generation, solar photovoltaic power generation, etc.) and non-renewable energy generation (micro gas turbines, fuel cells, etc.). The energy storage system is a necessary part that can improve the stability of the microgrid. The microgrid system can also provide cooling and heat supply to load users through the form of Combined Heat and Power (CHP), which improves the multi-level utilization efficiency of energy [20]. Figure 1 is a schematic diagram of the microgrid structure. The above schematic diagram shows the structure of the microgrid system. PV refers to the photovoltaic power generation system; WT refers to wind turbine system; MT refers to micro turbine power generation system; DE refers to diesel engine generator; and ESS refers to the energy storage system.

The Model of Photovoltaic Power Generation (PV)
The basic principle of photovoltaic power generation is that it utilizes the photovoltaic effect of a semiconductor interface to transform luminous energy into electrical energy. The amount of generated energy is linked to illumination. Since its output power has the characteristics of nonlinearity and it is susceptible to environmental factors, it can be considered as a PQ node for analysis. To facilitate the actual engineering application, we use the Beta distribution to obtain the light intensity at each time point. The output of the photovoltaic generator is related to the light intensity and temperature. The power of a single photovoltaic unit (PV) is denoted as P PV (t), defined as [21]: where G STC is the radiation intensity (1 kW/m 2 ); P STC is maximum test power; G (t) is practical light intensity; T STC is reference temperature (298 K); T (t) is practical temperature; and k is power coefficient (−0.0047/K).

The Model of Wind Power Generation (WT)
The basic principle of wind power generation is: when there is wind, a certain torque will be generated on the blades of the wind turbine to drive the hub to rotate, and the mechanically connected equipment such as a gear box of the hub is employed to drive the rotor of the asynchronous generator to turn up [22]. Therefore, the output of the wind power generator is linked to the wind speed. Since the actual measurement of wind speed is complicated, the most mainstream distribution describing the random variation of the average wind speed is the two-parameter Weibull distribution, which has been widely used by scholars for its good fitting effect and wide adaptability. The two-parameter Weibull distribution expression is as follows [23]: where k is the shape parameter, generally taking k = 1.8-2.8, and c is the scale parameter, which can be obtained from the following formula: where µ WT is the average wind speed during the statistical period. The wind speed is obtained from the above formula, and the output power of the wind generation can be figured out according to wind speed. The relationship between the active power of wind turbine P WT and the wind speed v can be given in the following equation [24]: where P r is the rated output power; v ci is the cut-in wind speed; v r is the rated wind speed; v is the actual wind speed; and v co is the cut-out wind speed.

The Model of Micro Turbine (MT)
Micro turbine (MT) is a new type of small heat motor. The methane, natural gas, diesel or gasoline are used as fuel to generate high temperature and high pressure gas to rotate the gas impeller [25].
If the MT is implemented in cogeneration mode, the following assumptions can be made: in the unit time interval ∆t, the active and reactive output of the micro-source is constant; the demand for heat and electric load is constant; the interactive power between the microgrid and the grid is constant; and the interaction price remains constant. When the value of T is different, the optimization model established below is applicable. This article takes ∆t for 1 h. The mathematical model of a cogeneration system for a micro turbine is [26]: is the MT's power generation efficiency; η 1 is the heat loss coefficient of MT; P e (t) is the electric power output of MT; Q he (t) is calorific value provided by the residual heat of the MT flue gas; K he is the heating coefficient of the bromine cooler; V MT is the amount of natural gas consumed by the MT; ∆t is the operating time of the MT; and LHV is the low heat value of the natural gas, taking the value of 9.7 kW·h/m 3 here.
The fuel cost of MT can be expressed as: where C MT is the cost of the micro turbine fuel; C i is the unit price of fuel; P MT is the micro turbine output; and η MT is the micro turbine operating efficiency.

The Model of Diesel Engine Generator (DE)
The diesel engine generator (DE) consists of a synchronous generator and an internal combustion diesel engine. It is a controllable distributed power and can be dispatched flexibly. It aims to provide users with a sinusoidal AC power of constant frequency and amplitude. The capacity of DE ranges from a few kilowatts to tens of thousands of kilowatts. When the microgrid is running connected with the main electric network, the DE is generally regarded as a PQ node. The voltage and frequency of DE can refer to the large grid, and the output of DE is controlled according to the power demand. When the microgrid is in the unplanned island operation mode, the DE will be converted from the PQ node to the PV node. The diesel generator will be responsible for the normal operation of the microgrid, regulating the voltage and frequency of the microgrid system directly or indirectly.
The fuel consumption of DE can be expressed as a quadratic function. Hence, the fuel cost of the diesel generator C DE is calculated by the quadratic function times the unit price of diesel fuel C Diesel [27]: where P DE is the active power of DE; and a, b, c are the diesel generator cost function parameters.

The Model of Energy Storage System (ESS)
The battery energy storage system is widely used because of its mature technology, and the high degree of commercialization. And the battery energy storage system has the advantages of high energy density, relatively low price, high recycling rate, low self-discharge and large capacity, thus it has been applied to the microgrid of this paper.
The state of charge (SOC) is an indicator of the remaining battery capacity. It refers to the ratio of the remaining battery capacity E t at a certain time to the rated battery capacity of E c : The remaining power can be obtained according to the following formula [28]: Charging process: Discharge process: where σ represents the self-discharge rate of the energy storage system; P c and P d represent the charge and discharge power of the energy storage system respectively; η c represents charging efficiency; and η d represents discharging efficiency.

Objective Function
The system model established in this paper takes the lowest power generation cost of microgrid as Goal 1: where C init is the total initial investment cost of all distributed power; C op is the total operation and maintenance cost of the distributed power; C ESS is the total cost of the energy storage system; and C grid is the cost of interaction between the microgrid and the large grid.
where i represents the type of distributed power; C i represents the initial investment cost of a distributed power source; C E init represents the initial investment cost of the energy storage system; and C E op indicates the operation and maintenance cost of the energy storage system. Goal 2 is the best environmental benefits, that is, the environmental cost to control the gas emission of power generation pollution is the minimum: where t is the number of scheduling periods; T is the total number of scheduling periods, which is T = 24 here; n is the total number of distributed power sources; j is the type of pollutant, i.e. SO 2 , CO, CO 2 or NO x ; γ 1j and γ 2j are penalty costs and environmental values of pollutant j, respectively; B ij represents emission of the pollutant j from distributed power i per unit of power generation; and P i,t represents the power generated by distributed power i in period t. The minimum cost of total power generation in the microgrid is taken as the objective function. It can be defined as: where α and β represent the weight of the power generation cost and the pollution gas treatment cost towards the total cost, respectively. We take α = β = 1, i.e., the cost of microgrid power generation and the cost of controlling pollution gas are equally important. The objective function is expressed as the following formula:

Constraints
It should meet this condition at all times: The output of each DG must meet the upper and lower limits of its own output at any time: DG types include: WT, PV, MT, and DE.
In addition, the controllable distributed power ramping constraint, that is, the output of the distributed power or the reduced output during any two periods, must meet certain constraints.
where r i,d and r i,u represent the downward climb rate and upward climb rate of the distributed power i, respectively. The constraint of battery state of charge: The capacity constraint: The battery charge or discharge power constraint, that is, the charge or discharge power of the battery must meet certain upper and lower limits at any time.
where P SB,t represents the output power of the battery in t period; and P SB,min and P SB,max indicate the minimum and maximum charge or discharge power of the battery, respectively. In the absence of distributed power and other power supplies, the energy storage system should be able to meet the peak power of the impact load P Lmax .
where P ess represents the output of the energy storage system. The power constraints of microgrid and large grid interaction: where P min line and P max line indicate the minimum and maximum output power of the transmission power between microgrid and the grid, respectively.

Scheduling Strategy in Grid-Connected Mode
When the microgrid is operating in the parallel pattern, we consider the output scheduling of all the distributed generation as well as the energy trading through transmission of microgrid and main electric network. Under the premise of satisfying the demand of heat and electric load in the microgrid and ensuring the safe and reliable operation of the microgrid, with the consideration of the energy transmission of microgrid and main electric network, we can arrange the output of each DG reasonably to minimize the operating cost of the microgrid system.
It can roughly fall into the following procedures: First, wind speed and light intensity are characterized by randomness and intermittency. Thus, WT and PV belong to uncontrolled distributed power sources which cannot be dispatched. Since wind power and photovoltaic power generation do not consume fuel, WT and PV are given priority to output the power and their power is tracked by maximum power point tracking technology.
Second, if the MT operates in the form of fixing heat based on power to improve its operating efficiency, it should meet the heat load requirements. Then the MT's minimum active output is determined.
Third, when the power load in the microgrid is greater than the sum of the minimum power output that forces of WT, PV, MT and DE, we consider the discharge of BESS. Before that, the charge or discharge status of BESS should be detected. If the maximum discharge power of BESS cannot meet the power load demand, then we compare the unit power generation cost of MT or DE with the unit electricity purchase price. When the unit running cost of MT or DE is less than the unit electricity price, then the output of MT or DE is added correspondingly based on the optimization results. Otherwise, we can buy electricity from the grid.

Basic Concepts
WCA is an advanced meta-heuristic algorithm, which is a component of evolutionary algorithms. The proposed WCA algorithm is inspired by the process of the water cycle in nature. It imitates the procedure of streams and rivers that flow into the sea in the end. When it rains, the raindrops merge to form a water flow, and the weak flow combines to form a strong water current, which gradually aggregates into a stream and flows to the sea. In the process, some of the water seeps into the ground, some flows through the surface of the earth, and some evaporates and forms rain that creates new raindrops and streams, thus, increasing the diversity of populations [29].

The Procedure of WCA
The specific principles and procedures of WCA can be referred to in [29]. The flow chart of the algorithm is shown in Figure 2 [30].

The Characteristics and Development of WCA Algorithm
The WCA, a meta-heuristic algorithm which obtains a solution that meets some conditions has a certain degree of randomness. It is almost impossible to check the results obtained by meta-heuristic algorithms when they are applied to complex problems of multi-constraint and nonlinearity [31][32][33]. Hence, the results obtained are relatively good solutions with acceptable efficiency and accuracy. It is possible to find a most efficient algorithm to produce good values while it is not guaranteed to be optimal. Moreover, there is no particular algorithm that can deal with all optimization problems-the diversity of problems requires different algorithms.
WCA is applied in many fields to solve optimization problems and can achieve good results. WCA performs better than some relatively mature optimization algorithms when it is implemented to settle discrete and continuous problems, equality constraints and inequality constraints in power systems [34][35][36][37]. Their comparisons show that WCA is characterized by superior convergent performance, high precision and global optimum because of the suitable diversity and dispersion. WCA is an appropriate algorithm to settle the complex mathematical problem with equality constraints, and holds the advantages in competing with some other algorithms.
The water cycle algorithm was initially put forward by Eskandar in 2012 [29]. By using some examples of restrictive optimization problems to test WCA and some other optimzers, it shows that WCA performs well to resolve constrained issues and attains the optimal solutions as well as the minimum number of iterations. WCA was introduced to solve multi-objective optimization problems in 2015 [38]. It works well to settle the multi-objective optimization problems and could get quality results with better precision and efficiency. Water cycle algorithm with evaporation rate (ER-WCA) was introduced in 2015 [39]. The addition of evaporation process can better prevent the local optimum. Therefore, the ability of global optimization is further improved. The water cycle algorithm settled nonlinear problems and achieves higher quality results compared to some meta-heuristic algorithms such as PSO and Cuckoo search algorithm [40].

The Introduction of Some Other Algorithms
EAs are effective in solving constraint optimization problems [41]. GA is a branch of evolutionary algorithm [42,43]. It is a global optimized algorithm that finds the optimal solution by mimicking the choice of nature and the mechanism of genetics. However, the local search ability of genetic algorithm is weak, which makes the genetic algorithm more time-consuming, and the search efficiency is lower than the late evolution algorithm. In practical applications, the genetic algorithm is prone to the problem of premature convergence. How to maintain good individuals and group diversity has always been a thorny problem. The Interior Search Algorithm (ISA) does not belong to the meta-heuristic algorithm. It is enlightened by interior design and decoration, so it is considered to be an aesthetic search algorithm. It has a good ability of global optimization. Its optimization results and efficiency are better than many other traditional optimal algorithms [44]. Differential Search Algorithm (DSA) is a population-based meta-heuristic optimization algorithm that can be applied to resolve the numerical optimization problem. It is inspired by the Brownian-like random-walk movement that an organism usually employs when it migrates to somewhere. The algorithm can obtain the relative global optimal solution with high precision [45].

Case Study
We selected a microgrid system as an example, as shown in Figure 3. In the microgrid system, the public connection point (PCC) between the microgrid system and the large grid remains closed. The uncontrollable DGs in the microgrid include one 200 kW wind turbine and one 60 kW photovoltaic power station. Controllable DGs include one diesel generator with the rated power of 50 kW and one micro turbine with the rated power of 90 kW. The rated capacity of the battery group is 50 kVA; both the charge and discharge efficiencies are 0.9; and the maximum, minimum and initial charge states are 95%, 20% and 50%, respectively. The maximum and minimum tie-line power transmission between the microgrid system and the large grid are 80 kW and −80 kW, respectively. The scheduling cycle takes one day, with 1 h as a scheduling period.
The wind speed, light intensity, load power data in a typical day in one place can be forecasted based on historical data, as shown in Figure 4, Figure 5 and Figure 6 respectively.  In the example, the real-time electricity price mechanism was adopted, and the electricity price for each period is shown in Table 1. The relevant parameters of DG cost and expenses are shown in Table 2. The pollutant gas emissions of different distributed power and treatment cost parameters are shown in Table 3. The relevant parameters of the distributed power are set as follows: G STC = 1 kW/m 2 , k = −0.5, T STC = 298 K,v ci = 3 m/s, v co = 25 m/s, v r = 14 m/s, LHV = 9.7 kW· h/m 3 .

The Optimized Result by Using WCA
MATLAB was used to program the WCA, which was applied to solve the problem proposed above. Population size in the WCA was set to N pop = 50; optimization variable dimension was set to N re = 4; the largest number of iteration was set to n = 200, and precision was set to d max = 10 −5 . Since the installation cost is fixed cost, to make the result more obvious, it is reasonable to optimize the operation cost of the microgrid with the consideration of environmental cost. The variables to be optimized are the output of the energy storage system (ESS), the output of the micro turbine (MT), the output of diesel engine (DE) and the power interacting with the large power grid.
The output of DGs, energy storage system and the interaction with large power grid were obtained when the system cost was lowest. The output diagram of each part is shown in Figure 7. The figure shows that uncontrollable distributed power such as wind power and photovoltaic power to output electric energy relying on natural conditions. As can be seen in the figure, when the load requirement in the microgrid is higher than the minimum output power sum of WT, PV, MT and DE, it is priority for battery energy storage to discharge. When the load demand is lower than the output of distributed power, the energy storage system is charged to prepare for the subsequent output. Since the unit generation cost of MT and DE is higher than the purchasing electricity from the grid, when the load demand is high, the power balance is satisfied through the purchase of electricity.

The Optimized Result by Using GA, DSA, ISA and WCA
To analyze the characteristic of the WCA, GA, ISA and DSA were applied to resolve the same case for comparison. After multiple independent runs of the four algorithms, we obtained relatively stable results for each method. The optimal scheduling solutions were extracted for several hours of the day for analysis.
The following results are obtained by the four algorithms at time 1 h in Figure 8.  The following results are obtained by the four algorithms at time 12 h in Figure 9.

The Analysis of Simulation Results
For the same example, four different algorithms work well to resolve the problem. As we can learn from the figures the convergence performance of WCA is obviously better than GA, ISA and DSA. Its convergence curve is more stable than the other three algorithms. It tends to converge faster to the stable value and can achieve a better optimal value compared to the other algorithms. Thus, it is characterized by fewer iteration times, faster convergence speed, higher computational efficiency and higher accuracy. This is more efficient for solving more complex optimization problems in engineering, which makes WCA more advantageous than other optimization algorithms.

Conclusions
Microgrid is a small power system with complete functions of power generation, transmission and distribution, and electricity consumption. It possesses the considerable advantage of making good use of distributed generation technology, improving the system power supply flexibility and power quality, maximizing the utilization level of renewable energy and making the power market economic operation. As a result, it is meaningful to optimize the dispatching of microgrid operation. This paper applies WCA to optimize the dispatching of the microgrid. By combining with the proposed mathematical model of each part of the microgrid, an optimized scheduling model considering the operation cost and environmental cost is established. We could reasonably arrange the output of each part of the microgrid according to the results to reach the best economy. Results obtained are compared with those obtained by GA, ISA and DSA, and the indicate that WCA has improved convergence performance, computational efficiency and global optimization capability. This algorithm has certain reference value in optimal scheduling of microgrid to reach the lowest generation cost with the consideration of environmental cost.