Control-Oriented Model of an Optimally Designed Hybrid Storage System for a Standalone Microgrid

The uncertainty in wind speed and load demand fluctuations has made the deployment of renewable energy (RE) challenging. However, in islanded microgrids, the implementation of hybrid energy storage systems (HESS) can improve the reliability of power supply and enable further utilization of surplus energy. In this study, we configure an energy management system (EMS) for an optimally constructed system that includes wind turbines (WTs), an electric storage system (i.e., lithium-ion battery), a hydrogen storage system (i.e., PEM type), and diesel generator (DG), based on model predictive control (MPC), to meet specified technical and economic benchmarks for a standalone microgrid (SMG). MPC is intended to maintain the state of charge (SOC) and level of hydrogen (LOH) within their technical limits to prevent degradation and extend the lifetimes of HESS by minimizing the objective function. Additionally, disturbances due to wind power and load demand variations are captured to determine the optimal instantaneous powers of hydrogen and DG sources exposed to certain weighting factors within opted constraints. To perform the simulations, MPC toolbox in MATLAB Simulink environment is used. We consider four cases under various weather conditions to validate the robustness of MPC on the designed EMS for the SMG with shared system element powers for 24 hours using real data of wind velocity and load demand. From the simulation results, we observe minimum and maximum SOC of 20% and 88.52%, and LOH of 10% and 90.06% for the entire studied periods respectively. The results of the designed EMS show that MPC has ensured the HRES bounds to prevent degradation, overcome power interruptions due to weather intermittencies, and reduce grid-integration establishment charges. Moreover, the utilization of the entire renewable energy produced by wind turbines is achieved. Likewise, the load demand is met completely by using this technique and excellent performance of MPC under uncertainty is achieved.

Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

I. RESEARCH BACKGROUND
Designing and integrating renewable energy (RE) resources into existing systems will lead to a significant reduction in CO 2 emission.In addition, harnessing the maximum energy from intermittent sources is a viable solution and can contribute to people's quality of life.For remote areas, it is better to replace traditional resources such as diesel generators (DGs) with renewable ones such as fuel cells (FCs).However, internal combustion engines (ICEs) are characterized by low efficacy, which is highest when the engine runs at its nominal power.Efficiency decreases as the load decreases, with efficiency dropping to nearly 40% at light loads.Additionally, when accounting for AC/DC and DC/AC converter losses, the average efficiency of DGs reaches nearly 20% [1].Conversely, FCs' efficiency increases at low loads, as shown in Figure 1, with an efficiency of 40% at zero loading conditions.Therefore, FCs are not only higher in their efficiencies, but they can also serve wide ranges of loads and are operationally flexible.Integration of renewable energy resources (RESs) has supported the switch from central to dispersed generation, enabling the management of microgrid power with local load demand by forming subsections in bulk power systems [2].Microgrids can be either integrated into the grid to form a grid-tied option or disconnected from the grid to form a SMG mode.Traditionally, the islanded mode was applied to cover the events that follow fault occurrences in the power grid or remote localities, where constructing transmission lines to the grid was financially and physically infeasible.Previously, intentional grid integration was disallowed to prevent maintenance and operations threats [3].However, IEEE Std 1547.4 issued new rules and guidelines for planned microgrid integrations [4].Achieving full control of microgrids is implemented using higher and lower power levels in the management phase.The two phases are distinguished by the tasks to perform and the time in which they interact.The energy management phase guarantees the balanced operation and power quality issues of the complete system.In this stage, the sampling time is characterized by a short period (msec-sec) to enable fast control action [5], [6], [7].The various stages of the EMS in microgrid are illustrated in Figure 2.
Massive studies have been conducted to electrify grid-tied and SMG systems.In [8], a Persian Gulf PV, wind turbine (WT), DG, and battery energy storage (BES) hybrid system is proposed to energize this coastal area.It is summarized that the inclusion of DG units will significantly reduce the electricity charges.Furthermore, in [1], it is argued that the insertion of DG units during crest load instances prevents the extra costs of the hybridized combination.However, PV, WT, DG, BES, and hydro are applied to energize a cluster in Cameroon.The study concluded that the presence of DG units would increase the emitting elements.Meanwhile, due to the higher expenses of installing a new transmission system to deliver electricity to rural areas, the implementation of DGs  is the most cost-effective solution [9].Numerous investigations are performed for both grid-connected and SMG hybrid systems, with the inclusion of hydrogen and battery systems, as detailed in Table 1.
Furthermore, numerous studies have been conducted on autonomous hybrid renewable energy systems (HRESs).A Sequential Linear Programmed Algorithm (SLPA) has been developed to model a PV-WT-Biomass hybrid system in the presence of a DG system [10].In [11], a genetic algorithm control-based design has been applied to minimize the gross present value and reduce energy charges per unit of a PV-WT-FC-BG-BM grid-connected HRES.The aim was to identify the most profitable selection for electrification through an optimization strategy that considers hybridized power system sizing, control, and element choice.In [12], the impact of power dispatch on optimally designed HRES elements has been carried out by applying three different-control schemes namely, dynamic programming, sophisticated rule-based, and uncomplicated rule-based.Furthermore, the results have shown that the control scheme has the most significant impact on the feasible selection, and the optimum control scheme has saved 5-10% of the elements lifetime costs.The energy management paradigm has considered load-generation mismatching.Similarly, to eliminate the intermittency in renewable power generation, a generation scheduling has been designed for SMG HRES of WT-PV-BG portfolio in [14] to dynamically adjust the dispatch coefficients when the energy conversion equipment are integrated.The suggested optimal multiple energy sources scheduling plan has led to lower degradation expenses, higher RE deployment, and zero unmet electric demand.In [14], an energy management system (EMS) based on model predictive control (MPC) has been tested to enhance the demand prediction algorithm fed by HRESs for more precision.The test has been performed for the entire year, and the results revealed that a reduction of 14.10% in power unbalance and 8.70% of the yearly operating charges have been achieved in the presence of the correct demand forecasting.The application of MPC has been found in previous studies such as DSM-MPC which has been proposed to eliminate fluctuations in the exchanged energy with the grid.Additionally, it prevents the system from experiencing peaks in energy purchase [15].Nonetheless, the most reliable method used for online optimization of nonlinear discretized dynamic systems with multiple control variables, smaller current deformations, and reduced switching losses is finite control set (FCS-MPC) [16].
Recently, MPC has become desirable and appealing due to its outstanding performance, ability to handle constraints, simplicity, and perfection in tracing trajectories.Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
However, as indicated in [32], the rule-based controller (RBC) does not ensure optimum performance with poor robustness especially at the moment of uncertain driving cycle.To dominate these issues, greater attention has been made recently to come up with online optimizationbased schemes.A control-oriented system is developed based on MPC, to minimize the fluctuations in current magnitude of the battery for a HESS as in [33] and [34].EMPC is constructed to solve piecewise linear functions in an offline pattern instead of online QP computation, which resulted in a dramatic reduction of the computational time [35].Moreover, the works highlighted in [36] and [37] are concentrated on designing two-level MPC-based EMS which is adapted to a microgrid optimization with the inclusion of HESS, as a result reduce the degradation charges and operation charges for the complete HESS.
The literature survey on the listed published articles, major outcomes of the current research, their various corresponding operation modes of certain HRESs based on MPC, and quality of the works are detailed in Table 2.
Furthermore, microgrid control matters are divided into three hierarchical control stages as aforementioned, the superior of which is related to its economical optimization [38], long term planning, and the least one focusing on power quality concerns [39].However, developing an EMS for microgrid schemes using heuristic techniques is difficult for the day-ahead forecasting [40], especially in the presence of grid outage uncertainties.MPC is widely employed as a framework to resolve complex problems and has become an attractive option for researchers and industrial engineers in microgrid studies [39], [41].This technique, as a family of various control approaches, allows for optimization of multiple cost functions in the availability of future information regarding energy prediction, the uncertainties of microgrid elements, and energy prices with their constraints in an easy integration with the controller.
From the previously studied research to the best of the authors' knowledge, the following research gaps are summarized: • In Table 1, various systems are designed to minimize costs related to energy, whether those combinations are islanded or grid-connected modes.No management system is designed to optimally share the power between the combination elements, particularly when renewable sources are involved.
• The characteristics and advantages of MPC as aforementioned have been employed in standalone hybrid systems with only one storage system category as in [42], [43], and [44] to charge and discharge battery systems within specified constraints.
• The inclusion of a hydrogen storage system combined with a battery storage system is implemented for a grid-connected model as in [45].This MPC-based EMS is valid for grid-tied options with unlimited export/import powers which gives the controller more relaxation compared to SMG propositions.However, in SMG configurations, controllability is more challenging.
Consequently, in this study, the main objectives are highlighted as follows: • Application of MPC to an optimally designed system in the western region of Saudi Arabia.This system, which is summarized in Table 8 of [17], is modeled as a dynamic system in an MPC perspective.
• EMS is developed using MPC in MATLAB Simulink environment.The EMS is implemented for a SMG system that involves a hybrid energy storage system (ESS) comprising battery and hydrogen systems, each with defined limits.
• The main energy sources are WTs and DGs.The objective of MPC is to utilize the entire power produced by the WT.Additionally, the EMS allows the DG to run when the load requirements are not met, based on the decision made by MPC according to specified technical constraints and weighting factors.
• The robustness and controllability of the hybrid ESS help in constringing the degradation of these elements and as a result avoid lifetime shortenings.
• The uncertainties of RE source and load demand are captured to assess the robustness workability of the controloriented plant.In addition, to ensure the maintaining of state of charges and level of hydrogen for battery storage device and hydrogen tank, respectively.
• This study is significant because it designs an EMS for a standalone microgrid system (SMG) for a hybrid ESS with the involvement of DG which has not been practiced before.Moreover, significant disturbance signals are presented as inputs to examine the resiliency of the MPC to minimize the objective function, follow the designated constraints, and scheduling criteria for different weather conditions and diverse load consumption.
The paper is organized as follows: Section I introduces the research background, Section II explains the research methodology, Section III describes the MPC approach in energy management of microgrids, Section IV presents the problem formulation, Section V discusses the results with different weather conditions and diverse load consumption natures, Section VI validates and compares the results, and Section VII concludes the study.

II. RESEARCH METHODOLOGY A. DISTRIBUTED ENERGY SOURCES
Microgrid combines various alternatives to supply power, given that diminishing fossil fuels resources promotes renewable energy technologies towards progressively vital position Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply. in the recent energy model [51].This research is an extension to the optimally designed system that's proposed in [17] in which wind turbine units, fuel cells, electrolyzer, battery storage, and hydrogen tank are employed as demonstrated in Figure 3.In the studied location, which is isolated from the main grid, currently the load demand is fed by DGs.

B. RENEWABLE SUPPLY AND LOAD SYSTEMS
Electrical energy is deduced from wind energy with the mean of wind turbines.Based on [5] and [52], the main elements of the wind turbine are: tower, rotor and blades, Nacelle, gearbox, generator, brake system, and control system.As wind turbines transform the power of wind into mechanical, the aerodynamic power P wt is expressed in term of wind velocity in the following equation [52], [53].
where ρ, R blade , v w , C p represent air density, blade radius, wind velocity, and power coefficient, respectively.The power constant can be represented as a function of speed fraction λ and pitch angle θ.However, C p is assumed to be constant value to simplify the model.However, the wind power generated in early December, March, June, and September is shown in Figure 4 with wind speed fluctuations that caused the produced power to be oscillated subsequently.Plus, the demand nature is also uncertain, therefore the power consumption is varied simultaneously as depicted in Figure 5 for various weather seasons.To cover comprehended scenarios starting from low wind power to high wind power generations compared to the corresponding load power, and simulate the response on the SMG, an interval of 15 minutes is taken.Moreover, the MPC is tested for the entire day with the consideration of multiple wind speed.The maximum and minimum wind power and load consumption are revealed in Figure 6.

C. HYDROGEN ENERGY SYSTEM
Hydrogen is considered as the most essential element on the earth, nonetheless, is rarely found in its free state in nature.It is obtained from hydrocarbons, fats, water, etc.Despite that, hydrogen is regarded as a capable choice to be utilized in renewable energy systems with energy storage designs.A complete hydrogen energy system is comprised of a system to produce hydrogen, a system to store hydrogen, and a system to transform hydrogen to electricity such as hydrogen engine and fuel cells.In microgrid systems, the most noteworthy option used to create hydrogen is by connecting the electrolyzers to renewable resources [54], [55], [56].

1) ELECTROLYZER
When a DC is employed, electrolyzer is capable to split the oxygen and hydrogen from H 2 O molecules.In the electrolyzer, the water is delivered through the channels of the cathode and anode of the electrolysis units, later when the DC voltage is employed the catalyst act of the platinum develops the transfer of protons via the membrane that distinguishes the cathode and anode [54], [57].The components of the electrolyzer are as follows: electrolyte, electrodes, bipolar, stack, separator, condenser, and heater/cooler [58].Moreover, electrolyzers must operate within optimal temperatures.Furthermore, the electrolyzer managing director (EMD) maintains the proper water level inside the separator to make the membrane undried and to supply the stack with sufficient water to create the reaction of the electrolysis [54], [55].

2) HYDROGEN STORAGE
Two common hydrogen storage systems are currently in use with microgrids: metal hydrides and compressed hydrogen ones.In this research, a simplified compressed hydrogen model is assumed which involves of the perfect gas and mass equilibrium equations, respectively as follows: where ṁH 2 ,elz , ṁH 2 ,fc , N H 2 , V, R, T, and P H 2 stand for hydrogen flow rate generated by the electrolyzer, hydrogen flow rate utilized by the fuel cell, number of hydrogen moles contained in the hydrogen tank, tank volume, perfect gas constant, tank temperature, and hydrogen tank pressure respectively.

3) FUEL CELLS
The function of fuel cells is to transform the water and hydrogen flows into electricity through electrochemical reactions.
The basic elements of fuel cell are two electrodes (cathode and anode), membrane, and electrolyte.To produce more electric energy, a combination of series cells is formed, this serial combination is called a stack.However, the fuel cell overall reaction is described in (4).The dynamic of fuel cells is characterized by heat and mass balances that results in a time-consuming response as compared to ultracapacitors and batteries [59], [60].Therefore, the most favorite fuel cell type is PEM one (proton-exchange membrane) due to its fast dynamic response and it operates in a low temperature environment.
Likewise, the fuel cell is comprised of these equipment: electrolyte, electrodes, membrane electrolyte assembly, bipolar plates, humidifier, compressor, and radiator [61].A detailed model of each fuel cell element is shown in [59].This electrochemical item stores electric energy which is comprised of various galvanic cells.The voltage across the cell is identified as voltage difference, while the open circuit voltage is recognized as the voltage difference the time the cell is idle (neither discharging nor charging).Likewise, the main components of the battery are electrodes, electrolyte, separator, current collectors, and sturdy electrolyte interphase (SEI) layer.Furthermore, there are different battery technologies among them is lithium-ion battery which is the most used one in microgrid systems as it prevents the degradation issues in its cells due to the common use of the energy management system with this technology to determine the suitable state of charges [62].

D. DG
Commonly, diesel generators (DG) are employed to overcome the unbalance when the power produced from renewable energy source (in our case is wind power) is not enough to meet the load demand requirements.Additionally, battery bank can participate to feed the load with DG [63].However, there are two reasons to make DG units the least prioritized option to startup with the hybridized combination.Firstly, the fuel price is high, and secondly the CO 2 emission is produced with the utilization of DG units which is harmful for the environment.Nevertheless, the major benefit of DG is the availability to work at any time regardless of weather conditions.In addition, the necessary technical issue with DG is to operate within its constraints from low power rating to its maximum capacity [64].

III. MPC IN MICROGRIDS A. MPC IN HESS
When the battery power rate and hydrogen power rate are within their operation limits (i.e., consequently SOC and LOH), that would better represent the capability of the HESS to age longer time.EMS is aimed to: (1) minimize the HESS current variations, and consequently extend the lifespan of the HESS element; (2) guarantee the upper and lower bounds

B. MPC FOR ENERGY SCHEDULING
To conduct this research, we employ MPC based on receding horizon.In the MPC environment, the inputs at any time frame k are the estimated load and generation at that specific time, the states of the hybrid ESS, and their predictions for N points in the future are (k The frame for which the predictions are made is called the prediction horizon.Then, the forecasted values are used to assess how the states progress with various set points within the horizon.Accordingly, set points will be developed to optimally track the trajectories based on specific optimization criteria.N+1 set points will be produced at every time instant k considering the length of the forecasting horizon.The developed sets are specified as u 0|k , u 1|k , . . . . ..uN|k in which: u i|k = u (k + i) ∀i = 0, 1, . . ...N.The first set point is used as an input to the system among the N + 1 points.At each time instant this process is repeated to allow MPC to decide based on the current state and to make a certain response [67].The generalized schematic of the MPC strategy is depicted in Figure 7.The system considered in this work is a SMG scheme in which the load demand and wind energy generation are uncertain.
Moreover, MPC can be extended for multi-carrier system applications, in which various carriers are used as the name suggests.The energies to be managed can be gas, electricity, etc.Meanwhile, MPC can be utilized to manage the energy of the structures indicated in [67] and [68].

C. OBJECTIVE FUNCTION
The goal of MPC is to reduce the computation of the objective functions (OFs).In an MPC environment, the OF is a weighted sum of all control and output variables.The weights of the variables to be minimized in the OF are determined based on their significance on the model over a specified prediction horizon [69].However, the objective of MPC in this study is to maximize efficiency, utilize all RE, and minimize ESS degradation.In this framework, the MPC cost function is presented as follows: where J FC (i), J Bat (i), and J Elz (i) represent the objective function terms of fuel cell, battery, and electrolyzer for enforcing energy limitation in the microgrid.
The objective function term of the battery J Bat is represented as follows: In ( 6), SOC Bat , λ SOC , and λ dBat represent the battery state of charge, battery weight factor, and change in state of charge weight factor, respectively.The battery power P Bat is not explicitly penalized in the cost function.Due to this, the battery will readily store excess power from the wind system for later use promoting more utilization of the battery power.Additionally, better battery utilization improves the selection for operation efficiency, as the battery round cycle proficiency is more than 0.90 per unit [70].However, in (6), the penalization of SOC Bat limits high SOC dwell periods as much as possible, reducing battery calendar aging.Battery cycling is penalized in the second term of (6).In [71], it is noted that the Li-ion battery aging mechanism is accelerated by extreme discharge-charge cycles.Therefore, (6) penalizes P Bat indirectly, which is modified to meet the minimization criteria of (6).MPC is a forecast-based tool, allowing scheduling for further decreases in battery degradation, particularly calendar aging.Notably, explicit use of the battery degradation relationship was not opted due to nonlinearity, which could lead to complex optimization issues and intensive computations.To avoid this, a quadratic cost function based on quadratic programming for efficient solving is used [72].
J fc (i) = λ fc (P fc (i)) 2 P max fc + λ rate (P fc (i + 1) − P fc (i)) 2 (7) whereas P max fc is the maximum power that can be delivered by the fuel cell source, while λ fc and λ rate are the weights of hydrogen level and fuel cell power change rate, respectively.As noted in [70], the cyclic efficiency of fuel cell generators is very poor; therefore, it is essential to reduce FC utilization as much as possible to maintain operational efficiency.At the same time, high values of λ FC , as demonstrated in (7), will penalize the power output of the FC, and as a result, the use of FC will be ensured only after the battery power becomes unavailable.Consequently, the system operating efficiency is enhanced.However, the electrocatalyst layer underneath the fuel shortage degrades over time.The fuel deficiency appears at the time of sudden change in FC power, which leads to electrode damage [73].In (7), sudden changes in power are limited to reduce degradation, as shown in the second term.The ease of using predicted load and generation in an MPC environment allows for the controllability of fuel cell output profile, in a way that minimizes the change rate.

1) SYSTEM CONSTRAINTS
From the equations ( 16) and ( 17) in [45], in this research (8) represents the generic dynamic model of the hybrid system.Its behavior differs based on the direction of power flow in the storage systems (discharge or charge).Similar models are not directly used in a conventional optimization problem.The system needs to be converted into a mixed logical dynamic (MLD) problem that includes logic variables, as shown in [74].The MLD formula is given in (9): z α (i) = δ α (i) P α , where z α and δ α are binary variables.δ α (i) ∈ {0, 1}.In case of δ α = 1 its an indicator that the battery is supplying energy to the microgrid (discharge mode) and vice versa when δ α = 0. α represents the assigned element and in this research is one of the HESS.The use of the binary variables in the optimization problem along with the quadratic expression transfers the problem into mixed integer quadratic programming (MIQP) [75].In [76] and [77] some techniques are suggested to solve the optimization problem such as Gurobi and BB (branch and bound).
P Bat (i) + P FC (i) + P wt (i) + P DG (i) Furthermore, in this research MPC is used.For some models the complexity in set point calculations prevents the implementation of MPC in various frameworks.This can be due to expensive processor technology that is required to solve 119170 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.the optimization problem within the selection period, or the processor code may trigger arithmetic problem solver alarms particularly in serious executions [78].

IV. CONTROL-ORIENTED MODEL FORMULATION
To design the MPC controller, a control-oriented linear model is firstly developed.The state-space representation for the hybrid energy storage systems (i.e., battery and hydrogen) is derived from (8).Thus, these state spaces are represented in this vector form x (t) = [SOC (t) LOH (t)] T , where SOC and LOH denote the state of charge and level of hydrogen for the battery and hydrogen tank, respectively.To avoid using binary variables, the battery and hydrogen tank systems are modeled using the following discrete equations [39]: By substituting d (t) = P wt (t) − P load (t) as the measured disturbance in (11), and therefore the hybrid energy storage equations ( 8) would be defined as below: The configuration being used involves hydrogen storage, P Elz , and P FC which are always positive.However, the latter two variables are complementary.These estimates are given in [79] and [80].In this research, the parameters, coefficients, and storage systems limits of ( 14) are illustrated.
Furthermore, to integrate the ESS hybrid system it is vital to develop the state-space matrices.Thus, from ( 12) and ( 13) the dynamic matrices for the hybrid storage system are expressed as follows [45]: As well, the control matrix B of the suggested SMG system is represented as follows: The OF including the manipulated variables, their change rates, and output variables with their perspective weights are shown in (13) and Table 3 respectively.Meanwhile, for safe operation of the system elements, the constraints that are depicted in Table 4 are imposed.The specifications and the values of the parameters used in energy management design for the studied hybrid system are based on [39] and [45].Likewise, the architecture of how the MPC is integrated with the various power signals and state/level of charge outputs for the EMS along with the methodology to finish the research are illustrated in Figure 8.
For the sake of simplicity, only the net hydrogen power is used as one variable that is denoted as P H 2 = P FC − P Elz .The manipulated variables become u (t) = [P H 2 (t) P DG (t)] T and the sampling time T s = 1.

FIGURE 9.
Exchanged power between the hybrid system elements including the hybrid storage systems and power disturbance, the renewable and load demand powers are taken from the real data of wind speed and load consumption, respectively, for early December for 24 h.

V. RESULTS AND DISCUSSIONS
In this section, a numerical simulation is performed to verify the controller using MATLAB @ software with the MPC toolbox that is available in the Simulink library.Four simulation scenarios were executed under various weather and load consumption conditions.The DESKTOP-8TFHA09 with the following specifications is used : 11th Gen Intel ® (Core (TM) i7-11700T @ 1.40 GHz 1.39 GHz, 32.0 GB RAM, 64-bit operating system, and x64-based processor.The various system components of the SMG used are indicated in Figure 3 with their corresponding constraints shown in Table 4.The values of the used parameters are based on [17].To finish the simulation, wind power and demand power are taken as disturbances due to their uncertain nature.The real data used in the study [17] is employed for the EMPC, with the characteristics mentioned in the techno-economic comparison section in Table 8.
The weights of the EMPC controller are shown in Table 3, which prioritize the dependency on the renewable system components over the diesel generator, based on the TABLE 3. Weighting factors of the manipulated variables, their change rates, and measured outputs.Moreover, the parameters of ( 12) and ( 13) values [39].These weights are used in (14) to indicate the significance of the control and output variables.TABLE 4. of the design elements for the hybrid ESS.These characteristics are obtained from the optimal design of the used SMG.The techno-economic analysis is conducted based on the well-known optimization software which is HOMER pro [17], [45].
availability of wind energy and the limits of the state of charge of the battery and level of hydrogen of the hydrogenbased equipment.Furthermore, the sampling time taken is T s = 1 s, and the step time considered the simulation is 15 mins which is displayed on the horizontal axis as an interval.For the time being, the total time to execute the simulation of this study is 24 hours, which is equivalent to one day.Furthermore, the prediction and control horizons are taken as 10 and 2 units, respectively, to fit the design while maintaining the system stability and the hessian matrix positive definite.It is worth mentioning that the MPC controller is tested for four major cases under different conditions.The data of wind speed and demand of the studied site are obtained every three months (i.e., December, March, June, and September) and integrated into the controller as disturbances.To test diverse loading and generating conditions, each first day of the specified month is experienced to validate the workability, controllability, and resiliency of EMPC with the hydrogen-based HRES.For the considered scenarios, low and high potential of wind power are executed to test the ability of MPC to manage energy between the system components and verify the response of the controller to feed the entire load from the available energy resources.
However, in this study, two figures are created for each case individually.The first figure displays the shared energy values achieved by implementing the EMPC controller, which optimizes the manipulated variables of the studied system.These shared powers are related to hydrogen power, ESS, load, wind power generation, and diesel generator.The second figure shows the evolution of ESS SOC and LOH due to the manipulation of DG power and hydrogen power, as well as the external input disturbances.

A. EMPC-BASED ENERGY SHARING IN EARLY DECEMBER CONDITIONS
The disturbance signals that are caused by external sources are based on the uncertainty of the wind speed and the nature of demand consumption by the consumers.Thus, to design a robust controller that captures these fluctuations, the disturbance is considered and integrated into the MPC block with suitable mechanisms.Meanwhile, the minimum average generated wind power is observed in March for the site under study due to the lowest speed of wind at this time according to the real data from SOLARGIS [81].Nonetheless, for this case, the weather conditions are considered for December.As depicted in Figure 4 the maximum and minimum produced power by the wind turbine units that are employed to convert the kinetic energy of wind into electric energy occur approximately at 09:00 am and 05:00 am, respectively, due to different wind velocities.Likewise, due to the variety of 119174 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.electric apparatuses, machines, etc., the power consumption nature varies with time and it is always fluctuating.Consequently, real data from the administrators of the proposed site are obtained, as plotted in Figure 5.The waveform of the load consumption in December is semi-homogenous as it seems to be a sine wave with distortions or harmonics.Therefore, the disturbance caused by these two signals (i.e., wind and load powers) is incredibly challenging to deal with.In this work, the need to design our MPC is critical to capture the distortions.To assess the robustness of MPC, the following discussion is developed.The discretized form of the hybrid system is formed in the time domain using the dynamic equations.Later, the characteristics of the optimally designed configuration in [17] and the weighting variables and parameters shown in Table 3 are used to implement the simu-lation.Yet, the linear time-invariant (LTI) system is initialized with the minimum SOC of the BSS and the lowest level of the hydrogen tank.
In Figure 9, the power exchange between the hybrid system elements including the hybrid storage systems and power disturbance, is demonstrated for 24 h in early December when the renewable and load demand powers are obtained from the real data of wind speed and consumption, respectively.In Figure 10, the SOC and LOH of storage devices as percentages for the early December weather conditions and load changes for one day are shown.As the disturbance power is the difference between the wind power and load demand d(t) = [Pgren (t) − Pload (t)], the minus disturbance from Figure 9 verifies that the energy produced from wind turbine units on the first day of December is continuously insufficient to supply the required energy for the load.As a result, the inclusion of storage systems is necessary, along with utilizing the existing DG units in the examined site to form the hybridized ESS and mixed electricity generation sources.Due to the lack of energy from the renewable source, the hydrogen-based system always supplies DC power to the load as FC generates electricity using hydrogen as a primary source of fuel.As shown in Figure 10, the highest SOC (%) and LOH (%) of battery and hydrogen storage systems are monitored at nearly 8:00 am and 9:45 am respectively.Meanwhile, at the time the LOH was at its highest state the disturbance was simultaneously high (i.e., 1.5 × 10^5 W), leading the FC to increase its contribution in demand supply, as shown in Figure 9. From 08:00 am to 09:00 am, the change in wind and load powers was zero (i.e., RE supply is equalized with demand), and as a result the LOH and SOC reduced as shown in Figure 9 and Figure 10 respectively.Additionally, at 10:00 am and 11:30 am, the DG unit and BES continued to share maximum powers of 2.5 × 10^5 W and 4.4 × 10^4 W, respectively.Furthermore, with the exclusion of the initial states, the minimum SOC (%) and LOH (%) of BES and hydrogen tank were obtained at 2:00 am and 11:00 am respectively as displayed in Figure 10.At these moments the EMPC determines the power share between the various devices of the hybrid system based on the weighting factors illustrated in Table 3 to develop a resilience system considering the constraints to maintain the limits of the system and protect the devices against degradation for lengthening their lifetime.For the assigned period of December, it is shown that the survivability of the system is guaranteed, and the entire demand is supplied with energy based on the schedule created by EMPC.It is worth mentioning that EMPC prioritizes supplying the load entirely from wind sources, followed by the DG unit due to two reasons.Firstly, the wind potential is very low, and based on the load following strategy, the storage devices are not allowed to be charged by the DG units as it is technically infeasible and impractical [82].Secondly, EMPC prioritizes based on the weighing coefficients and constraints of the HESS elements.

B. EMPC-BASED ENERGY SHARING IN EARLY MARCH CONDITIONS
Due to the variability in atmospheric conditions, wind speed is constantly changing, leading to fluctuations in wind energy production, as it is highly correlated with wind velocity as indicated in (1).Meanwhile, demand consumption is also unstable.Therefore, it is necessary to design a control system to manage the energy supplied to the load without any interruptions, which can be achieved by utilizing available sources as well as electricity-based and hydrogen-based storage systems.
However, the wind power and demand oscillations for the first day of March are illustrated in Figure 4 and 5.These variations are the main reasons for the input disturbances which are integrated into the EMPC controller to be considered in its internal plant model for output predic- tions and generating manipulating variables.Nevertheless, for early March, wind potential is reported to be the lowest compared to other shown periods.Meanwhile, as mentioned previously regarding early December wind power, the consumed energy in March is also like a distorted sine wave with harmonics, with a maximum and minimum demanded power of 3.5×10 5 W and 1.15×10 5 W, respectively.Furthermore, to test the survivability, controllability, resilience, and robustness of the employed EMPC for the hybrid ESS with RE sources and a DG, the exchanged powers between the hybrid system elements including the hybrid storage systems and power disturbance, renewable and load demand powers, are taken from the real data of wind speed and consumption, respectively, for the first day of March, as depicted in Figure 11.Additionally, the percentage of SOC and LOH for the early March weather conditions and demand variations are shown in Figure 12.
The LTI system is integrated into the controller, and the dynamic system contains integrators; therefore, it was essential to initialize the model.The minimum SOC and the lowest LOH are considered as initial values, as depicted in all related figures.From Figure 11, the disturbance power is negative due to the difference between the wind power and load in the time domain for the entire day, where the maximum disturbance obtained based on real data is observed to be 3.0 × 10 5 W from approximately 8:00 am to 12:15 pm, while demand was at its highest values and wind power was at its minimum values.During this time interval, the SOC (%) and LOH (%) were oscillating.Similarly, as the load is always greater than RE production, the hydrogen sources are always supplying the energy needs.Therefore, the FC is triggered continuously but the electrolyzer is always off as there is no excess energy to charge it based on the decision made by the controller according to the given weight coefficients.Furthermore, the DG unit is switched on for  the whole period to support the hybrid storage system and wind generators to cover the demand requirements.From Figure 11, the highest participation of DG occurred when the maximum disturbance occurred between roughly 8:00 am and 12:15 pm.The shared power is mainly decided by the controller to sustain the continuity of the supply and to avoid overcharge and over-discharge of the storage systems.The battery SOC (%) as in Figure 12 fluctuates as the battery responds to the energy needed by the system.However, from Figure 12 from 10:00 am to 01:00 pm the difference between WT generation and load demand was nearly constant (i.e., demand-supply balance status).Meanwhile, the LOH has not changed as an indicator that charging the hydrogen tank from FC source was same as supplying hydrogen from hydrogen tank to electrolyzer as depicted in Figure 12.Whereas SOC has reduced roughly 77% to 58% indicating that the battery was on discharging mode as demonstrated in Figure 12.In this research as suggested by [39], the battery is directly connected to the DC bus as presented in Figure 3 to cover the energy lacked by the available sources and hydrogen storage.In addition, the high rate of change in battery energy is due to charge or discharge which does not affect its degradation and its lifetime.However, the exchanged energy is managed by EMPC based on the design criterion [49].

C. EMPC-BASED ENERGY SHARING IN EARLY JUNE CONDITIONS
In early June, various weather conditions have significantly influenced the wind energy production.Similarly, demand consumption in June oscillates within the same day as the load varies depending on human activities regarding their energy needs.Therefore, these uncertainties in weather and load demand lead to an input disturbance that requires a robust controller to fix it.EMPC has a high ability to handle continuous changes, as it is categorized among the online 119178 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.optimization techniques that have the capability to minimize the objective function and generate optimal manipulated signals that are sent to the external plant model (i.e., HESS) to regulate the output signals within specified boundaries.Furthermore, EMPC decides the power sharing between the elements according to the system constraints and weighting factors that are used in the objective function.
Nonetheless, Figure 4 shows the real data of wind power variations under different weather conditions in early June, where the maximum produced energy is detected at roughly 07:30 pm due to the highest wind velocity at that time.In contrast, the lowest wind power production is almost reported between 08:00 pm and 10:00 pm.The maximum and minimum wind powers are almost 80 kW and 2.5 kW, respectively.Moreover, Figure 5 demonstrates the demanded power that is consumed during the first day of June, where the maximum load of 36 kW and minimum load demand of 1 kW at 03:00 am and 08:00 pm, respectively, are depicted.
The disturbance caused by RE generation and load variations has been adapted in the EMPC environment.In Figure 13, the exchanged power between the hybrid system elements, including the hybrid storage systems and power disturbance (i.e., the renewable and load demand powers taken from the real data of wind speed and consumption, respectively) for early June for the entire day, is demonstrated.Similarly, the SOC and LOH as percentages for the early June weather conditions and consumption nature for one day are displayed in Figure 14.
The largest disturbance, indicating insufficient power from renewable resources to feed the electric load, is identified to be 320 kW which occurs at 8:00 am, while the minimum disturbance is reported at 11:59 pm with a value of nearly 1 kW.During the time of peak disturbance, the EMPC controller compensates for the lacked power from WTs and the remaining system elements.The DG unit, FC, and battery share powers of 270 kW, 15 kW, and 30 kW, respectively, as the SOC and LOH are detected to be within their specified limits to protect these devices against degradation.The values of the SOC and LOH at 05:00 am are 60% and 85%, respectively, as indicated in Figure 14.Furthermore, from 08:00 pm to 09:00 pm, the increment in power disturbance signal is met with changes in DG, hydrogen power, and battery powers as displayed in Figure 13.During the same period of time the LOH has continued to reduce linearly, and the battery power decrement has led to a reduction in SOC as clarified in Figure 14.The hydrogen system within the sampled interval is always energizing the DC bus as the electrolyzer is switched off due to higher demand than RE generation.DG and battery supply the load consumption with different oscillated values as the disturbance is significantly varies with time.The fluctuations in the battery power and SOC occur because the battery is directly connected to the DC bus to compensate for the shortage in power supply when the hybrid storage systems and DG unit cannot supply the load demand requirements.In the case of early June variations, as depicted in the figures the exchanged power is decided by the EMPC based on the utilized weighting factors in the objective function, and it is noteworthy mentioning that the design constraints are completely satisfied.Likewise, EMPC was able to manage the energy between the elements during the entire day by minimizing the control signals and acquiring the bounds of the battery and hydrogen storage devices.

D. EMPC-BASED ENERGY SHARING IN EARLY MARCH CONDITIONS
To assess the impact of disturbances on the hybrid model outputs and technical constraints, the wind power and load demand for September were considered.Both signals exhibit   significant fluctuations, presenting challenge for the controller to maintain the SOC, LOH, hydrogen power, and DG unit power within their specified ranges.As shown in Figure 4, wind power reaches its highest values during midday periods in September, with the remaining periods exhibiting the lowest values.That graph shows a distribution similar to a normal distribution.Similarly, Figure 5 shows significant fluctuations in load consumption, with the highest and lowest demand occurring at 05:30 pm and 03:30 pm, respectively, with approximate values of 590 kW and 0.10 kW.The peak wind power and highest demand occur at different times, resulting in an increase in disturbance power that may cause violations in output limits and constraints if the controller is not robust enough to handle these issues effectively.For this selected period, EMPC was employed with the same design criteria as in the previously analyzed periods.
Nonetheless, Figure 15 illustrates the exchanged power between the hybrid system elements including the hybrid storage systems, power disturbances, the renewable and load demand powers, which are based on real data of wind speed and consumption for early September for the entire day.Due to insufficient supply from the RE source (i.e., WT), the disturbance is negative for the entire testing time of 24 h, and as a result, the other power units respond to this shortage in energy by feeding the demand from the HESS.Moreover, the energy from the storage devices is supplying a portion of the load, and as a response, the DG units continuously deliver power to meet the load demand.Furthermore, Figure 16 displays the SOC and LOH as percentages for the early September weather conditions and electric demand variations for one day.It is observed that the consumption of DC power from the FC is constant for most of the day except for short periods, and these changes are due to the demand needs.The exchanged power between the battery, FC, and DG is determined by EMPC based on the weighting factors given in Table 3, which prioritize renewable-based resources [45].
As displayed in Figure 15 and Figure 16, from 03:00 till the end of the day the disturbance power increases nonlinearly.Also, the LOH is almost constant at that time being and the SOC oscillates due to the uncertainties in weather conditions, load demand, HRES limits, and EMPC working decision.Additionally, the constraints of the manipulated variables, as specified in Table 4, are satisfied.The EMPC is able to robustly share the energy within the hybridized system while maintaining the state of charge and level of hydrogen within their specified values, as depicted in Table 3.Consequently, EMPC has proven to be a winning solution for utilizing the entire wind power to meet the complete electric demand.Meanwhile, the storage devices are guaranteed to last longer as EMPC avoids undercharging, overcharging, and protects them against degradation.

VI. VALIDATION AND COMPARISON OF THE PROPOSED DESIGN WITH THE LITERATURE
To better validate the EMPC applied to the optimized SMG system components, a comparison is made with various MPC families based on the aggregate objective function.The LOH, SOC, and constraints must also be maintained within their allowed technical values.
119182 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.Additionally, different weather conditions for the first day of the studied months are compared based on the average, minimum, and maximum objective function values.
However, in [83], using MS-MPC, TB-MPC, MPC, and CC-MPC resulted in aggregate objective function values of 1.60 × 10 7 , 1.59 × 10 7 , 1.90 × 10 8 , and 1.96 × 10 7 , respectively.In Table 5, the average objective function values for each weather conditions and consumption fluctuations based on the employed robust controller EMPC are reported.The minimum average objective function value is found to be 12.770 × 10 3 , confirming that EMPC is superior for the suggested hybrid ESS with mixed energy source generations.Notably, the minimum and maximum values in Table 5, are computed based on the prediction and control horizons for the entire day for each sampling time.The various values are due to diverse disturbance values caused by wind and load powers and due to the constraints of the manipulated variables.
Tables 6 and 7 depict the SOC and LOH for the four studied cases through the entire day, respectively.It is evident that the maximum and minimum bounds of the hybrid ESS are kept within their adjusted ranges, as justified in [37], as demonstrated in Figure 17.Consequently, the technical performance is improved, and degradation concerns are minimized to operate for a longer lifetime.Ultimately, the application of EMPC to the optimally designed hybrid energy storage systems with wind source and diesel generator unit has proved to be a robust and reliable operation of the system components when the hydrogen power and diesel generator power are considered as manipulated variables due to easily adjust the power calculated by the controller.The constraints of the SMG are maintained, as shown in Figures 17 and 18, in which the maximum and minimum bounds are illustrated.

VII. CONCLUSION
In this research, MPC is employed for a standalone, optimally designed microgrid located in a western locality in the Kingdom of Saudi Arabia.The microgrid studied consists of a WT generating system, electrolyzer, fuel cells, hydrogen tank, and lithium-ion battery.Meanwhile, DGs are configured with the microgrid components to form a HRES in which the load consumption can be met entirely when the RESs and HESS powers are behind the electric demand.
To substantiate the execution of EMPC, four cases with low and high wind potential and load profiles are examined in this research.The conclusion of this work can be highlighted as follows: • EMS is established with the consideration of power disturbance caused by uncertainties in wind power and load consumption.These various weather conditions and their corresponding electric load consumption are exposed to the designed EMPC for 24 hours using real data.
• The disturbance signal, which is the power signal in this EMS for the suggested SMG, is calculated based on the wind power and load power as d (t) = [P wt (t) − P Load (t)].From the presented data of early December, March, June, and September, the maximum and minimum disturbance powers are reported at 03: 00 pm and 01: 00 am with values of 340 kW and 100 kW for September and December cases respectively.The readability of the disturbance signal is done and fixed by EMPC.
• The power of the battery storage device and hydrogen source is always positive as the wind power is lower than demand consumption, and the power limits of each ESS are maintained during the proposed periods.
• The DG system supplies power to the DC bus through converters.Therefore, in the designing process, the lower capacity of DG is kept positive enduringly.The simulation showed that the maximum and minimum values decided by EMPC were observed at 02: 45 pm and 11: 59 pm with values of 290 kW and 10 kW for September and March cases, respectively.
• From the simulation results the observed minimum and maximum SOC are 20% and 88.52%, respectively, whereas for LOH, they were 10% and 90.06% for the entire studied period, which confirms the robustness of the EMS managed by EMPC.
From the simulation results and discussions, it is shown that the EMS controlled based on EMPC can deliver sufficient energy to the load demand.In addition, acquire the technical and economic concerns regarding the ESS by guaranteeing longer lifetimes of these storage systems.The enclosure of DG has assisted in preventing grid establishment charges for the islanded mode and responding to the lack of power from the intermittent wind source.Nevertheless, it is recommended to consider the followings as future works: • To develop a demand side management system (DSM) to curtail insensitive loads during the peak periods to relax power generated from DG specifically during the whole studied period where wind production is drastically lower than demand consumption.
• Different studying periods can be examined and compared using different MPC techniques.
• Voltage and frequency control for the optimally constructed SMG can be implemented with the use of power electronic converters.

FIGURE 2 .
FIGURE 2. Control structural diagram of RESs based microgrids with the inclusion of energy storage system (ESS).

FIGURE 3 .
FIGURE 3. Power flow diagram of the suggested configuration.

FIGURE 4 .
FIGURE 4. Wind power variations under different weather conditions in the early specified months[17].One interval equates to 15 minutes and therefore the entire day is represented by 96-time intervals.

FIGURE 5 .
FIGURE 5. Electric demanded power variations under different weather conditions in the early specified months[17].One interval equates to 15 minutes and therefore the entire day is represented by 96-time intervals.

FIGURE 6 .
FIGURE 6.The maximum and minimum wind power generation, disturbance power, and demand power for the specified periods within 24hrs.of the HESS are met.This type of problems is classified as a predetermined horizon optimization problem, where MPC is exceptional in solving such problems.Meanwhile, the control-oriented paradigm is constructed off-line, and is kept unchanged throughout the simulation.The accuracy of the model predictive is acceptable regardless of whether the system is non-linear or linear.Due to the high nonlinearity nature of HESS model, MPC is used to address the degradation issues by adjusting the prediction model in its interior plant model.Moreover, MPC structure allows the optimization objective function and model variables to evolve in respect to time.In each time-interval, linearizing HESS model yields the state space model under the current operation circumstances[65],[66].

FIGURE 7 .
FIGURE 7. Generic schematic illustration of MPC methodology in microgrid system.

FIGURE 8 .
FIGURE 8. Schematic methodology of the hybrid system with energy management system based on MPC.

FIGURE 10 .
FIGURE 10.State of charge and level of hydrogen of storage devices as percentages for the early December weather conditions and load changes for one day.

FIGURE 11 .
FIGURE 11.Sharing of hydrogen power, DG power, and battery power on the SMG for the case of early March characteristics.The disturbance power has been given as real data that relates to the geographical location of the study.

FIGURE 12 .
FIGURE 12. SOC (%) and LOH (%) of the battery and hydrogen systems, respectively, under early March climatic situations.

FIGURE 13 .
FIGURE 13.Hybridized SMG exchanged power amounts its components to supply the electric demand with fully utilization of wind power.The real data are obtained from SOLARGIS and the transport company administrators.The simulation is conducted for the 1st day of June circumstances.

FIGURE 14 .
FIGURE 14. Graphical representation of LOH and SOC as percentages as a result of SMG elements changes.

FIGURE 15 .
FIGURE 15.Exchanged power between the hybrid system elements for early September for the entire day.

FIGURE 17 .
FIGURE 17.The obtained maximum and minimum SOC (%) and LOH (%) of the HESS for the designed SMG.

FIGURE 18 .
FIGURE 18.The maximum and minimum power values for the SMG elements based on the designed EMS that is simulated for 24 hrs.
α (i) Boolean variable.P wt (i) A State variables coefficient matrix.C Output variables coefficient matrix.B d Disturbance signals coefficient vector.SUPERSCRIPT max Maximum value.min Minimum value.− Negative electron.+ Positive electron.119162 VOLUME 11, 2023

TABLE 1 .
Literature review on fuel cell-based hybrid renewable energy designs.

TABLE 2 .
A literature review on the accomplishments based on model predictive control.

TABLE 5 .
Parameters of optimal control signal of EMPC.

TABLE 6 .
The level OF hydrogen (LOH%) under different weather conditions for one tested day.Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

TABLE 7 .
The state of charge of the battery (SOC%) under different weather conditions for one tested day.
119181Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.