1. Introduction
The demand for renewable energy as a resource for electrical power is being increased rapidly. This is because of several reasons, including that they don’t have negative impacts on environment and have low operation costs when compared to classical power generation methods. However, there are a lot of limitations and challenges that must be surmounted to harness the energy from renewable resources effectively [
1]. One of these challenges of renewable energy resources is that they must be installed in limited locations. Moreover, their output power depends on the current environmental and weather conditions, which means that they may not be able to supply the demand at certain times. All these limitations have directed researchers to a new concept of electric distribution, which is the microgrid (MG) [
2,
3]. A microgrid is a distribution network that supplies certain loads from different distributed energy resources (DERs), such as photovoltaic (PV), wind turbines (WT), diesel engine generators (DEGs), fuel cells (FC) and battery storage [
4]. Additionally, a microgrid usually has a connection with the unified grid. This connection is established to enable the power exchange between the grids to maximize the load security. Furthermore, the microgrid can sell excess power to unified grids [
5].
To get the maximum benefits of microgrids, it is important to have an energy management system (EMS) to be responsible for the operation and control of different DERs and power exchange between the microgrid [
6,
7] and the grid as shown in
Figure 1.
The main role of the EMS is to decide the amount of energy that needs to be supplied by the DERs within the microgrid and to organize the power exchange between the unified grid and the microgrids. The decisions of the EMS are based on the ability of DERs and the current prices of energy. This means that the EMS must take accurate decisions to balance between increasing local production and maximizing economic revenue. Consequently, energy management of microgrids forms a highly constrained optimization problem and this optimization problem is usually considered an offline one [
8].
From the above-mentioned explanation, it is clear that the EMS’s objective function depends on providing various types of data. Some of these data can be easily determined, such as the generation capacities of the grid and microturbines. However, most of them depend on forecasts and estimations such as loading limits, wind speed, solar irradiance, energy prices, etc. As a result, the researchers have followed two techniques in optimizing the EMS’s objective function [
9,
10].
The first is the deterministic approach: in this approach, all forecasted data are taken into consideration as they are assuming that they have very high accuracy. The other approach is the probabilistic approach in which all forecasted data are put in the form of variables. Each variable has a probability that resembles the accuracy of the forecast.
Researchers have applied many optimization algorithms to solve the EMS problem. One of the famous techniques is linear programming (LP) which considers the power balance and generation limits of the distributed generation units. However, this method suffers from one main disadvantage, which is a high computational burden [
11,
12,
13].
One of the popular optimization techniques that have been incorporated in solving the EMS problem is dynamic programming (DP). The main advantage of this method is its ability to divide the EMS into smaller sub-problems. This means that the optimization technique will solve sequential problems instead of solving one sophisticated problem, which helps in reaching the optimum solution with quick and accurate performance. However, the operation of this algorithm is considered difficult since it includes a high number of recursive functions [
14].
In [
15], a genetic algorithm is used in optimizing the EMS’s objective function. This method has better computational burden when compared to LP. However, still the computational complexity exists.
Multi agent (MA) optimization has gained great researchers attraction in solving the EMS optimization problem. Although this method has relatively high accuracy considering many constrains, it suffers also from high computational complexity and time [
16,
17,
18,
19].
Particle swarm optimization (PSO) has attracted many researchers as well to use it in the optimization of the EMS problem. This method showed better results compared to previously mentioned methods in terms of accuracy and computational burden [
15,
20].
In [
21], authors proposed the artificial bee colony (ABC) to solve the EMS problem. Although this method is considered quite simple and has robust performance, the formulation of the EMS problem to adapt between it and the algorithm is considered complex as this technique is suitable for objective functions that do not have high number of parameters.
This technique has directed many researchers to use various meta-heuristic optimization algorithms such as grey wolf optimization (GWO) [
22], evolutionary algorithms (EA), etc.
Another research direction led by many researchers depends on coordinated control. In [
23] a coordinated controller for a microgrid based on a predictive model and voltage control is presented. The main advantage of this method is that it needs less effort in the tuning of the controller. Authors of [
24] also proposed a multi-layer coordinated control technique for the energy management of microgrids based on forecasting customer loading. Furthermore, another method of coordinated control is presented in [
25]. This method depends on bi-level stochastic modelling.
Most of papers mentioned in literature have suffered from drawbacks (particularly in the modelling of the system) that can be summarized in the following points [
11,
12,
15,
21,
22,
26,
27,
28,
29]:
Power losses are not taken into considered in some papers.
Battery charging and discharging intervals are not considered in some papers.
High computational complexity in some of the above indicated references.
In this paper, the Harris hawk optimization (HHO) is used in solving the EMS optimization problem in a grid connected microgrids. The algorithm is applied to a highly constrained objective function which takes into consideration many important constraints such as power balance, generation power capacities, spinning reserve and energy storage limits (including charging and discharging rates). The proposed algorithm shows an improved performance compared to other algorithms used previously in literature in terms of speed of convergence and minimization of cost of operation when compared head-to-head and applied to same test bench. The proposed HHO algorithm may form a good optimization technique for solving other optimization problems in the power and energy fields.
The rest of this paper is organized as follows:
Section 2 shows the problem formulation of the EMS optimization problem, while
Section 3 explains the HHO algorithm and its application to the proposed EMS optimization algorithm. In
Section 4 the results of applying the proposed EMS optimization algorithm to a real microgrid with two different operating scenarios are presented. In
Section 5 and
Section 6, respectively, the discussion and conclusion are presented for the evaluation of the effectiveness of the proposed EMS algorithm.
3. Proposed HHO-Based EMS
Harris hawk optimization is a metaheuristic optimization which was proposed in [
30], and its mathematical model is inspired from the cooperative behavior of Harris hawks in hunting, chasing and besieging their victims. The HHO is based on population optimization without having any gradients which gives it competitive edge over other techniques in terms of speed of conversion.
The HHO consists of two main phases: exploration and exploitation. Additionally, there is a transition phase though which the algorithm is switched from exploration to exploitation.
In the exploration phase, Harris hawks start to search randomly for victims as per the following equation:
where
is the location of the hawks in the iteration
,
is the location of the rabbit (the victim),
to
and
are random numbers that can vary between 0 and 1,
represents a hawk which is chosen randomly and
is the average location of the current population of hawks which can be calculated from Equation (12):
where
indicates the position of each hawk at iteration
t while
N represents the total number of hawks.
As mentioned above, after finishing the exploration stage, there is a transient stage before moving to the exploitation stage. At this transient stage, it is necessary to model the energy of the rabbit as per Equation (13):
where
E is the escaping energy of the rabbit,
T is the maximum number of iterations and
is the initial state of the rabbit energy. The value of
is varying between −1 and 1 based on the physical fitness of the victim. When
goes towards −1, this means that the victim is losing its energy and vice versa.
According to the behavior of rabbits, the relation between the rabbit energy and the time is inversely proportional. This means that as long as increases, the is decreased. Based on , Harris hawks also decide to either search different areas to detect the location of the rabbit when or move forward to the exploitation phase.
In the exploitation phase, there are two behaviors that need to be modelled. The first is the soft besiege in which the rabbit energy is still high and can run fast; in this condition Harris hawks try to softly follow and put it under surveillance until it starts to get exhausted. The second behavior is the hard besiege; the prey in this behavior is tired and has no sufficient energy to escape. As a result, the Harris hawks in this mode form closed circles to make a sudden attack.
Figure 2 shows Harris hawk attack patterns.
To mathematically model the two behaviors, let
be the percentage of the successful escape of the rabbit. If
and
, this means that the rabbit has relatively high escaping energy and at the same time the chance of successful escape is higher than 50%. This means that the Harris hawks will perform a soft besiege and will update their location according to Equation (14):
where
is the position difference between the rabbit and the hawks. This value can be calculated as follows:
where
is a random number that represents the jump strength that can be met from Equation (16) as follows:
where
is a random number that varies between 0 and 1.
If
and
, this means that the rabbit has high energy. However, the chance of successfully escaping is not big. In this case, the Harris hawks will perform a soft besiege but with progressive and rapid dives. The next movement of the hawks will be updated according to:
The hawks then will compare the current position with the previous dive to evaluate which is better. If the previous dive is better, the hawks will use it. If not, the hawks will then apply new dive using the levy flight (LF) equation:
where
D is the problem dimension and S is a random vector with size of 1 × D. The LF function can be calculated according to (19) as noted in [
31]:
where
u and
v are random numbers that vary between 0 and 1.
is a constant value of 1.5.
is calculated using:
The Harris hawks will then evaluate the positions
Y and
Z and then select the best position based on (21):
where only the better location of either
Y or
Z will be used to update the hawk’s position.
If
and
, this means that the rabbit has relatively low energy but it has a moderate chance of a successful escape. In this condition, the hawks will perform a hard besiege and will update their equation based on Equation (22):
If
and
, this means that the victim has low energy and also has a low chance to escape. In this situation, the hawks will also perform a hard besiege but with progressive rapid dives at which the next position of the hawks will be updated using Equation (21).
Z will be calculated from Equation (18) and
Y will be calculated using Equation (23) as follows:
The proposed EMS uses the HHO in evaluating the optimum values for generated powers from different DGs within the microgrid. The HHO in this optimization problem will consider the DG-generated powers as the location of the Harris hawks and the prey will represent the energy cost.
Figure 3 shows a flowchart of the proposed HHO algorithm while
Figure 4 shows a flowchart for the proposed EMS algorithm.