1. Introduction
The advent of microgrids represents a monumental paradigm shift in our approach to energy systems, marking a departure from the traditional centralized grid infrastructure that has long dominated the energy landscape [
1].
Microgrids, as decentralized networks of energy generation and distribution, have emerged as a disruptive force, redefining how the very foundation of energy systems should be considered. These localized, self-sustaining grids are revolutionizing the way we generate, store, and distribute energy, challenging the status quo of large-scale, centralized power plants and transmission lines. At their core, microgrids encompass a diverse portfolio of energy resources, including distributed generators, advanced storage mechanisms, and an increasing reliance on renewable energy sources [
2].
Figure 1 illustrates the intricate web of interconnected components that make up a modern microgrid. What distinguishes microgrids from their predecessors is not only their physical composition but also their overarching goals: enhancing energy reliability, fostering sustainability, and bolstering economic viability [
3]. These objectives have driven the exponential rise of microgrids in prominence as they offer innovative solutions to the pressing challenges of our time, including the inherent unpredictability of renewable energy sources, the fluctuating demands of energy consumers, the volatility of energy markets, and the capriciousness of renewable energy outputs [
4,
5].
To meet these multifaceted challenges head-on, there is an urgent and growing need for optimization techniques that are both adaptive and robust. Consequently, this burgeoning demand has spurred extensive research into innovative optimization algorithms tailored to capture the complex dynamics of modern microgrids. In this context, nature-inspired algorithms have emerged as frontrunners, drawing inspiration from the adaptive strategies found in the natural world [
1,
6,
7,
8].
Historically, the energy sector has employed a plethora of metaheuristic-based optimization techniques to navigate the operational complexities of microgrids. Among them, Particle Swarm Optimization (PSO) has been a popular choice, drawing inspiration from the flocking behavior of birds. Its popularity in solving the CMOS optimization problem is attributed to its simplicity and effectiveness [
1].
The Modified Porcellio Scaber Algorithm (MPSA) stands out as one of the well-known techniques employed in the literature for solving the CMOS optimization problem, surpassing the performance of the PSO technique [
9].
The Harris Hawk Optimization (HHO) algorithm simulates the hunting behavior of Harris hawks, exhibiting superior performance when applied to optimizing microgrid operational costs under various scenarios simulated in MATLAB. HHO is compared to algorithms such as fast surrogate-assisted PSO and modified PSO, consistently demonstrating superior performance [
10].
Shuffled Frog Leaping (SFL), a population-based algorithm inspired by the foraging behavior of frogs, is proposed in a modified form for day-ahead microgrid scheduling with the objective of minimizing operating costs. Extensive comparisons with other techniques in three case studies confirm its superiority [
11].
Invasive Weed Optimization (IWO) draws inspiration from the fascinating biological phenomenon of weed invasion. It is employed for optimizing the placement of wind farm turbines to maximize power generation while minimizing costs. Comparative assessments show the efficiency of IWO in solving such problems [
12].
The Water Cycle Algorithm (WCA) mirrors the flow of rivers and streams to the sea. Applied to minimize the dispatching cost of a microgrid, WCA outperforms Genetic Algorithms (GA) and Interior/Differential Search Algorithms in terms of performance, convergence speed, and precision [
13].
The Multi-Verse Optimizer (MVO) mimics three cosmological hypotheses, including white, black, and wormholes, and is presented here as a multi-objective version to optimize the renewable factor, electricity cost, and power losses in a microgrid. MVO demonstrates superiority over PSO in these aspects [
14].
Tabu Search (TS), named after the tabu lists that record search history to prevent revisiting the same points, is employed for a CMOS-based approach to overcome certain deficiencies in CMOS, such as the billing process [
15].
Despite the advances made by these traditional optimization techniques, challenges remain in effectively managing the complex and dynamic nature of microgrids, particularly when dealing with the unpredictability and variability of renewable energy sources. There is a need for an innovative optimization algorithm that can adapt to these conditions, providing robust and efficient solutions. This need forms the core motivation for the development of the Egyptian Stray Dog Optimization (ESDO) algorithm. Inspired by the survival strategies of stray dogs, known for their resilience and adaptability in harsh environments, the ESDO algorithm aims to navigate the intricate solution spaces of microgrid operations more effectively than existing methods.
In this paper, a novel optimization technique, Egyptian Stray Dog Optimization (ESDO), is introduced, inspired by the behavioral traits of Egyptian stray dogs. As they are well-known for their tenacity and adaptability in Egypt’s challenging terrains, these dogs serve as a unique source of inspiration for optimization. By emulating their exploration, communication, and survival instincts, the ESDO technique promises to navigate the intricate solution spaces of microgrid operations with finesse, identifying optimal or near-optimal solutions.
In the following sections of this paper, we examine the inner workings of ESDO, explore its applicability in the realm of microgrid optimization, and conduct a comprehensive comparison with the well-established PSO algorithm. Through this discourse, the aim is to underscore the transformative potential of ESDO in reshaping the future of microgrid operations.
2. Problem Definition of The Cost Management and Operation System of Microgrids
The Cost Management and Operation System (CMOS) is tailored to optimize the microgrid’s operation by fine-tuning the generation metrics of various Distributed Energy Resources (DERs) and the utility grid. The primary objective revolves around minimizing operational expenses, which encompasses both the intrinsic generation costs of energy and the dynamic market prices during power exchanges with the primary grid [
16].
2.1. The Objective Function of CMOS
The primary task is to ascertain the minimum operational cost over a defined temporal horizon, typically spanning a 24-h duration [
16]. Mathematically, the cost function
can be represented as:
where:
denotes the active power produced by the DER at time .
illustrates the power interchange with the grid at time .
is the intrinsic cost of active power generation for the DER.
signifies the market price for power at time .
is the total number of hours.
is the total number of distributed generation units.
2.2. Formulation of Constraints
The first constraint is the power balance in which the total power, as generated by all DERs in conjunction with the grid, should equate to the overall power consumed across all loads [
17]. This can be mathematically captured as:
where:
is the load power of the load at time .
is the number of load levels.
The second constraint is the limits of the capacities of both distributed generation and grid. Regarding this constraint, The generation metrics for each DER, along with the grid, should be encapsulated within predefined limits:
where:
the minimum output power of generator .
the maximum output power of generator .
the minimum output power of the grid.
the minimum output power of the grid.
The third constraint is the reserve which is used to bolster system reliability. In this constraint, it is imperative to retain a fraction of the total generation capacity as a spinning reserve [
18,
19]. This is especially critical given the sporadic nature of some renewable sources:
where:
is the power reserve at time .
The fourth and final constraint is related to energy storage elements, particularly batteries. These devices have inherent constraints associated with their charge and discharge cycles. Specifically, the duration or time interval required for each cycle is a critical consideration. The energy content or state-of-charge (SOC) of a battery at any given time is influenced by its previous SOC, the charging efficiency and rate, the discharging efficiency and rate, and the time duration for which these processes occur [
20]. Mathematically, the SOC at time
can be represented as:
where:
is the battery SOC at time .
is the battery SOC at time .
is the efficiency during charging process.
is the efficiency during discharging process.
represents the permissible charging rate.
is the permissible discharging rate.
2.3. Cost of Computation for DERs
For DERs, specifically fuel cells and microturbines, the bid price is determined based on their operational efficiency, fuel expenses, and capital investment [
21,
22,
23,
24]. This can be formulated as:
where:
is the cost (in euro) for each kW-hour.
is the efficiency of the DER unit.
is the payback amount of the preliminary investment in euros.
is the periodic investment that is paid annually in euros.
is nominal power of the DER units in kW.
is the annual yield of energy in kW-hour/kW.
is the interest rate.
is the depreciation period in years.
is the installation cost in euros.
3. Egyptian Stray Dog Optimization
The Egyptian Stray Dog Optimization (ESDO) algorithm takes its inspiration from the various behaviors exhibited by stray dogs in their natural habitats. Unlike domesticated dogs, stray dogs need to constantly adapt to changing environments, rely on opportunistic food sources, establish territories, and interact within intricate social hierarchies. Drawing parallels between these behaviors and optimization problems, ESDO presents a novel approach to locate optimal solutions in complex search spaces.
3.1. Conceptual Overview
Since the ESDO is inspired from the life of the Egyptian stray dogs, it consists of six main behaviors: territorial, playful, defensive, social hierarchy adjustment, sleep/rest and scavenging as shown in
Figure 2 [
25].
In territorial behavior, every dog has a defined territory where it predominantly searches for food. This territory is not just a physical space but also represents a specific zone in the solution space where the dog (or the agent) focuses its search [
26].
While dogs are territorial, their playful nature occasionally drives them to explore areas outside their designated territories. This behavior is referred to as the playful behavior and is essential for ensuring that the algorithm does not become stuck in local optima [
27].
When a dog locates a food source, it becomes protective, defending the source against potential threats. This behavior is considered the defensive behavior. In the context of ESDO, once a potential solution is identified, the algorithm becomes “defensive” of it, refining its search in the vicinity of this promising solution [
26].
One of the main behaviors of the Egyptian stray dogs is the social hierarchy adjustment. This is simply because of the occurrence of a clear social hierarchy within a pack with alpha and beta dogs leading the pack. These leading members influence the actions of other dogs, guiding them towards potential food sources [
26].
The resting/sleep behavior resembles dogs that need rest. Periodically, some dogs will sleep, pausing their search. This simulates annealing, preventing premature convergence and allowing for occasional breaks in the search process [
26].
Since dogs are opportunistic scavengers, they always refine their search based on earlier successes, focusing more on areas where food was previously found. This behavior is called the scavenging behavior [
28].
3.2. Mathematical Modelling
Given an optimization problem, the solution space is denoted with bounds . The number of dogs (agents) in the pack is represented by .
Each dog
is initialized within a specific territory. The position within this territory is given by:
The energy or the objective function value for each dog is then computed keeping into consideration the lower and upper bounds for each dog .
For each iteration and each dog
, a new position is explored within its territory:
It is important to mention that the new position considers the global lower and upper bounds .
During the playful behavior, a dog
explores a new position. Most of the time, this exploration is within its own territory, but occasionally, it may jump outside its territory to explore other parts of the solution space. This is mathematically represented as follows:
The part represents the dog exploring within its own territory. The new position is a random jump from its initial position, but within the size of its territory. The second equation represents the occasional jump outside its territory. The new position is somewhere between the global bounds but restricted to a half jump. The factor of 0.5 in the second equation is a dampening factor, ensuring that when the dog jumps outside its territory, it does not jump too far. This value can be adjusted based on the desired exploration behavior.
If the newly explored position yields a better solution (lower energy), the dog updates its best-known position:
Based on the energy values, the pack applies the concept of social hierarchy by identifying the alpha (best) and beta (second best) dogs. Other dogs tend to adjust their positions based on these leaders:
At pre-defined intervals or iterations, a subset of the dogs rest, ensuring that their positions remain unchanged for that iteration. However, if a dog’s current energy is significantly higher than the alpha dog’s energy, it might adjust its position closer to the alpha dog according to (6):
The algorithm iterates through these behaviors until a stopping criterion is met. This criterion could be a maximum number of iterations, a minimum change in energy values, or any other problem-specific condition.
Figure 3 and
Figure 4 show the pseudo-code and flowchart of the proposed ESDO algorithm.
The suggested CMOS employs the ESDO to determine the ideal power outputs from various DERs within the microgrid. In this optimization approach, the power generated by the DERs is likened to the positions of the dogs, and their associated energy symbolizes the energy cost’s objective function.
Figure 5 illustrates a flowchart of the proposed CMOS algorithm.
4. Simulation Results
To evaluate the proposed algorithm’s effectiveness, a microgrid simulation is conducted in MATLAB. The output power for the microgrid’s Distributed Generation (DG) units and its connection to the main power grid are managed by the newly developed CMOS, which is based on the ESDO technique.
To evaluate the proposed algorithm’s effectiveness, a microgrid simulation is conducted in MATLAB. The output power for the microgrid’s Distributed Generation (DG) units and its connection to the main power grid are managed by the newly developed CMOS, which is based on the ESDO technique.
While the initial results are promising and indicate that the ESDO algorithm performs well under the specific scenarios tested, it is important to acknowledge the limitations of the study. The testing environment is simplified. Therefore, these results should be seen as preliminary, and further testing in more diverse and complex scenarios is necessary to draw broader conclusions about the ESDO algorithm’s performance.
The results from all scenarios suggest that the ESDO algorithm operates effectively under different operating modes of the CMOS. However, these findings should be considered with caution and validated through additional studies with varied microgrid configurations and operating conditions. The convergence curves demonstrated the proposed method’s efficiency, but more extensive testing is required to establish its general applicability.
As shown in
Figure 6, the microgrid in the simulation includes various elements such as Photovoltaic (PV) panels, Wind Turbines (WT), Diesel Electric Generators (DEG), Fuel Cells (FC), battery storage, and a utility grid connection. This system was selected because it has been previously established as a benchmark in research studies [
29,
30], and its simulation in this study allows for a direct comparison with results found in the existing literature.
Table 1 lists the minimum and maximum power output capabilities for each microgrid component, along with the coefficients for their bidding functions, where a negative sign signifies the direction of power flow.
Table 2 provides predicted values for the load demand and the power outputs from the DG units, as well as the market price. The study includes simulations of two case scenarios to evaluate the CMOS’s performance, which is based on the ESDO, across various operating conditions. All costs are presented in euro cents (€ ct).
4.1. Case Scenario 1
In this scenario, PV and WT units are set to produce at their maximum forecasted output for each hour. The designed CMOS adjusts the output of the remaining DG units to minimize production costs while adhering to their respective power constraints and limitations. The outcomes from the implemented algorithm are recorded in
Table 3. Analysis of the CMOS performance in the initial and final eight-hour segments of the day reveals that it primarily relies on FCs and the main utility grid for power generation during these times. This reliance is due to lower energy prices in these periods, making it more cost-effective to draw power from the grid than to operate DEGs. Conversely, during midday, when utility grid energy prices peak, the CMOS predominantly utilizes PV, WT, and DEG units for electricity production.
4.2. Case Scenario 2
In this scenario, CMOS regulates the output of all DER units, such as PV and WT, while adhering to their established constraints and power capacities. The findings for this case, presented in
Table 4, indicate a substantial decrease in the overall energy costs in comparison to those from case 1. This reduction is attributed to the CMOS’s comprehensive management of the DG units with the specific objective of lowering total costs. Consequently, this results in an increased reliance on the utility grid when the energy prices are at their lowest.
4.3. Case Scenario 3
In this particular scenario, the utility is expected to function without constraints, engaging in unrestrained energy exchange with the microgrid, unlike the remaining DERs which operate as defined in Scenario 2. The findings from this setup indicate that during off-peak hours specifically from 1 to 8 am, at 7 pm, and from 11 pm to midnight when the market prices dip, the utility predominantly caters to the microgrid’s energy demands. Conversely, it capitalizes on peak hours to procure excess energy from the microgrid. Economically speaking, Photovoltaic (PV) systems and Wind Turbines (WT) are activated to compensate for any power generation deficits within the microgrid or to bolster energy exports to the utility. Similarly, other DERs, including Fuel Cells (FC), Microturbines (MT), and batteries, dynamically adjust their output targets to match the hourly fluctuations in load demand, ensuring an economically optimized operation.
Table 5 shows the results of case scenario 3.
The results from the three scenarios confirm that the ESDO algorithm operates effectively under different operating modes of the CMOS.
Figure 7, which presents a sample convergence curve for the ESDO algorithm, clearly highlights the efficiency of the proposed method, as it exhibits a swift rate of convergence in each case.
4.4. Statistical Analysis Using F-Statistic
In this section, a detailed statistical analysis of the three case scenarios is conducted using the F-statistic from Analysis Of Variance (ANOVA) to determine if there are significant differences in the various parameters over time. The parameters analyzed include photovoltaic, wind turbine, diesel generator, fuel cell, battery and the grid. The analysis is performed separately for each case scenario.
The F-statistic is used in ANOVA to compare the variances between different groups. In this context, the F-statistic helps determine whether the differences observed in the parameters across different time periods are statistically significant [
31].
The first step to evaluate the F-statistic is to calculate the total Sum of Squares (SST) as per (18):
where:
is each observation.
is the overall mean of data.
is the total number of observations.
Following this step, it is mandatory to compute the Between-Group Sum of Squares (SSB) as per (19):
where:
is the mean of the group .
is the number of observations in group .
Then the within group sum of squares (SSW) is calculated:
where
is each individual observation in group
.
The values of the SSB and SSW are then inputted to (21) and (22), respectively, to calculate the mean square between groups (MSB) and mean square within the group (MSW):
Finally, the F-statistic can be computed as per (23):
Based on the previous equations, the F-statistic parameter has been calculated for all parameters in the three case scenarios as per
Table 6.
The statistical analysis using the F-statistic across the three case scenarios reveals that the photovoltaic, wind turbine, fuel cell parameters show significant variations over time which seems logical as these resources are very cheap compared to other resources. These findings underscore the importance of optimizing these parameters to enhance the overall efficiency and cost-effectiveness of the CMOS. The consistent results across different scenarios validate the robustness of the ESDO algorithm in managing diverse operating conditions.
The results from all scenarios confirm that the ESDO algorithm operates effectively under different operating modes of the CMOS. The convergence curves clearly highlighted the efficiency of the proposed method, as it exhibits a swift rate of convergence in each case. To ensure the credibility of the findings, it is essential to benchmark the performance of the ESDO algorithm against previous studies that have used the identical microgrid simulation model but opted for different optimization methods, such as Fast Surrogate-Assisted Particle Swarm Optimization (FSAPSO) and a range of enhanced PSO algorithms as noted in [
29].
Table 7 contrasts the performance of the ESDO algorithm with the results from these earlier proposed algorithms in the literature. It includes the Number of Objective Function Evaluations (OFE), which is determined by the product of the number of agents and the iterations until the best solution is found. The table also records the number of iterations and the count of trials required to achieve the best solution. Although information is scant in [
29], it is evident that the ESDO algorithm has attained lower operational costs more effectively.
In addition, a comparison was also made with the newly developed Hippopotamus Optimization Algorithm (HO) for case 1. The results indicate that the ESDO algorithm achieved superior performance, providing the best results in this comparison.