Advanced Energy Management Strategy of Photovoltaic/PEMFC/Lithium-Ion Batteries/Supercapacitors Hybrid Renewable Power System Using White Shark Optimizer

The slow dynamic response of a proton exchange membrane fuel cell (PEMFC) to high load change during deficit periods must be considered. Therefore, integrating the hybrid system with energy storage devices like battery storage and/or a supercapacitor is necessary. To reduce the consumed hydrogen, an energy management strategy (EMS) based on the white shark optimizer (WSO) for photovoltaic/PEMFC/lithium-ion batteries/supercapacitors microgrid has been developed. The EMSs distribute the load demand among the photovoltaic, PEMFC, lithium-ion batteries, and supercapacitors. The design of EMSs must be such that it minimizes the use of hydrogen while simultaneously ensuring that each energy source performs inside its own parameters. The recommended EMS-based-WSO was evaluated in regard to other EMSs regarding hydrogen fuel consumption and effectiveness. The considered EMSs are state machine control strategy (SMCS), classical external energy maximization strategy (EEMS), and optimized EEMS-based particle swarm optimization (PSO). Thanks to the proposed EEMS-based WSO, hydrogen utilization has been reduced by 34.17%, 29.47%, and 2.1%, respectively, compared with SMCS, EEMS, and PSO. In addition, the efficiency increased by 6.05%, 9.5%, and 0.33%, respectively, compared with SMCS, EEMS, and PSO.


Introduction
Microgrids offer a potential solution for integrating small-scale renewable energy sources and loads along with energy storage systems and other non-renewable sources [1]. Many issues, including finance and cost concerns, are debated in multiple international seminars and meetings. The main topics of these seminars are innovative efforts and funding feasibility. The development of several wireless and IoT technologies improved the performance of microgrids [2,3]. Manufacturers today are also using microgrids' capabilities, mainly to lessen their dependency on long-distance distribution lines and, consequently, to cut down on transmission losses [4]. The main benefits and challenges of the microgrid are reported in Table 1. Challenges Reliability High levels of intermittent generation due to the penetration of renewables and random loads.

Scheduling
Uncertainty of demand and supply.
Bidirectional power flow New equipment and protocols are required to consider the bidirectional power flows.

Control
Development and design of control strategies to account for the growth of DGs with power electronics interfaces.

Grid connection
Resolve grid connection issues such as synchronization.
A microgrid can be customized to meet each customer's individual needs by mixing various components, offering the best technical and financial options [5]. These systems meet energy demands for electrical and/or thermal energy typically supplied by the natural gas or electric utility company. Microgrid components can sometimes be found in the following list [6]:

•
Distributed energy resources (DERs): include traditional generators like Gensets or natural gas generators that mechanically transform fuel into electricity and heat, as well as renewable energy technologies, including solar and wind power, which operate on natural renewable resources. • Energy storage systems (ESSs): electrochemical (batteries), mechanical (flywheels), and thermal (hot water) systems are examples of systems. This energy can originate from renewable overproduction or be charged when energy is cheaper for peak periods. • Loads: the user loads can be classified as industrial, residential, commercial, and electric vehicles (EVs). In addition, the loads can be classified according to their nature as crucial and non-crucial loads or controllable and non-controllable loads. • Monitoring and Control systems: monitoring systems are required in data acquisition and transmission, whereas intelligent controls are implemented to improve electrical efficiency and cost performance by automatically directing supply to the most efficient available source.
Modularity, scalability, energy management, and resource balancing are essential characteristics of a successful microgrid. The DERs can deliver high performance regardless of the site's conditions using a proper energy management strategy, whether off-grid or on-grid [7].
PEMFC transforms chemical reactions to DC power. It earned great consideration thanks to its simple size, quietness, and fewer effects on the atmosphere. Several applications, such as trains, aircraft, and electric vehicles, have used PEMFC in recent years [8].
However, the PEMFC has restrictions on insufficient power density and postponed dynamic response. Therefore, the installation of either battery storage (BSs) or supercapacitors (SCs) to build a hybrid system may improve system performance [9,10]. It is critical to have an energy-management plan into a hybrid-based system that combines storage systems as well as photovoltaic (PV) and wind turbines are examples of sources of clean energy (WT) and PEMFCs (EMSs) [10]. The remaining energy here between diverse sources is controlled by the EMSs. Plus, they facilitate proper production and lengthen the authentication system.
In the literature, the EMS can be classified into three major categories: rule-based, artificial intelligence, and optimization-based strategies [11,12]. Rule-based strategies can be classified into two subcategories: deterministic and Boolean logic strategies. Furthermore, artificial intelligence can be classified into three subcategories: fuzzy logic, neural network, and Machin learning strategies. Finally, optimization-based strategies, which aim to minimize/maximize the objective function. The objective function might include emissions, costs, energy savings, device deterioration, and global efficiency [13]. There are two subcategories for optimization-based strategies: online and offline. The offline optimization, including dynamic programming (DP) [14,15], nonlinear programming (NLD) [16], stochastic dynamic control strategy (SDP) [17], and genetic algorithm (GA) [18], are the most widely utilized to manage the power flow in the DCMG. The existence of all load profiles is required. Hence, a large amount of data is involved. This makes their implementation extremely difficult. Whereas in the online optimization, the objective function depends only on the actual states of the system [19]. They have more restricted processing and higher real-time performance. The SoC of the storage devices is taken into account, but global optimization is not possible. The equivalent consumption minimization strategy (ECMS), model predictive control (MPC) [20], and the external energy maximization strategy (EEMS) are examples of these techniques.
The main contribution of this work is proposing, for the first time, an efficient EMS based on white shark optimizer (WSO) for photovoltaic/PEMFC/lithium-ion batteries/supercapacitors (PV/PEMFC/BSs/SCs) microgrid. The two critical aspects are minimizing hydrogen consumption and improving the hybrids' system performance. To prove the superiority of the proposed strategy, three EMSs are considered: state machine control strategy (SMCS), classical methodology for maximizing external power supply (EEMS), and optimized EEMS-based particle swarm optimization (PSO).
The description of the different components of the hybrid PV/PEMFC/BSs/SCs system is presented in Section 2. Section 3 explains considered energy management strategies. The results are presented and discussed in detail in Section 4. Finally, the main findings are concluded in Section 5.

Modeling of the PV/PEMFC/BSs/SCs Hybrid System
This part deals with the description and modeling of the hybrid renewable energy system component from a photovoltaic array, fuel cell, battery storage, and supercapacitor. The photovoltaic array generates and injects variable energy into the load under different meteorological conditions. Due to its low electricity production, SCs are employed to maintain and absorb oscillating power struggles as well as transient/fluctuating system changes. In addition to having a very large number of cycles with excellent results and no deterioration, SCs are efficient in extremely quick charging and discharges [21]. The battery is used to store the electricity produced by the solar generator so that it may be accessed at a later point in time, if necessary. However, because of its high energy density, it seems to sustain continual power adjustments and only provide temporary power in urgent situations.

Modeling of PV Array
A single-diode electrical model is shown in Figure 1. The electrical model consists of a photocurrent parallel to a diode, a shunt resistance, and a series resistance. Based on KVL, the equations that control this circuit is presented as [22]: R sh and R s represent shunt and series resistances, respectively. n is the ideality factor, I 0 is the saturation current, and V th is the thermal voltage given by the following relation: where q seems to be the electron's charge, T c is the temperature of the cell, and k is the Boltzmann constant.
accessed at a later point in time, if necessary. However, because of its high energy density it seems to sustain continual power adjustments and only provide temporary power in urgent situations.

Modeling of PV Array
A single-diode electrical model is shown in Figure 1. The electrical model consists o a photocurrent parallel to a diode, a shunt resistance, and a series resistance. Based on KVL, the equations that control this circuit is presented as [22 Rsh and Rs represent shunt and series resistances, respectively. n is the ideality factor I0 is the saturation current, and Vth is the thermal voltage given by the following relation where q seems to be the electron's charge, Tc is the temperature of the cell, and k is th Boltzmann constant.
where Tc and Tr are the experimental and benchmark temperatures, α is the temperatur coefficient, and G is the solar radiation. ISC is the short circuit current in A. In sum, consid ering series and parallel panels, the current produced by the PV array can be estimated a follows: where Vout is the voltage and Iout is the current of the photovoltaic array, respectively. N and NP are the number of series and parallel cells connected in photovoltaic arrays.

Battery Storage Model
In industry, there are different types of batteries. The model adopted in the curren case analysis is a lithium-ion relying on the Thevenin representation [23], which is demon strated in Figure 2. Since lithium-ion batteries have a large storage capacity, a high pro portion of operating voltage, and a prolonged cycle life, they are frequently employed du to their benefits over other energy storage technologies. The presented electrical model i among the most popular energy storage technologies. It contains an internal resistanc with a parallel RC network. The open-circuit voltage Uoc, intrinsic resistances, and The photocurrent is represented as: where Tc and T r are the experimental and benchmark temperatures, α is the temperature coefficient, and G is the solar radiation. I SC is the short circuit current in A. In sum, considering series and parallel panels, the current produced by the PV array can be estimated as follows: where V out is the voltage and I out is the current of the photovoltaic array, respectively. N S and N P are the number of series and parallel cells connected in photovoltaic arrays.

Battery Storage Model
In industry, there are different types of batteries. The model adopted in the current case analysis is a lithium-ion relying on the Thevenin representation [23], which is demonstrated in Figure 2. Since lithium-ion batteries have a large storage capacity, a high proportion of operating voltage, and a prolonged cycle life, they are frequently employed due to their benefits over other energy storage technologies. The presented electrical model is among the most popular energy storage technologies. It contains an internal resistance with a parallel RC network. The open-circuit voltage U oc , intrinsic resistances, and analogous capacitor values are the three basic elements that make up the model [24]. The intrinsic impedances are made up of the polarization resistance R Th and the conductive resistance R 0 . The battery's charging and discharging dynamics are represented by the roughly comparable capacitance C Th . U Th denotes the voltage above C Th .
analogous capacitor values are the three basic elements that make up the model [24]. Th intrinsic impedances are made up of the polarization resistance RTh and the conductiv resistance R0. The battery's charging and discharging dynamics are represented by th roughly comparable capacitance CTh. UTh denotes the voltage above CTh. The following equation is a characterization of the supply voltage:

PEMFC Mathematical Model
As shown in Figure 3 [25], a fuel cell includes an anode and a cathode, as well as an electrolyte. At the anode, a platinum catalyst splits the hydrogen atom into protons and electrons. While the electrons receive current from an externally applied to produce th FC output voltage, the protons reach the cathode. At the cathode, the protons and elec trons are once again coupled with oxygen to produce heat and water.  The following is a presentation of the FC chemical reactions [25]: The following equation is a characterization of the supply voltage:

PEMFC Mathematical Model
As shown in Figure 3 [25], a fuel cell includes an anode and a cathode, as well as an electrolyte. At the anode, a platinum catalyst splits the hydrogen atom into protons and electrons. While the electrons receive current from an externally applied to produce the FC output voltage, the protons reach the cathode. At the cathode, the protons and electrons are once again coupled with oxygen to produce heat and water.
intrinsic impedances are made up of the polarization resistance RTh and the conductive resistance R0. The battery's charging and discharging dynamics are represented by the roughly comparable capacitance CTh. UTh denotes the voltage above CTh. The following equation is a characterization of the supply voltage:

PEMFC Mathematical Model
As shown in Figure 3 [25], a fuel cell includes an anode and a cathode, as well as an electrolyte. At the anode, a platinum catalyst splits the hydrogen atom into protons and electrons. While the electrons receive current from an externally applied to produce the FC output voltage, the protons reach the cathode. At the cathode, the protons and electrons are once again coupled with oxygen to produce heat and water.  The following is a presentation of the FC chemical reactions [25]: The following is a presentation of the FC chemical reactions [25]: Inside the PEMFC, there are three different types of losses: activation, ohmic, and concentration losses. Figure 4 depicts the fluctuation of PEMFC voltage with cell current density [26].
Inside the PEMFC, there are three different types of losses: activation, ohmic, and concentration losses. Figure 4 depicts the fluctuation of PEMFC voltage with cell current density. [26]. As a result, the output voltage of the PEMFC is the sum of four voltage provided by thermodynamic effect as ENernst, the activation voltage losses zone creating the Vact, the ohmic voltage losses Vohm come from the ohmic loss dominated region due to the ionic and electronic resistance, the last region generated the concentration voltage losses, Vcon, due to the mass transport, and ncell percent is the number of connected cells in PEMFC. In principle, the true voltage output of a fuel cell may be calculated by initiating with both the thermally anticipated voltage and removing the different voltage fluctuation inefficiencies, as shown below: Each element in Equation (1) is recognized and analyzed separately as follows: where T represents the cell temperature, and E0 = 1.229 is the thermodynamic voltage of a conventional bidirectional FC. PH2 and PO2 are the partial pressures of hydrogen and oxygen, respectively. The reactant concentration variations at the electrode surface cause a voltage decrease in accumulation, which is characterized as: max .ln 1 where b represents the concentrations degradation constant and Imax represents the rated current destiny. The activation voltage loss is determined as follows [27]: As a result, the output voltage of the PEMFC is the sum of four voltage provided by thermodynamic effect as E Nernst , the activation voltage losses zone creating the V act , the ohmic voltage losses V ohm come from the ohmic loss dominated region due to the ionic and electronic resistance, the last region generated the concentration voltage losses, V con , due to the mass transport, and n cell percent is the number of connected cells in PEMFC. In principle, the true voltage output of a fuel cell may be calculated by initiating with both the thermally anticipated voltage and removing the different voltage fluctuation inefficiencies, as shown below: Each element in Equation (1) is recognized and analyzed separately as follows: where T represents the cell temperature, and E 0 = 1.229 is the thermodynamic voltage of a conventional bidirectional FC. P H2 and P O2 are the partial pressures of hydrogen and oxygen, respectively. The reactant concentration variations at the electrode surface cause a voltage decrease in accumulation, which is characterized as: where b represents the concentrations degradation constant and I max represents the rated current destiny. The activation voltage loss is determined as follows [27]: where ξ i (i = 1, 2, 3, 4) symbolizes the semi-empirical parameters of the FC derived from the fluid mechanic, thermodynamic, and electrochemistry, and C O2 illustrates the oxygen concentration, R M stands for identical membrane resistance to proton conduction, and ρ M and l are both the thickness of the membrane, and λ presents membrane water content. The equivalent resistance of the FC causes the ohmic voltage loss, and it can be expressed as: where R c is the equivalent resistance representing the concentration processes.
The stack terminal voltage of the FC is given by the number of fuel cells interconnected in series:

Supercapacitor
The capacitance used in the SC model represents how the SC performs when being charged and discharged. A series resistance is analogous to those same resistances for both charging and discharging [28].  .exp 4.18.
The equivalent resistance of the FC causes the ohmic voltage loss, and it can be expressed as: where Rc is the equivalent resistance representing the concentration processes. The stack terminal voltage of the FC is given by the number of fuel cells interconnected in series:

Supercapacitor
The capacitance used in the SC model represents how the SC performs when being charged and discharged. A series resistance is analogous to those same resistances for both charging and discharging [28].  Once resistive losses are taken into account, the SC output voltage may be represented as: with, Figure 5. Supercapacitor equivalent circuit model.
Once resistive losses are taken into account, the SC output voltage may be represented as: where C T denotes the sum of the capacitances (F), Q T represents the entire amount of electricity charged, R SC denotes intrinsic resistance (ohm), i SC is the SC current (A), N S is the number in series, N P denotes the number in parallel, C H is the Helmholtz capacitance (F), C GC represents the capacitance of Gouy-Chapman (F), Ne is the total number of layers of the electrodes, ε and ε 0 are the permittivity values of the electrolyte material and empty area, A i is the space between both the electrodes and the electrolyte (m 2 ), d is the length of the Helmholtz layer (m), Q c would be the electric charge of the cell, C is just the molar concentration (mol m −3 ).

Specifications of the Hybrid System
The considered hybrid power system is shown in Figure 6. It includes a PV system, PEMFC, BSs, and an SC to supply the load demand regarding high fluctuations. The perturb and observed maximum power point tracking maximizes the PV power. The specifications of the hybrid system are presented in Table 2.

Specifications of the Hybrid System
The considered hybrid power system is shown in Figure 6. It includes a PV system, PEMFC, BSs, and an SC to supply the load demand regarding high fluctuations. The perturb and observed maximum power point tracking maximizes the PV power. The specifications of the hybrid system are presented in Table 2.

Proposed Energy Management Strategies
The system's efficiency depends greatly on the development of MG energy management, which is essential [30,31]. The necessary power by the load in a hybrid system not supplied by the PV array is known as net power (∆P). To provide conversion efficiency, the EMS instructions might control the PEMFC, BSs, and SCs.
To prevent reactive depletion, however, the FC dynamics must be controlled. In the case study, numerous EMSs are considered, including external energy optimization methodologies, state engine control, standard EEMS, and improved EMMS-based WSO.

Equivalent Consumption Minimization Methodology
The ECMS aims to minimize fuel consumption while maintaining a battery SOC within acceptable bounds. The accuracy of the empirical assessment of the associated fuel economy determines how successfully the ECMS performs, as stated in [32]. The related objective function is presented as follows: (19) wherein C Bat denotes the battery energy usage in relation to the given energy and µ is a constant (0.6). This equation can be defined as follows: wherein µ is indeed a constant (0.6), and C Bat reflects the battery fuel efficiency in terms of the energy supplied.
The following equation is used to compute the FC output:

State Machine Control Management
An EMS depending on switching rules is designated SMC [33]. In SMC, the operational state is chosen in proportion to the inputs: ΔP and battery SOC. The battery is charged or discharged depending on the status of its inputs, as shown in Figure 8.  Figure 7. Layout of ECMS.

State Machine Control Management
An EMS depending on switching rules is designated SMC [33]. In SMC, the operational state is chosen in proportion to the inputs: ∆P and battery SOC. The battery is charged or discharged depending on the status of its inputs, as shown in Figure 8.

Conventional EEMS
The basic purpose of EEMS is to supply the minimum fuel consumption possible while respecting battery and DC bus capacitor power constraints [24]. The fitness function's objective is to increase the energy supplied by the BS and SC: where T represents the sample period, and V indicates the charge/discharge voltage. This equation is confirmed by the following optimization: where V batt and Q batt are the standard voltage and capacitance of the battery, respectively.

State Machine Control Management
An EMS depending on switching rules is designated SMC [33]. In SMC, the operational state is chosen in proportion to the inputs: ΔP and battery SOC. The battery is charged or discharged depending on the status of its inputs, as shown in Figure 8.

Optimized EMMS-Based WSO
The "fmin" function is a component of the standard EEMS's programming code [34]. Consequently, a new white shark optimizer is used in place of the function "fmin" to improve the efficiency of EEMS (WSO). The decision factors throughout the optimization procedure are FC power, PFC, battery power, P batt , and battery SOC.
The lower and upper limits of the decision variables are chosen as indicated in Table 3.  Figure 9 shows the layout of optimized EMMS-based WSO.

Parameter
Lower Upper PFC (W) 850 8800 Pbatt (W) 1500 3400 SOC 60 90 Figure 9 shows the layout of optimized EMMS-based WSO. WSO is now a revolutionary meta-heuristic optimization tool influenced by great white shark attributes, such as their exceptional hearing and sense of smell when navigating and foraging. The important steps of this algorithm are listed below [35]: Movement speed towards prey. When a white shark recognizes the location of prey reliant on the waves created by the prey's activity, it approaches in the following way: where the index i (i = 1, 2, …, n) expresses the white shark order in a population of size n, s represents the speed, Pgbest reflects the highest strategic standing vector, p is the ith white shark's present position vector, Pbest is the current best-achieved position, c1 and c2 are two numbers at random from the range [0, 1], p1, p2, and u are calculated according to the following equations: WSO is now a revolutionary meta-heuristic optimization tool influenced by great white shark attributes, such as their exceptional hearing and sense of smell when navigating and foraging. The important steps of this algorithm are listed below [35]: Movement speed towards prey. When a white shark recognizes the location of prey reliant on the waves created by the prey's activity, it approaches in the following way: where the index i (i = 1, 2, . . . , n) expresses the white shark order in a population of size n, s represents the speed, P gbest reflects the highest strategic standing vector, p is the ith white shark's present position vector, P best is the current best-achieved position, c 1 and c 2 are two numbers at random from the range [0, 1], p 1 , p 2 , and u are calculated according to the following equations: Movement towards optimal prey. After they presumably detect the waves caused by the target's movement or when they see the target's movements or smell the fragrance of the prey, white sharks continually travel toward their prey. The prey either escapes or leaves its location to search for food. However, its scent in that position is still there. Accordingly, the white shark updates its position as follows: where "-" is not a sign, a and b represent one-dimensional binary vectors, f is the frequency of the wavy motion, high and low are the upper and lower random search boundaries, and mv is described as: where a 0 and a 1 are constants. Movement towards the white shark: this phase can be modeled as: where a 0 and a 1 are constants. Movement towards the white shark: this phase can be modeled as: wherein r 1 , r 2 , and r 3 represent the random values ranging in [0, 1], and D expresses the distance between the target and the shark. Fish school behavior: The formula for this phase is provided as follows: The main procedure of WSO is provided in Figure 10.

Results and Discussion
The suggested optimized EEMS-based WSO is used to minimize the consumed hydrogen of a hybrid power system shown in Figure 6. The simulation software model's Sfunction incorporates the optimized EMMS-based WSO, which is constructed and provided with the following two input variables: the battery SOC and the load profile, whereas the output, the FC and battery banks, are regulated currents. The optimized EMMS-based WSO is compared with conventional EEMS, SMCS, and PSO. Figure 10

Results and Discussion
The suggested optimized EEMS-based WSO is used to minimize the consumed hydrogen of a hybrid power system shown in Figure 6. The simulation software model's S-function incorporates the optimized EMMS-based WSO, which is constructed and provided with the following two input variables: the battery SOC and the load profile, whereas the output, the FC and battery banks, are regulated currents. The optimized EMMS-based WSO is compared with conventional EEMS, SMCS, and PSO. Figure 10 demonstrates the load demand that was used (red curve). As presented in Figure 11, at a time of 5 s no load demand is required, and the PEMS starts recharging the BSs with its optimal power (about 1 kW). At 40 s, with no PV power, the extra load demand required is instantly given by the SCs due to its fast dynamics, while the PEMFC power increases gradually. At 45 s, the SCs are discharged below the reference DC link voltage of 270 V, as presented in Figure 12, and the BSs begin delivering power to adjust the DC link voltage back to 270 V. At 48.5 s, the SCs voltage reaches 270 V, and the BSs decreases its power gradually to zero. The PEMFC provides the total demand and continues to recharge the SCs. At 60 s, a fast change in load occurs, and the SCs provide the extra transient demand while the PEMFC power increases gradually. The PV has not yet delivered any power; this changes at t = 100 s. Throughout this time, the energy generated by the PV increases to contribute to load-shaving while the excess electricity is used to charge the battery and SC. Likewise, when the PV power has a value, the PEMFC power is zero. At t = 250 s, when the battery and SC are simultaneously in the charging mode, the PV is shut off, and the PEMFC returns to share a large amount of load power. is instantly given by the SCs due to its fast dynamics, while the PEMFC power increases gradually. At 45 s, the SCs are discharged below the reference DC link voltage of 270 V, as presented in Figure 12, and the BSs begin delivering power to adjust the DC link voltage back to 270 V. At 48.5 s, the SCs voltage reaches 270 V, and the BSs decreases its power gradually to zero. The PEMFC provides the total demand and continues to recharge the SCs. At 60 s, a fast change in load occurs, and the SCs provide the extra transient demand while the PEMFC power increases gradually. The PV has not yet delivered any power; this changes at t = 100 s. Throughout this time, the energy generated by the PV increases to contribute to load-shaving while the excess electricity is used to charge the battery and SC. Likewise, when the PV power has a value, the PEMFC power is zero. At t = 250 s, when the battery and SC are simultaneously in the charging mode, the PV is shut off, and the PEMFC returns to share a large amount of load power.     Figure 13 present the consumed hydrogen using different EMSs. The results demonstrated the superiority of optimized EEMS-based WSO compared to EEMS, SMCS, and PSO. The EEMS-based WSO reduces hydrogen consumption to a best-obtained value of 14.74 gm, followed by the PSO with 15.05 gm, and the traditional SMCS with a worst-obtained value of 22.39 gm. It is crucial to determine each approach's efficiency for further research; you may do this by dividing the total power consumed by a PV array, PEMFC, BS, or SC by the total power generated by all of these devices together. The accuracy of each optimization method is shown in Table 4, with the optimized EEMSbased WSO achieving the highest efficiency of 79.24% and the EEMS achieving the lowest efficiency of 72.41%.   The accuracy of each optimization method is shown in Table 4, with the optimized EEMSbased WSO achieving the highest efficiency of 79.24% and the EEMS achieving the lowest efficiency of 72.41%.  A comparison between different EMSs is presented in Figure 14. Thanks to the proposed EEMS-based WSO, hydrogen consumption has been reduced by 34.17%, 29.47%, and 2.1%, respectively, compared with SMCS, EEMS, and PSO. In addition, the efficiency has been increased by 6.05%, 9.5%, and 0.33%, respectively, compared with SMCS, EEMS, and PSO.  A comparison between different EMSs is presented in Figure 14. Thanks to the proposed EEMS-based WSO, hydrogen consumption has been reduced by 34.17%, 29.47%, and 2.1%, respectively, compared with SMCS, EEMS, and PSO. In addition, the efficiency has been increased by 6.05%, 9.5%, and 0.33%, respectively, compared with SMCS, EEMS, and PSO. A comparison between different EMSs is presented in Figure 14. Thanks to the proposed EEMS-based WSO, hydrogen consumption has been reduced by 34.17%, 29.47%, and 2.1%, respectively, compared with SMCS, EEMS, and PSO. In addition, the efficiency has been increased by 6.05%, 9.5%, and 0.33%, respectively, compared with SMCS, EEMS, and PSO.

Conclusions
A new energy management strategy (EMS) using the white shark optimizer technique (WSO) has been proposed to optimally distribute the load demand between the sources in a hybrid PV/PEMFC/BSs/SCs microgrid. The optimized EMS aims to minimize the consumed hydrogen consumption of PEMFC. The optimized EMS avoids the defects of the conventional approach for maximizing external energy (EEMS). The improved EEMS-based WSO is evaluated to EEMS, state machine control (SMCS), and particle swarm optimization (PSO). Two main factors are considered, hydrogen fuel consumption and efficiency. The results reveal that the improved EEMS-based WSO was preferable. Hydrogen consumption has been reduced by 34.17%, 29.47%, and 2.1%, respectively, compared with SMCS, EEMS, and PSO. In addition, the efficiency has been increased by 6.05%, 9.5%, and 0.33%, respectively, compared with SMCS, EEMS, and PSO.6.