Enhancing Microgrid Production Through Particle Swarm Optimization and Genetic Algorithm

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

IAES International Journal of Artificial Intelligence (IJ-AI)

Vol. 13, No. 3, September 2024, pp. 3644~3656


ISSN: 2252-8938, DOI: 10.11591/ijai.v13.i3.pp3644-3656  3644

Enhancing microgrid production through particle swarm


optimization and genetic algorithm

Mohamed Benydir, Belkasem Imodane, M’hand Oubella, Mohamed Ajaamoum, Bouachrine Brahim,
Abdellah El idrissi, Najib Abekiri, Kaoutar Dahmane
Laboratory of Engineering Sciences and Energy Management (LASIME), Ibn Zohr University, School Nationa of Applied Sciences,
Agadir, Morocco

Article Info ABSTRACT


Article history: The growing demand for sustainable and efficient energy solutions has led to
research on optimizing renewable energy sources within microgrid systems.
Received Oct 8, 2023 This study presents a comparative analysis of two prominent optimization
Revised Jan 27, 2024 techniques, particle swarm optimization (PSO) and genetic algorithm (GA),
Accepted Feb 10, 2024 to enhance solar photovoltaic (PV) and wind production in microgrids. The
aim is to achieve a balanced and efficient energy generation that closely
matches the load demand, thereby minimizing energy wastage and ensuring a
Keywords: reliable energy supply. The two algorithms are employed using data
representing PV and wind production, as well as load consumption, over a 24-
Genetic hour period. The results are evaluated based on their ability to reduce the gap
Micro grid between energy production and load demand. Our findings reveal compelling
Optimization insights into the performance of GA and PSO in the context of microgrid
Particle swarm optimization. To validate the results obtained from the simulation, the PSO
Processor-in-the-loop algorithm is implemented on an actual cart digital signal processor (DSP)
Renewable energy platform, using a processor-in-the-loop (PIL). This successful real-world
application highlights the practical viability of utilizing PSO to improve solar
PV and wind energy generation within microgrids.
This is an open access article under the CC BY-SA license.

Corresponding Author:
Benydir Mohamed
Laboratory of Engineering Sciences and Energy Management (LASIME), Ibn Zohr University
School Nationa of Applied Sciences
Boîte Postale 32/S, Agadir 80000, Souss-Massa, Morocco
Email: [email protected]

1. INTRODUCTION
Microgrids are autonomous or partially autonomous electrical systems that deliver power to remote
locations, vital infrastructure, and isolated settlements that are not easily reachable by the main electrical grid.
They are made up of many energy sources, including batteries, wind turbines, backup generators, solar panels,
and backup generators. They also include energy management and control technology [1].
In order to address the energy needs of isolated towns and remote locations that are not covered by
the main electrical grid, microgrids have developed as a creative alternative. By facilitating the utilization of
renewable energy sources and lowering reliance on fossil fuels, they also provide a sustainable alternative to
conventional electrical grids [2]. Applications for microgrids include supplying electricity to remote
communities, running vital facilities like hospitals, airports, or data centers, delivering energy in emergency or
catastrophe scenarios, and lowering rural areas' energy expenses [3].
In this context, microgrids are gaining popularity in areas of the world with high energy prices, sparse
infrastructure, or unstable electrical networks. Thus, research into and development of new energy
technologies, as well as energy and environmental policy, should pay close attention to microgrids. Microgrids

Journal homepage: http://ijai.iaescore.com


Int J Artif Intell ISSN: 2252-8938  3645

have a number of benefits, such as improved electricity quality and dependability as well as lower energy costs
for remote areas. In the event of a power loss, microgrids can increase energy security by supplying backup
electricity [4]. Also, by lowering reliance on fossil fuels and greenhouse gas emissions, microgrids powered
by renewable energy sources can lower carbon footprints and aid in the battle against climate change.
Moreover, microgrids can promote economic growth by generating local jobs in the energy management,
maintenance, and production sectors [2]. By reducing reliance on fossil fuels and greenhouse gas emissions,
microgrids powered by renewable energy sources can also lessen their carbon footprint and aid in the battle
against climate change. By generating local jobs in the fields of energy production, maintenance, and
management, microgrids can also aid in economic development. To increase accessibility and the use of
microgrids more broadly, there are still obstacles to be solved. These difficulties include the high initial cost
of technology and equipment, the complexity of designing and managing microgrids, as well as potential
regulatory and governmental barriers to microgrid adoption [5]. There are ongoing attempts to enhance
microgrid design and management as well as to create new technologies that can lower costs and boost
efficiency in order to address these issues. Advanced energy management systems (EMS) and software
platforms, for instance, can help improve microgrid operation and lower energy waste [6]. Improvements are
being made to the incorporation of renewable energy sources into microgrids as well. This entails creating
technologies that can facilitate the integration of sporadic energy sources like wind and solar power, such as
energy storage systems and grid-forming inverters [1].
Kamal et al. [7] presents a mixed-integer linear programming (MILP) model for the simultaneous
optimization of energy and reserve management in an independent microgrid powered by renewable sources,
with a focus on minimizing costs while addressing energy production uncertainty. Similarly, Bhoi et al. [8]
employs a genetic algorithm (GA) to minimize overall costs and incorporates demand response in a microgrid
context. Elaouni et al. [9] leverages both GA and particle swarm optimization (PSO) to achieve an optimal
configuration for a grid-connected hybrid system, aiming to minimize costs. In the study outlined in [10], GA
and PSO techniques are utilized to optimize the sizing of renewable generation units in an isolated microgrid,
taking into account cost and peak demand constraints. Muzzammel et al. [11] demonstrates a diverse microgrid
model's efficient power flow using MATLAB Simulink and PSO, resulting in notable transmission loss
reduction during battery charging and discharging. A variety of techniques and tools are utilized to enhance
the performance of a microgrid that integrates both wind and solar power generation, as outlined in Table 1 as
evidenced by a recent literature review focused on optimization methods for microgrids.
This study presents a unique contribution to the field of microgrid optimization by focusing on the
efficient allocation of energy production from photovoltaic (PV) and wind sources to match load demand and
minimize energy wastage. Unlike previous works that primarily emphasize cost minimization, optimal sizing, and
power flow control, our research specifically addresses the critical issue of preventing unnecessary energy surplus.
By comparing the performance of PSO and GA, we highlight their effectiveness in achieving optimal energy
utilization. This work extends beyond traditional optimization approaches, providing insights into the most
suitable method for enhancing microgrid operation and renewable energy utilization while reducing wastefulness.

Table 1. A recent literature review on optimization techniques for microgrids


Renewable components Grid Optimization
Authors Battery Objectives Year Ref
PV WIND Diesel connected methods
Muzzammel et al. x x _ x ON power flow Newton–raphson 2023 [11]
and PSO
Bhoi et al. x x x x OFF cost of energy Evaporation rate 2023 [8]
water cycle
algorithm (ER-
WCA)
Teferra et al. x x _ _ OFF cost of energy Fuzzy-PSO 2023 [12]
Sayed et al. x _ _ _ OFF the sum square Teaching learning 2023 [13]
of error based optimization
(TLBO)
Fares et al. x x x OFF Sizing Flower pollination 2022 [14]
algorithm (FPA)
Emrani et al. x x OFF Gravity energy GA 2022 [15]
storage GES
Makhloufi et al. x x OFF cost of energy CUCKOO 2022 [16]
Maheri et al. x x x x OFF sizing GA, NSGA 2022 [17]
Mokhtara et al. x x x x OFF cost of energy PSO 2021 [18]
Hassan et al. x x ON-OFF cost of energy GA 2021 [19]
Das et al. x x x ON-OFF net present cost HOMER 2021 [20]
Hong et al. x ON Production Artificial bee 2021 [21]
efficiency colony algorithm
(ABC)

Enhancing microgrid production through particle swarm optimization and genetic … (Benydir Mohamed)
3646  ISSN: 2252-8938

This paper is structured as follows: an initial section presents the MATLAB Simulink model of PV
panels and wind turbines. Within the same section, we provide an overview of PSO and GA, along with their
applications in the proposed microgrid. The second section showcases simulation results for each algorithm,
followed by the implementation of the PSO algorithm on LaunchPad F28069M board using processor in the
loop (PIL) using MATLAB Simulink. The final section contains conclusions and perspectives.

2. METHOD
The proposed microgrid is designed to integrate solar PV and wind turbines as renewable energy
sources Figure 1. The microgrid aims to efficiently manage energy production and consumption within a
localized area, optimizing the utilization of both solar and wind power to meet the varying demands of a
connected load. This optimization process involves the implementation of advanced algorithms such as PSO
and GA.

BOOST
mesures
CONVERTER

PV arrays

Controller for
Optimzing energy

mesures INVERTER

Load
mesures BOOST
CONVERTER

Wind turbines

Bus DC

Figure 1. Microgrid proposed

2.1. Modeling of photovoltaic panels


The PV cell, often referred to as a solar cell, is a substantial surface diode or PN junction that interacts
with light, particularly photons. This interaction results in the creation of a potential difference through a
physical phenomenon known as the PV effect. To describe the characteristics of a PV cell, various
mathematical models have been created, as illustrated in Figure 2. These models vary in the number of
parameters and mathematical techniques used to compute the behavior of the PV module [22]. In (1) to (3) can
be used to represent the equivalent circuit.

G
Iph = [Isc + k i (T − Tn )] × 1000 (1)

T 3 q.Eg0 1 1
Id = Irs . ( ) exp⁡ [ ×( − )] (2)
Tn n.K Tn T

q
I = Iph − Id [exp (K.T.n × V) − 1] (3)

Where:
I: Output current (A)
V: Output voltage (V)
T: Cell temperature (K)
Tn : Nominal temperature (K)
G: Solar irradiation (W/m²)

Int J Artif Intell, Vol. 13, No. 3, September 2024: 3644-3656


Int J Artif Intell ISSN: 2252-8938  3647

Iph : Photo-current (A)


Id : PV saturation current (A)
Isc: Short circuit current (A)
K: Boltzmann’s constant (J/K)
q: Electron charge (C)
Eg0 : Band gap energy of the semi-conductor (eV)
n: The ideality factor of the diode
k i: Short-circuit temperature coefficient (A/K)

Rs Ipv

Iph Id Ir

Vpv Load
Vd Rp

Figure 2. PV panel model

Figure 3 illustrates the block diagram of the PV panel model with maximum power point tracking
implemented in MATLAB Simulink. The PV panel is characterized through a mathematical model based on
the five-parameter equivalent circuit model. This model comprises a current source, a diode, and a resistor,
collectively representing the physical characteristics of the panel. In our study, each PV panel boasts a power
rating of 300 Watts peak, and we've strategically employed a fleet of 50 panels. The maximum power point
tracking (MPPT) algorithm used in this model is the perturb and observe P and O algorithm. The MPPT block
calculates the optimal operating point of the panel and adjusts the duty cycle of the BOOST converter
accordingly.

Figure 3. Block diagram of the PV model in simulink

2.2. Modeling of wind turbine


Creating a wind turbine model using MATLAB Simulink requires the development of mathematical
descriptions for various components, such as the turbine, generator, and control electronics. These individual
representations are subsequently integrated to construct a comprehensive system model, enabling the
simulation of the turbine's performance. In our research, the examined wind turbine generates a significant 22
kilowatts of electrical power. In Figures 4 and 5, we visually illustrate the collaborative operation of these
components, demonstrating the process by which the wind turbine generates electricity.
The motion of the wind generates a rotational force on the drive shaft [23]. The wind possesses a
specific speed "𝑉" at a particular moment and moves through a designated region "𝑆," with "𝜌" representing
the air density. The wind turbine's aerodynamic power capture can be measured using the subsequent (4).

Enhancing microgrid production through particle swarm optimization and genetic … (Benydir Mohamed)
3648  ISSN: 2252-8938

1
Pcapture = 2 Cp (λ, β)ρπR2 V 3 (4)

Here, 𝑅 denotes the rotor radius of the wind turbine. C𝑝 (λ, β) signifies the power coefficient, reflecting
the wind turbine's aerodynamic effectiveness and its ability to convert wind kinetic energy into mechanical
power. C𝑝 is a non-linear function dependent on both the tip-speed ratio 𝜆 and the blade pitch angle 𝛽. The
tip-speed ratio is defined as (5):

θt
λ= R⁡ (5)
V

Here, θt represents the angular speed of the turbine shaft. The aerodynamic power can also be represented in
the following manner:

P𝑐𝑎𝑝𝑡𝑒𝑢𝑟 = θt . Ta (6)

Therefore, in accordance with the equations mentioned earlier (4)-(6), the aerodynamic torque Ta applied to
the wind turbine shaft can be alternatively formulated as (7).

1 Cp(λ,β)
Ta = 2 ρπR2 V 3 (7)
λ

DC/DC
PMSG Rectfier Converter

LOAD
PWM

Figure 4. Wind turbine model

Figure 5. Block diagram of wind turbine model in Simulink

2.3. Optimization algorithm


2.3.1. Genetic algorithm
The fundamental concept underlying the GA is inspired by the principles of biological evolution. GA
represents individuals as potential solutions to complex optimization problems, mimicking the natural process of
evolution to seek the most optimal solution for the given problem as in Figure 6. This objective is pursued by
introducing diversity and quality into its population through the mutation and combination of individuals across

Int J Artif Intell, Vol. 13, No. 3, September 2024: 3644-3656


Int J Artif Intell ISSN: 2252-8938  3649

multiple generations. These modifications aim to preserve traits that improve the adaptability of individuals to
their local environment, outperforming their counterparts. To assess this adaptability, used for individual selection
or elimination, their fitness value is calculated. This value measures how well they conform to predetermined
fitness functions and constraints Figure 6(a). This cycle of variation and selection is repeated across evolving
populations over successive generations until a stopping criterion as generation number is met [9].
This work involves a GA optimization approach to address the challenge of efficiently managing
renewable energy production in standalone microgrids. The goal is to determine the optimal distribution of
energy production from PV panels and wind turbin sources over a 24-hour period, aligning with the load
consumption demand while minimizing energy wastage. In this context, an individual signifies potential power
production profiles, encompassing combinations of PV and wind production for each hour. These distinct
profiles constitute the solutions that the GA endeavors to optimize. The population is comprised of a collection
of such individuals, denoting different energy distribution scenarios [22]. In this study, the key parameters for
the GA were configured as follows: a population size of 150 individuals, a maximum of 50 generations, a
crossover fraction of 0.8, and a mutation rate of 0.03. The optimization process began by generating an initial
population, wherein each individual represented a unique combination of PV and wind power production levels
for every hour. To quantify the fitness of each individual, a fitness function was established. This function
calculated the absolute differences between the total power generated by PV and wind sources and the
corresponding load demand for each hour of the day. Lower fitness values indicated a better alignment between
energy production and consumption.

2.3.2. Particle swarm optimization


PSO is a nature-inspired optimization algorithm applied to address intricate problems across diverse
domains. It emulates the coordinated behavior of particles within a search space with the goal of discovering the
most optimal solutions. In PSO, particles explore the space, adjusting their positions based on personal best-
known positions and the global best-known position among all particles [10]. This dynamic process helps particles
converge toward an optimal solution. The algorithm begins with random particle initialization and evaluates their
fitness. Each particle's position and velocity are updated iteratively, influenced by its personal and global best-
known positions. PSO's objective is to either minimize or maximize a problem-specific fitness function. The
algorithm continues for a specified number of iterations or until convergence criteria are met. PSO's simplicity,
adaptability, and ability to handle high-dimensional spaces make it a versatile optimization technique. Its
applications span various tasks, encompassing parameter tuning, feature selection, neural network training, and
more. Despite its straightforward nature, PSO's collective exploration and exploitation behavior often lead to
effective and efficient solutions for complex optimization problems. The PSO algorithm is defined by two main
equations. The initial equation pertains to the update of velocity, where each particle in the swarm modifies its
velocity by considering the computed values of the best solutions at both the individual and global levels, in
addition to its current position. The coefficients a1 and a 2 serve as acceleration factors, representing the influences
of individual and social aspects. These coefficients, known as trust parameters, play distinct roles. a1 reflects a
particle's self-confidence, determining how much it trusts its own experiences, while a 2 represents a particle's
confidence in its neighbors, influencing its trust in collective information. Together with the random values r1
and r2, these coefficients define the inherent stochastic effects arising from cognitive and social behaviors [23].

ϑi (t + 1) = ϑi (t) + a1 r1 (pbest ti − pti ) + a 2 r2 (gbest ti − pti ) (8)

The second equation is the position equation, where each particle updates its position using the newly
calculated velocity:

pt+1
i = pti + ϑt+1
i (9)

The parameters of position and velocity are co-dependent, the velocity depends on the position and vice-
versa [24]. Figure 6 illustrates the basic operational principles of two algorithms: Figure 6(a) shows GA and Figure
6(b) shows PSO. Figure 6(a) depicts GA's selection, crossover, and mutation processes for evolving solutions,
while Figure 6(b) shows how PSO updates particles' positions and velocities based on the best positions. In this
study, we employ PSO to enhance the efficiency of power production from PV and wind sources, aligning energy
generation with load demands in microgrid. By defining PSO parameters, including a swarm size of 150 and a
maximum of 50 iterations, we adjust the energy output for optimal utilization. Figure 7 shows a flowchart of GA
in Figure 7(a) and PSO in Figure 7(b), the algorithm of PSO begins with the initialization of particles, assigning
random positions and velocities within a search space. Each particle's fitness is evaluated using a predefined fitness
function. Subsequently, the algorithm updates the particles' velocities and positions based on their personal best
and the global best solutions found. This iterative process continues until a termination condition, such as a

Enhancing microgrid production through particle swarm optimization and genetic … (Benydir Mohamed)
3650  ISSN: 2252-8938

maximum number of iterations or a desired fitness level, is met. The velocity update incorporates factors like inertia,
personal cognitive influence, and social influence to guide particles toward optimal solutions.

(a) (b)

Figure 6. Basic operational principles of two algorithms: (a) major styps for GA and (b) moving particles in PSO

START START

k=1 k=1

Initial population Initial partical

Calculate the fitness function


FF(x)
Calculate the fitness function FF(x)

Selection

Crossover Update the velocity of each particale

Mutation
Update the velocity of each particale

New generation

NO
NO Stop
Stop condition k = k+1 condition
k = k+1
? ?
YES
YES

Optimal Solution Optimal Solution

END END

(a) (b)

Figure 7. Flowchart of (a) GA and (b) PSO

2.4. Fitness function


The fitness function employed in this study for both algorithms can be mathematically as (10). In
(10),⁡FF(x) denotes the fitnessscore of an individual solution x within the population. For each hour i from 1
to 24, Pgen,i represents the total power generated from the PV and Wind sources, while Pdem,i signifies the
corresponding power demand and 𝜔 can be a weight that reflects the importance of matching load consumption.
A higher weight places more emphasis on minimizing deviations. This fitness function used to evaluate the
quality of solutions generated by the two algorithms GA and PSO. It quantifies the mismatch between power
generated by PV and wind sources and the corresponding power demand over a 24-hour period. The fitness
score is calculated by summing the absolute differences between power generation and power demand for each
hour. Through iterative optimization, the two algorithms seek to minimize this fitness score, leading to energy
distribution profiles that efficiently match power generation with demand while minimizing surplus or deficit.

FF(x) = ∑24
i=1 ω|Pgen,i − Pdem,i | (10)

Int J Artif Intell, Vol. 13, No. 3, September 2024: 3644-3656


Int J Artif Intell ISSN: 2252-8938  3651

3. RESULTS AND DISCUSSION


This section offers a thorough analysis of the results derived from our GA-based optimization and
approaches. In Figure 8 we begin by presenting the profiles for PV production in Figure 8(a) and wind
production in Figure 8(b) over a 24-hour period. It is important to mention that the data utilized to create these
profiles are not real; they are only comparable to actual data. Figure 9 illustrates the combined energy production
from both PV panels and wind turbine sources in Figure 9(a), along with the load consumption profile over a
24-hour period in Figure 9(b). It is noteworthy that the total energy production often exceeds the load demand,
potentially resulting in a wasteful power surplus when the battery is fully charged during that specific hour.
Figure 10 examines source utilization in the microgrid, illustrating PV and wind turbine utilization percentages in
Figures 10(a) and 10(b) comparing source utilization before and after optimization with studied algorithms.
In Figure 10(a) depicts the utilization percentages of PV and wind power production. Throughout the
day, it is evident that wind power constitutes a significantly larger portion, accounting for 62.36%, compared to
PV's 37.64%. This difference can indicate an issue related to the balance and efficiency of renewable energy
sources in the energy system. Such a scenario may lead to the grid becoming overly reliant on wind energy,
potentially causing overproduction during windy periods and underproduction during periods of low wind. In
Figure 10(b), the effects of the optimization process are evident. Wind power now constitutes 50,6% of the
total energy generated, with solar panels contributing 49,4% in the case of GA. For PSO, 51,81% of the total
energy is generated from wind turbine, and 48,19% comes from solar panels. These results indicate that the
changes made have helped address the issue of relying too heavily on wind power. This correction is important
because it reduces the likelihood of producing excessive energy during windy periods and insufficient energy
during periods of low wind. These improvements highlight the importance of finding the right mix of energy
sources to maintain a stable and reliable energy system. The optimized approach of PSO and GA has effectively
bridged the gap between the power produced by renewable energy sources and the power required by the load.
This visual representation validates the success of the energy management strategy by ensuring that energy
generation closely aligns with consumption needs. As a result, energy is now being utilized more efficiently and
actively avoiding unnecessary waste.

(a) (b)

Figure 8. Profiles of (a) production PV and (b) WIND

(a) (b)

Figure 9. The combined energy production from (a) total production optimized by PSO and GA and (b) total
production and load demand

Enhancing microgrid production through particle swarm optimization and genetic … (Benydir Mohamed)
3652  ISSN: 2252-8938

(a) (b)

Figure 10. Percentage of (a) use for each source and (b) use for each source

To assess the convergence of each algorithm, a statistical analysis is carried out using the mean absolute
percentage error (MAPE) [25]. This can be calculated as the relative error, which is defined as the absolute
difference between the output power and the desired value, divided by the output power value, as illustrated in
the (11). The comparison results shown in Figure 11, between the mean error values for the GA and PSO provide
valuable insights into their respective performance. The mean error of 1.9729 for GA indicates the average
deviation between the optimized solutions and the desired outcomes. On the other hand, the mean error of 1.1888
for PSO represents a lower average deviation, suggesting that the PSO approach exhibits a relatively higher
accuracy in achieving optimal solutions.

1 Pgen−Pdem
MAPE = N ∑N
t=t0 | | × 100 (11)
Pgen

Figure 11. Mean error GA vs PSO

3.1. PIL test using digital signal processor board LaunchPad development kit LAUNCHXL-F28069M
To validate and evaluate the proposed algorithm, a similar testing method called PIL was used, this time
with the LaunchPad F28069M board. The PIL test involves developing specific code for the embedded 32-bit
microcontroller on the LaunchPad F28069M. This microcontroller possesses distinct features, including 256
Kbyte flash memory, a clock frequency of 90 MHz, a floating-point unit, digital signal processor (DSP)
instructions, and 96 Kbytes RAM. Throughout this validation process, a dedicated PIL block was integrated into
the control system. This block includes the customized code for the LaunchPad F28069M and seamlessly
interfaces with Simulink software.
The diagram in Figure 12 illustrates the integration of the PSO algorithm into the processor loop using
Matlab/Simulink. The steps to set up and conduct the PIL test using the LaunchPad F28069M board can be
understood similarly to the example studied. Only the PSO algorithm is showcased in this co-simulation, as it
demonstrates superior performance compared to the GA. Notably, it exhibits a higher level of accuracy in
attaining optimal solutions [26]. The main goal of using the PIL method in this study is to establish a direct
connection between computer simulations and real-world practical.

Int J Artif Intell, Vol. 13, No. 3, September 2024: 3644-3656


Int J Artif Intell ISSN: 2252-8938  3653

Decide on the
Access parameters Opt for PIL as the
hardware target hardware Generate C-code Create a PIL block
within Simulink implementation

Figure 12. The process for setting up a parameterized PIL test using the LaunchPad F28069M

Figure 13 shows the integration of the PSO algorithm onto a DSP platform through PIL testing including
a block diagram of the PIL setup in MATLAB Simulink at Figure 13(a) and PIL co-simulation test in
Figure 13(b). This study aims to validate the compatibility of simulation results with real-world scenarios. This
technique allows researchers to gauge how the algorithm performs, adjust its settings, and ensure it works
seamlessly in a near real-time setup. In essence, PIL acts as a link between computer-based simulations and
physical hardware, facilitating accurate assessment and refinement of the algorithm's performance for real-world
applications [27]. Furthermore, the PSO algorithm implemented on a DSP board using PIL. This implementation
involved setting up the algorithm to run in synchronization with the physical hardware, highlighting the concrete
advantages of using PSO to improve solar PV and wind power generation in micro grids.

(a)

(b)

Figure 13. The integration of (a) block diagramme of PIL in MATLAB Simulink and (b) PIL co-simulation test

Figure 14 displays results from numerical simulations, presenting performance metrics of the system in
Figure 14(a) the optimal total production achieved through PIL, and Figure 14(b) the fitness value obtained
through PIL testing. These results closely align with those from the PIL co-simulation test, thus validating the
effectiveness of the proposed algorithm. Consequently, the PIL co-simulation process is proven to be a valuable
tool for validating hardware implementations of different algorithmic strategies [27].

Enhancing microgrid production through particle swarm optimization and genetic … (Benydir Mohamed)
3654  ISSN: 2252-8938

(a) (b)

Figure 14 displays results from numerical simulations, presenting performance metrics of the system in
(a) the optimal total production achieved through PIL and (b) the fitness value obtained through PIL testing

4. CONCLUSION
In conclusion, this paper addresses the optimization of energy allocation in microgrids by using PV
panels and wind turbines to match load demands and minimize wastage, highlighting frequent power surpluses
and the need for optimization. By applying PSO and GA techniques, we successfully mitigated the disparity
between renewable energy production and load requirements, with PSO demonstrating higher accuracy. A
practical co-simulation PIL validation on the LaunchPad F28069M board confirmed the algorithms' efficacy
and cost-efficiency. Future research should integrate energy storage, explore advanced algorithms and machine
learning, utilize real-time data and forecasts, and evaluate economic and environmental impacts to enhance
microgrid management and sustainability.

REFERENCES
[1] A. Hirsch, Y. Parag, and J. Guerrero, “Microgrids: a review of technologies, key drivers, and outstanding issues,” Renewable and
Sustainable Energy Reviews, vol. 90, pp. 402–411, 2018, doi: 10.1016/j.rser.2018.03.040.
[2] W. Strielkowski, L. Civín, E. Tarkhanova, M. Tvaronavičienė, and Y. Petrenko, “Renewable energy in the sustainable development
of electrical power sector: a review,” Energies, vol. 14, no. 24, 2021, doi: 10.3390/en14248240.
[3] M. Shafiullah et al., “Review of recent developments in microgrid energy management strategies,” Sustainability, vol. 14, no. 22,
2022, doi: 10.3390/su142214794.
[4] A. Lagrange, M. D. S.-Martín, A. G.-Martínez, S. Bracco, and E. R.-Asensio, “Sustainable microgrids with energy storage as a
means to increase power resilience in critical facilities: an application to a hospital,” International Journal of Electrical Power and
Energy Systems, vol. 119, 2020, doi: 10.1016/j.ijepes.2020.105865.
[5] M. H. Bellido, L. P. Rosa, A. O. Pereira, D. M. Falcão, and S. K. Ribeiro, “Barriers, challenges and opportunities for microgrid
implementation: the case of federal University of Rio de Janeiro,” Journal of Cleaner Production, vol. 188, pp. 203–216, 2018, doi:
10.1016/j.jclepro.2018.03.012.
[6] Z. Ullah, S. Wang, G. Wu, M. Xiao, J. Lai, and M. R. Elkadeem, “Advanced energy management strategy for microgrid using real-
time monitoring interface,” Journal of Energy Storage, vol. 52, 2022, doi: 10.1016/j.est.2022.104814.
[7] M. M. Kamal, I. Ashraf, and E. Fernandez, “Planning and optimization of standalone microgrid with renewable resources and
energy storage,” Energy Storage, vol. 5, no. 1, 2023, doi: 10.1002/est2.395.
[8] S. K. Bhoi, K. Kasturi, and M. R. Nayak, “Optimisation of the operation of a microgrid with renewable energy sources and battery
storage,” e-Prime - Advances in Electrical Engineering, Electronics and Energy, vol. 4, 2023, doi: 10.1016/j.prime.2023.100159.
[9] H. Elaouni, H. Obeid, S. L. Masson, O. Foucault, and H. Gualous, “A comparative study for optimal sizing of a grid-connected
hybrid system using genetic algorithm, particle swarm optimization, and HOMER,” IECON Proceedings (Industrial Electronics
Conference), vol. 2021-October. IEEE, 2021, doi: 10.1109/IECON48115.2021.9589999.
[10] Q. Zhang, J. Ding, W. Shen, J. Ma, and G. Li, “Multiobjective particle swarm optimization for microgrids pareto optimization
dispatch,” Mathematical Problems in Engineering, vol. 2020, pp. 1–13, 2020, doi: 10.1155/2020/5695917.
[11] R. Muzzammel, R. Arshad, S. Bashir, U. Mushtaq, F. Durrani, and S. Noshin, “Comparative analysis of optimal power flow in
renewable energy sources based microgrids,” International Journal of Electrical and Computer Engineering, vol. 13, no. 2, pp.
1241–1259, 2023, doi: 10.11591/ijece.v13i2.pp1241-1259.
[12] D. M. Teferra, L. M. H. Ngoo, and G. N. Nyakoe, “Fuzzy-based prediction of solar PV and wind power generation for microgrid modeling
using particle swarm optimization,” Heliyon, vol. 9, no. 1, pp. e12802–e12802, Jan. 2023, doi: 10.1016/j.heliyon.2023.e12802.
[13] E. A. Sayed, M. A. Sameh, M. A. Attia, and A. O. Badr, “Enhancement of PV performance by using hybrid TLBO-EO
optimization,” Ain Shams Engineering Journal, vol. 14, no. 3, 2023, doi: 10.1016/j.asej.2022.101892.
[14] D. Fares, M. Fathi, and S. Mekhilef, “Performance evaluation of metaheuristic techniques for optimal sizing of a stand-alone hybrid
PV/wind/battery system,” Applied Energy, vol. 305, 2022, doi: 10.1016/j.apenergy.2021.117823.
[15] A. Emrani, A. Berrada, and M. Bakhouya, “Optimal sizing and deployment of gravity energy storage system in hybrid PV-wind
power plant,” Renewable Energy, vol. 183, pp. 12–27, 2022, doi: 10.1016/j.renene.2021.10.072.
[16] S. Makhloufi, S. Khennas, S. Bouchaib, and A. H. Arab, “Multi-objective cuckoo search algorithm for optimized pathways for 75%
renewable electricity mix by 2050 in Algeria,” Renewable Energy, vol. 185, pp. 1410–1424, 2022, doi: 10.1016/j.renene.2021.10.088.

Int J Artif Intell, Vol. 13, No. 3, September 2024: 3644-3656


Int J Artif Intell ISSN: 2252-8938  3655

[17] A. Maheri, I. Unsal, and O. Mahian, “Multiobjective optimisation of hybrid wind-PV-battery-fuel cell-electrolyser-diesel systems:
An integrated configuration-size formulation approach,” Energy, vol. 241, 2022, doi: 10.1016/j.energy.2021.122825.
[18] C. Mokhtara, B. Negrou, N. Settou, B. Settou, and M. M. Samy, “Design optimization of off-grid hybrid renewable energy systems
considering the effects of building energy performance and climate change: case study of Algeria,” Energy, vol. 219, 2021, doi:
10.1016/j.energy.2020.119605.
[19] A. Hassan, Y. M. Al-Abdeli, M. Masek, and O. Bass, “Optimal sizing and energy scheduling of grid-supplemented solar PV systems with
battery storage: sensitivity of reliability and financial constraints,” Energy, vol. 238, 2022, doi: 10.1016/j.energy.2021.121780.
[20] B. K. Das, M. A. Alotaibi, P. Das, M. S. Islam, S. K. Das, and M. A. Hossain, “Feasibility and techno-economic analysis of stand-
alone and grid-connected PV/wind/diesel/batt hybrid energy system: a case study,” Energy Strategy Reviews, vol. 37, 2021, doi:
10.1016/j.esr.2021.100673.
[21] Z. Hong, Z. Wei, and X. Han, “Optimization scheduling control strategy of wind-hydrogen system considering hydrogen production
efficiency,” Journal of Energy Storage, vol. 47, 2022, doi: 10.1016/j.est.2021.103609.
[22] K. Gao, T. Wang, C. Han, J. Xie, Y. Ma, and R. Peng, “A review of optimization of microgrid operation,” Energies, vol. 14, no.
10, 2021, doi: 10.3390/en14102842.
[23] S. Phommixay, M. L. Doumbia, and D. Lupien St-Pierre, “Review on the cost optimization of microgrids via particle swarm
optimization,” International Journal of Energy and Environmental Engineering, vol. 11, no. 1, pp. 73–89, 2020, doi: 10.1007/s40095-
019-00332-1.
[24] T. Çarkıt and M. Alçı, “Comparison of the performances of heuristic optimization algorithms PSO, ABC and GA for parameter estimation
in the discharge processes of Li-NMC battery,” Journal of Energy Systems, vol. 6, no. 3, pp. 387–400, 2022, doi: 10.30521/jes.1094106.
[25] M. Benydir, M. Oubella, S. Mouslim, M. Ajaamoum, K. Dahmane, and B. Imoudane, “Implementation and analysis of a fuzzy logic
and sliding mode controller on a boost DC/DC converter,” International Journal of Renewable Energy Research, vol. 13, no. 1, pp.
294–301, 2023, doi: 10.20508/ijrer.v13i1.13862.g8683.
[26] S. M. Esmaeilzadeh and M. Shahrezaei, “Evaluation of attitude determination algorithms via model-in-the-loop and processor-in-
the-loop,” Journal of Aerospace Engineering, vol. 36, no. 3, 2023, doi: 10.1061/jaeeez.aseng-4183.
[27] M. Errouha, Q. Combe, S. Motahhir, S. S. Askar, and M. Abouhawwash, “Design and processor in the loop implementation of an
improved control for IM driven solar PV fed water pumping system,” Scientific Reports, vol. 12, no. 1, Mar. 2022, doi:
10.1038/s41598-022-08252-7.

BIOGRAPHIES OF AUTHORS

Mohamed Benydir is Ph.D. candidate and substitute teacher specializing in


Electrical Engineering at the High School of Technologies in Agadir (EST Agadir),
originates from Agadir, Morocco. His research, integral to his national doctoral thesis, is
primarily focused on renewable energy, engineering science, and energy management. For
correspondence. He can be contacted at email: [email protected].

Belkasem Imodane is Ph.D. student in Electrical Engineering at the University


of Ibn Zohr, Agadir. He graduated as an Embedded Systems Engineer in 2021 from the
National School of Applied Sciences, Agadir, Morocco. Subsequently, he joined the research
group at the Engineering Sciences and Energy Management Laboratory, University of Ibn
Zohr, Agadir, Morocco. His research focuses on renewable energies for his doctoral thesis.
He can be contacted at email: [email protected].

M’hand Oubella holds the position of professor in higher education at the High
School of Technologies of Agadir (ESTA), Ibn Zohr University, Agadir, Morocco. He
obtained his Ph.D. in Energetic and Process Engineering from the National School of Applied
Sciences (ENSA) of Agadir in 2014. Currently, he is a member of the Laboratory of
Engineering Sciences and Energy Management (LASIME) at the High School of
Technologies of Agadir (ESTA), and his research focuses on intelligent systems and energy
management, with a particular emphasis on renewable energies. This research is conducted
within the framework of the research team known as Intelligent Systems and Energy
Management (ERSIME). He can be contacted at email: [email protected].

Enhancing microgrid production through particle swarm optimization and genetic … (Benydir Mohamed)
3656  ISSN: 2252-8938

Mohamed Ajaamoum is professor Ph.D. at the Department of Electrical


Engineering, High School of Technology of Agadir, Ibn Zohr University, Agadir, Morocco.
His research interests are in photovoltaic systems, fuzzy control, neural network, renewable
energy technologies, system modeling, and power electronics. He can be contacted at email:
[email protected].

Bouachrine Brahim is professor Ph.D. at the Department of Electrical and


Energy Engineering, High School of Technologies of Guelmim (ESTG), ibn Zohr university,
Morocco. His research interests are in renewable energy: photovoltaic and wind energy
systems, photovoltaic emulator, hybrid MPPT control, system modeling, and power
electronics. He can be contacted at email: [email protected].

Abdellah El idrissi is Ph.D. student, was born in Errachidia, Morocco. His


research in the context of national doctoral thesis, focuses on the thematic of renewable
energies. He can be contacted at email: [email protected].

Najib Abekiri is Ph.D. student, was born in Agadir, Morocco. His research, as
part of his national doctoral thesis, focuses on the theme of remote and hybrid experimental
methods and pedagogical innovation in higher education. He can be contacted at email:
[email protected].

Kaoutar Dahmane is a Ph.D. student in engineering sciences at the Ibn Zohr


University (UIZ) of Agadir. She is originally from Ouarzazate, Morocco. As a researcher
student, she addresses key questions in relation to power system and renewable energy. The
main aim of her doctoral thesis is to perform power quantity and quality controls in grid-
connected renewable energy systems. She can be contacted at email:
[email protected].

Int J Artif Intell, Vol. 13, No. 3, September 2024: 3644-3656

You might also like