Enhancing the Hybrid Microgrid Performance with Jellyfish Optimization for Efficient MPPT and THD Estimation by the Unscented Kalman Filter

,


Introduction
Microgrids (MGs) are a key component of the modern power grid and have garnered signifcant attention in recent years. Tey involve the continuous interaction and integration of energy generation, storage, and consumption devices within a distributed energy system [1]. Te use of direct current (DC) in microgrids has been gaining attraction as a means of expanding the range of power resources, storage capacity, and load available [2]. In comparison to alternating current (AC) microgrids, DC microgrids ofer several benefts, including the ability to connect distributed generation and load sources such as storage energy systems (SESs), photovoltaic systems, electrolyzers, fuel cells (FCs), light-emitting diodes (LEDs), and charging stacks without the need for DC-AC conversions, resulting in improved efciency. Photovoltaic (PV) units, which convert solar radiation into DC electrical power, are particularly well suited for distributed applications and are environmentally friendly, making them an excellent choice for remote telecommunication networks. However, the ability to store excess renewable energy to ensure the uninterrupted power fow remains a crucial criterion for such hybrid power systems. Despite signifcant progress in energy storage technology, factors such as volume, cost, and disposal limitations continue to hinder its use in standalone, remote operations. Te development of fuel cell technology with electrolysis has increased the feasibility of using hydrogen as a fuel storage medium. Hybrid renewable energy systems based on these alternative energies have been shown to be a viable option for standalone power production in remote areas [3]. In recent years, a range of factors, including environmental concerns, rising power demand, improved network stability, and the need to reduce power generation costs, have contributed to the rapid growth of distributed energy resources (DERs) in the feld of electrical energy technology [4]. DERs such as fuel cell technology, wind turbines, and solar energy have been promoted as desirable solutions for developing a sustainable energy economy while also being environmentally friendly. However, solar panels and wind turbines rely on environmental conditions for energy production, resulting in signifcant uncertainty and variable output. As a result, the power output of these systems cannot always be guaranteed, posing a risk to grid stability, particularly in noninterconnected areas. To address this, one approach is to integrate these systems with efective energy storage systems (ESSs) to manage excess or insufcient energy, as described by Michaelson et al. [5].
Electrochemical hydrogen produced from renewable energy sources appears to be a promising option for fuel cell (FC) technology. It allows for the production of hydrogen without emitting CO 2 . Te efciency of the storage system is infuenced by the number of layers used, and the energy storage capacity is determined by the technology used asbring into notice by Michaelson et al. [5]. When hydrogen and battery are combined for storage, both technologies beneft; the batteries increase the energy capacity, while the hydrogen system has a higher power density, as described by Zhang et al. [6]. A microgrid can operate in either the continuous or islanded mode and transitions between these two modes can be smooth, as demonstrated by Baghaee et al. [7]. Te power system generally defnes the network frequencies and bus voltage in a microgrid with generators; so, the main role of each distributed generation (DG) unit is to produce a predetermined amount of real and reactive power. Te microgrid also provides efective voltage regulation. In a grid-connected state, the microgrid acts as a supporting unit for the grid. Te use of DC microgrids in the islanded mode ofers several benefts, including improved power quality, reduced system losses, and increased reliability [2]. Also, to maintain system reliability in the islanded mode operation, the microgrid must ensure the efcient transfer of energy among distributed generation (DG) units, loads, and energy storage systems (ESSs) [8]. To meet local load demands in the islanded mode, DG units must generate excess power. However, the integration of renewable energy sources and energy storage systems into microgrids can be complex, and there are several technical and economic challenges that need to be addressed. Tis research aims to address these challenges and provide evidence for further study on this topic.
Tis study focuses on the following: (1) Modeling and simulating the integration of photovoltaic (PV), battery, fuel cell (FC), and DG with the grid using efective optimization techniques. (2) Developing a novel method for tracking the maximum power point of solar power using the jellyfsh optimization technique and comparison being done with particle swarm optimization under the partial shading condition. (3) Testing the performance of the control strategy through the measurement of total harmonic distortion (THD) and the battery management system using unscented Kalman flters.
Te rest of this article is structured as follows. In Section 2, we provide a review of the relevant literature on the various components of the proposed grid-integrated system. In Section 3, we examine the modeling and problem formulation of the proposed control systems for the microgrid under various operating conditions. In Section 4, we present and discuss the simulation results. Finally, in Section 5, we present the conclusions of our work.

Overview of MPPT Techniques.
Te goal of using photovoltaic (PV) systems is to improve efciency by operating them near their maximum power point (MPP). Tis requires the use of maximum power point tracking (MPPT) controllers, which are essential in PV energy systems as they maximize the power output from a PV system for a given set of parameters while minimizing overall system costs. Many MPPT strategies have been proposed and implemented, including traditional methods such as the perturb and observe (P&O) and incremental conductance (IC) approaches. Tese techniques are used to monitor the MPP of PV systems in order to optimize their performance. Some of the bioinspired algorithms such as "particle swarm optimization (PSO)" [9], "frefy algorithm (FA)" [10], "marine predator algorithm (MPA)" [11], "mayfy algorithm (MF)" [12], "jellyfsh optimization (JS)" [13], grey wolf optimization (GWO) [14], artifcial bee colony (ABC) algorithm [15], and ant colony optimization (ACO) [16] are used efectively in the deployment of MPP search strategies and the trajectory tracking control. Particle swarm optimization (PSO) is a computational approach for solving problems by iteratively improving a proposed solution. Tis involves starting with a set of randomly generated potential solutions, called particles. Te next position of each particle is determined by the combination of its current best position and the best position of all other particles. Te particle's position and velocity are updated iteratively based on a mathematical model, as described by Abdullah et al. [17]. According to Verma et al. [18], the Kalman flter (KF) has two phases: prediction and correction. It can be used to predict the maximum power point (MPP) voltage (Vmp) and then adjust it based on the diference between the estimated and observed PV power. Ishaque [19] noted that the use of fuzzy logic control (FLC) within an MPPT algorithm can be enabled, and the model of the system is not required when using FLC. Fuzzy logic control (FLC) allows for the efective management of setpoint variations, nonlinearities, and imperfections. Te artifcial bee colony (ABC) algorithm uses three types of bees: worker bees, spectator bees, and scout bees. Worker bees are responsible for identifying and sharing specifc food sources. Spectator bees gather information and locate the best food source. Scout bees conduct ad hoc searches for new food sources. Te ABC method has a fast-tracking response and rapid convergence, which makes it well suited for PV systems with partial shading, as demonstrated by González-Castaño et al. [20]. Dhivya and Kumar [21] proposed the use of the frefy algorithm (FA) for MPPT, which is inspired by the motion of frefies. Te MPPT algorithm is initialized with system parameters, and the frefies are periodically released with variable duty cycles ranging from 2% to 98%. Te DC-DC converter is turned on and of based on the position of each frefy, and the power is recorded to determine the location of the maximum energy output. Titri et al. [22] suggested that the ant colony optimization (ACO) method can be used to fnd approximate solutions for complex optimization problems. Mohanty et al. [23] proposed the use of the grey wolf optimization (GWO) method, which is a metaheuristic inspired by the hunting behavior of grey wolves. [24] suggested the use of diesel generators (DGs) as a way to operate autonomously or in conjunction with the centralised electric power distribution system, located near areas of electricity consumption. DGs ofer several benefts, including the reduced risk of loss due to grid outages, improved frequency and voltage stabilization in the electric power distribution system during changes, and the ability to utilize power reserves in the electric power distribution system. When compared to traditional electricity systems, operating a DC microgrid ofers these advantages; however, operating diesel generators has several drawbacks, including an increase in short-circuit current, complexity of protective and automation devices, and the risk of an unexpected disconnection from the electricity grid, which can result in signifcant disruptions to the electric power system, as noted by Luna et al. [25]. Zubo et al. [26] have shown that optimal DG allocation can reduce transmission losses and improve the voltage profle, leading to improved system reliability, loadability, voltage stabilization, voltage security, and system reliability. Fuel cells have gained popularity in recent years due to their lack of toxic emissions and the fact that they do not need to be reflled; as long as the fuel is available, they can produce power and heat [27]. Fuel cell technology has many benefts, including the ability to use a wide range of fuels, high energy conversion efciency, and clean renewable energy production [28]. Tey are suitable for a variety of application areas, such as mobile power providers, standalone power systems, and transportation applications, and can serve as an alternative energy source to traditional energy sources [29]. As a result, fuel cell modeling is important for improving efciency and cost management in battery technology. Fuel cells are electrochemical energy conversion devices that convert chemical energy from a fuel into electrical energy without the use of moving parts. Tere are several types of fuel cell technologies, including phosphoric acid fuel cells, direct methanol fuel cells, solid oxide fuel cells, molten carbonate fuel cells, and proton exchange membrane (PEM) fuel cells [29]. Tese technologies ofer a range of benefts, including the ability to use a variety of fuels, high energy conversion efciency, and clean power generation. A fuel cell consists of a blend of electrolyte and two distinct electrodes (anode and cathode). Te porous electrodes are placed between two solid electrolytes made of composite materials, and the fuel cells have completed the operating process by reducing oxygen to create oxide ions in the cathode electrode. Te oxide ion subsequently passes through the solid polymer electrolyte towards the anode electrode, completing the chemical oxidation reaction and producing the electrons [30].

Integration with Electric
Microgrids. IEEE has developed several specifcations for the integration of distributed energy resources (DERs) into electrical grids. Microgrids can operate in both grid-connected and islanded modes, and the controller must balance the technical, economic, functional, and environmental considerations of the various resources. DC microgrids ofer the advantage of combining power sources with efcient technologies to address the diverse and often conficting interests of stakeholders in order to achieve optimal microgrid operations, as described by Barelli et al. [31]. Efective microgrid management solutions involve the regulation and control of DERs and loads, as well as communication with external grid monitoring and forecasting systems. Kiran et al. [32] suggest that microgrids can efectively participate in the power system through the use of dispersed energy sources in the distribution grid.

Battery Management and Modeling.
Te goal of an energy management system (EMS) is to provide the demand load from distributed generators (DGs), energy storage systems (ESS), and the power grid in the most cost-efective manner possible. A variety of variable inputs, such as load voltage, output power from photovoltaic (PV) and wind turbines, system limitations, state of charge (SOC) of batteries, operating and maintenance costs of each DG, ESS, and network costs suggested by the utility, are taken into consideration by the EMS [33]. Using an optimization approach, the EMS receives these inputs and determines the most optimal settings for the ESS and DGs. Te specifc type of ESS to be implemented depends on the selection and the intended use of the storage system. To optimize the performance of an energy storage system (ESS) and regulate the voltage output, it must be connected to a bidirectional rechargeable battery. Te combination of a photovoltaic system with an ESS and an EMS can provide optimal energy routing in day-ahead markets, as demonstrated by the research. Te interior search algorithm (ISA) has been implemented within the EMS to minimize the optimal solution based on operating expenses [34]. Te ISA has been utilized to reduce reliance on grid power during times of high energy tarifs by using other resources within the MG to meet the load demand and to increase grid electricity utilization during times of low electricity tarifs to save on operating costs. As a result, the ESS is charged and discharged based on electric pricing slopes.

THD Calculation Using Various Techniques.
Harmonic frequencies in power systems can be caused by the integration of power converters, PV, and wind power plants, as well as the increasing prevalence of nonlinear loads. Tese harmonic frequencies can lead to power quality issues, such as voltage, current, or frequency irregularities, causing specialized equipment to malfunction. Te total harmonic distortion (THD) is a measure of the distorted energy losses caused by nonlinear loads disrupting the currents and voltages [35]. Te THD can be calculated as the efciency-driven harmonic voltage (THDv) or current in a distorted wave. Harmonic analyzers can also be used to gather data on the real power factor, total harmonic currents, and reactive and distortionary energy losses. Tese measurements can be made onsite using frequency detectors with hardware for data collection and built-in software algorithms. However, it is important to note that simply adding shunt capacitors at the unity power factor may not efectively address harmonic distortion and may even exacerbate the problem. Signal processing-based techniques harmonic analysis algorithms include "fuzzy logic," "adaptive wavelet neural networks (AWNNs)" [36], "artifcial neural networks (ANNs)" [36], "variable leaky LMS (VLLMS)" [37], "bacterial forage optimization (BFO)" [38], "estimating signal rotational invariance techniques (ESPIRITs)" [39], and "Taylor-Kalman-Fourier and least mean square (LMS) techniques" [39]. Te basic current-voltage (I-V) characteristic equation of a solar cell includes parameters such as I ph , I rs , I o , I, V t , and I sh , as outlined in references [40,41]. Te fve parameters are termed as generated photocurrent (I ph ), diode ideality factor (ƞ), saturation current (I o ), series resistance (R s ), and shunt resistance (R sh ), which are the important parameters of the PV module and derive the I-V characteristic of the PV module. Te total cell current is given by

Modeling and Problem Formulation
(1) Ns is the number of cells, V t is the junction thermal voltage and can be expressed as Vt � (kƞT/q), where k is the Boltzmann's constant equal to 1.38 × 10 -23 J/K, q is the electron charge equal to 1.602 × 10 -19 C, T is temperature in kelvin, and ƞ is the ideality factor constant. Most of the PV manufacturers provide datasheet values at the standard test condition (STC), i.e., at an irradiation of 1000 W/m 2 and a temperature of 25°C. As it is not possible to have a big PV plant to study the characteristic of the PV module, we need to have a PV model and for that, MATLAB/Simulation software is used for designing the PV module and the script fle is used for JFO optimization. Te PV cells, which are the smallest units of the PV module, have a low power rating that cannot be used for high-power generation. Terefore, these cells are interconnected in a series-parallel confguration to form a module. Te basic current-voltage (I-V) equation of a solar cell includes the parameters I ph , I rs, I o , I, V t , and I sh , as described in the previous research [40,41]. Te module's specifcations and I-V and power-voltage (P-V) characteristics (Figures 2(a) and 2(b)) were obtained at an irradiance of 1 kW/m 2 and a temperature of 25°C. It is important to note that changes in temperature and irradiance can afect the open-circuit voltage (V OC ), short circuit current (I SC ), efciency, and operating point of the MPP.

Diferent Maximum Power Tracking Controllers.
By operating the module at its full output, MPPT improves the PV performance [42][43][44][45][46][47]. Conventional MPPT techniques, such as perturb and observe (P&O) and incremental conductance (InC), have been shown to introduce oscillations in   International Transactions on Electrical Energy Systems the MPP region and struggle to track fast temperature and irradiance variations [48]. Artifcial intelligence (AI) techniques, such as fuzzy logic control (FLC) and artifcial neural networks (ANNs), have been shown to perform better than conventional methods due to their self-learning approach and ability to handle dynamic conditions [49]. Hybrid MPPT methods, such as neurofuzzy networks (NFNs) and adaptive neurofuzzy inference systems (ANFISs), have also been shown to have better responses than AI techniques. In this study, we compare two bioinspired optimization techniques, artifcial jellyfsh optimization and particle swarm optimization, for their efectiveness in MPPT as represented in Table 2, and by Table 3, we can get the advantage and disadvantages of various optimization techniques.
(1) MPPT Tracking System by Using the Jellyfsh Optimization Technique. Jellyfsh search (JS) is a metaheuristic optimization algorithm inspired by the behavior of jellyfsh in the ocean. Te algorithm as shown Figure 3 works by using a time control system that includes a constant C o and a time control function c (t) to regulate the movement of jellyfsh between following ocean currents and traveling within swarms. Te time control system generates random values between 0 and 1 to mimic the search for food in the ocean, with the location and related objective function infuencing the amount of food collected. Wilcoxon rank sum analysis has demonstrated the ability of JS to identify optimal parameters in large mathematical operations. Te jellyfsh swarming (JS) algorithm begins by setting the objective function and population size and iterating through the system a specifed number of times. Using a chaotic map, the initial positions of the jellyfshes are determined based on their distance from a specifc location, and the initial control time of the sequence is initialized as 1. Te control time is then compared to 0.5 to detect the presence of ocean currents. If the jellyfsh is following the current, the new location is determined based on the ocean current. On the other hand, if the jellyfsh is moving within the swarm, the new location is determined using passive and active motion behaviors. Te results of the algorithm are then analyzed and visualized to identify the best output. In the context of optimizing a photovoltaic (PV) system, the JF algorithm is used to fnd the maximum power point tracking (MPPT) of the PV system. In the PV system, the electrical components such as the PV panel, DC-DC converter, and environmental conditions represent the devices in the JF algorithm.
Te objective of the JF algorithm is to fnd the optimal values of the electrical components that maximize the power output of the PV system. In the case of applying the jellyfsh optimization (JF) algorithm, the block of input data specifcation included in the paper are the following parameters: (ii) DC-DC converter specifcations: this includes the input voltage range, the output voltage range, and the efciency of the DC-DC converter.
(iii) Environmental conditions: this includes the temperature, irradiance, and shading conditions. Te input data specifcation should provide the range and variation of these conditions to simulate different scenarios. (iv) System components: this includes the energy storage system, fuel cell, and diesel generator.
(v) JF algorithm parameters: this includes the population size, movement range, search range, and   International Transactions on Electrical Energy Systems Table  3: Comparative merits of the bioinspired algorithm used in MPPT.

MPPT techniques
Advantages Disadvantages Particle swarm optimization It has high potential due to its simple structure, easy implementation, and fast computation capability. PSO is the most intelligent and efcient technique, which tracks the GMPP during all PSCs Dynamic response speed is low, random oscillations are caused by the random numbers rooted in the PSO velocity, and PSO is related to random variables; if the random values are too small or too high, then optimal solution fall in the local optimum value and MPP get disturbed Modifed PSO Te IPSO in the GMPPT under the PSC is improved signifcantly and the number of iterations is minimized, and the tuning efort is also minimized with respect to PSO Complexity of the system increases, and the values of w; Φ′ in satisfy the convergence of searching particles at each initial position and each initial velocity Ant colony optimization Te fow of an implementation of this technique, including parameters, is to be considered initially. It saves computation time and has excellent tracking capability with high accuracy, zero oscillations, fast convergence, and very high robustness One additional parameter to set compared to PSO, and more ants mean it is easier to fnd the GMPP under diferent irradiance conditions, while it requires more time to transfer all the ants into the MPP Artifcial bee colony ABC is also a widely known technique for solving the 2D space global optimization problems. It has fast convergence, better robustness, low computational cost, and high accuracy Take longer time to settle and produce random oscillation at the output of the converter Genetic algorithm For real-time nonlinear and multimodal objective function problems, it has high robustness and wide applicability to track the GP with good performance with less implementation cost GA is not very stable and sometimes still fnds the local optimal solution, complex than PSO, and have slow tracking speed due to the series format for applying each particle in the population and initial conditions dependent Salp swarm algorithm Is able to improve the initial random solutions efectively and converge towards the optimum, and one slap chain is used Only saves one solution as the best solution, so it cannot store multiple solutions as the best solutions for a multi objective problem Memetic salp swarm algorithm MSSA is simple and easy to implement, and multiple solutions as the best solutions for a multiobjective problem is possible But complexity and cost increases in that respect Grey wolf optimization Higher tracking efciency with the elimination of transient and steady state oscillation δ and ω much in hunting the prey. Tis extends to a higher population of search agents which take much time for tracking the optimal solution Enhanced grey wolf optimization It is noticed that the EGWO algorithm tracks the global MPP with more accuracy with less tracking time Diferential evolution No random numbers are used, only one tuning parameter is required (mutation factor), and has implementation simplicity. DE is more efcient in terms of accuracy, tracking speed, convergence speed, and efciency Parameter selection is an important responsibility for a designer Cuckoo search optimization In comparison to PSO and DE techniques, the CS method has more efcient randomization and faster convergence and has fewer parameters needed and is independent from initial conditions CS sufers from the random step, and the power is clustered into low-power, high-power, and normal zones. Due to undesired and abrupt changes of the duty cycle, it causes oscillations and yields undesired glitches in the output power Adaptive cuckoo search optimization Efciency of CS can be improved by using the updated switching parameter strategy, and a large number of initial populations yield faster convergence, so initial population was increased.  Bat algorithm Tis method is robust in its operation and provides a superb performance for the change in load torque, radiation, and temperature compared with the PSO method No mathematical analysis to link the parameters with the convergence rate, and accuracy is limited if number of function evaluation is not high Dragonfy Te algorithm is system autonomous, high performance with regards to tracking accuracy, and convergence speed has high ability to get global MPP and removes the power fuctuation around MPP and DFO, 46% faster than P&O Such as the overfowing of the search area and interruption of random fights due to its big searching steps Jaya algorithm Te method shows that it has a superior result compared to the PSO method and has high tracking efciency and dynamical fexibility Random number is generated in the jaya algorithm that sometimes produces the possible negative solution, which sometimes reduces the efciency of MPPT Cat swarm optimization Te algorithm is system autonomous, high performance with regards to tracking accuracy, and convergence speed has high ability to get global MPP and removes the power fuctuation around MPP If the current best position is a LMPP, it will be a disadvantage, which leads to premature convergence. In view of this, the current best position should be ensured to lie in the vicinity of GMPP as much as possible.

Premature convergence occurs in MPP tracking
Whale optimization algorithm (WOA) Te WOA is better in terms of tracking than the SA method If the random values are too small or too high, then the optimal solution falls in the local optimum value and MPP get disturb convergence criteria. Tese parameters can be tuned to optimize the performance of the algorithm for the specifc PV system and environmental conditions. (vi) Performance metrics: this includes the objective function used to evaluate the performance of the algorithm such as the maximum power point tracking efciency, harmonic distortion, and total harmonic distortion.
Overall, the block of input data specifcation should provide a comprehensive description of the PV system and environmental conditions, as well as the JF algorithm parameters and performance metrics. Tis information can be used to simulate and optimize the performance of the PV system using the JF algorithm. Te mathematical modeling of the JS algorithm is described in the following equations. Te corresponding formulae are for the jellyfsh search (JS) optimizer.
(a) Calculation of the ocean current: Where β > 0, μ is the mean location of all jellyfsh, and β is the distribution coefcient. Jellyfsh are attracted to water currents because they provide a rich source of nutrients. According to equation (2), the movement of an ocean current can be represented as the aggregate of all directions taken by the jellyfsh within the ocean towards the optimal point where the jellyfsh is currently located. (b) Updated location of each jellyfsh is given by the following: During the initial formation of the swarm, most of the jellyfsh exhibits type A movement patterns. Over time, they begin to exhibit more type B movement behaviors. Active motion refers to the movement of a jellyfsh within its own area, and equation (3) provides the updated position for each jellyfsh based on this movement. Te location of each jellyfsh is updated as a result of this process, where c > 0 is the motion coefcient. (c) Direction of motion and the updated location of a jellyfsh: Tis process allows each jellyfsh in the swarm to move in the most efcient direction to locate food. Equation (4) models the jellyfsh's movement and updated location based on the optimal direction, resulting in a successful search within the local area. (d) Te time control mechanism: Te time control function c (t) and the constant C o are used to identify the type of motion occurring at a given time. Tis time control system not only regulates the type A and type B swarm movements but also controls the jellyfsh's movement towards an ocean current. (e) Limit of jellyfsh in a search space area.
X i,d represents the location of the i th jellyfsh in the d th dimension, and X i,d is the updated location after enforcing boundary constraints. To defne the boundaries of the area, certain boundary conditions related to the jellyfsh's ocean current are specifed in equation (6).Te algorithm works by mimicking the motion of jellyfsh in the search space, and the electrical components in the PV system represent the devices in the algorithm. Table 4 summarizes the correspondence between the components of the photovoltaic (PV) system studied and the corresponding components and parameters used in the jellyfsh optimization (JF) algorithm: In the abovementioned table, we can see that the PV panel is considered as the candidate solution (in optimization problems, a candidate solution is a set of values for the decision variables that represents a possible solution to the problem) in the JF algorithm, which is used to search for the optimal values of the decision variables (the duty ratio, PV voltage, PV current) that maximize the power output of the PV system. Te DC-DC converter is used as the solution update rule, which moves the candidate solutions in the search space based on the active and passive motions of jellyfsh. Te energy storage system, fuel cell, and diesel generator are not considered in the JF algorithm and are outside the scope of this study.
Te objective function for maximizing the power output in a photovoltaic (PV) system using the jellyfsh optimization (JF) algorithm can be expressed as follows: It will track the maximum power point function [max_P, max_V] � max_val (P, V), where f (x) is the ftness function, x is the vector of decision variables (duty ratio and other relevant variables), P out is the output power of the PV system, and V pv is the voltage of the PV panel. Te duty ratio is used to control the power fow between the PV panel and the DC-DC converter, and it is calculated as the ratio of the on-time to the switching period of the converter.
(2) MPPT Tracking System by the PSO Algorithm. Te particle swarm optimization (PSO) technique is a population-based search method inspired by the behavior of focks of birds. Te best solution found by a particle within its local neighbourhood (P best ) and the best solution discovered by all particles in the entire population (G best ) infuence the location of a particle.
Te collective behavior of the particle swarm optimization (PSO) technique is designed as shown in Figure 4 to locate optimal areas within a high-dimensional search space. Te ftness of the current particle is evaluated and compared to the global best ftness (G best ) and the particle best ftness (P best ). Based on the G best and P best , the position and velocity of the particle are updated. Te power-voltage (PV) curve of a photovoltaic array exhibits a single maximum power point when the array is operating under constant solar insolation. However, PV curves for partially shaded systems are characterized by multiple peaks, and there is a risk that the maximum power point tracking (MPPT) system will lock onto a local peak, resulting in a lower power output and a decreased performance of the PV system. Te global peak of the system can be easily monitored using the PSO approach, which is based on a search methodology.

PV Panel Calculations
In the photovoltaic panel design, one of the main considerations is the saturation current, which is calculated based on the temperature sensing in the panel at diferent temperatures. (b) Calculation of reverse saturation current and shunt current: I rs � Isc exp(q * (Voc/nNs * k * T)) − 1 , Te reverse saturation current and the shunt current are calculated based on the voltage, temperature, and the resistance values.
(c) Calculation of photo current and output current: where I sc is the saturation current, I rs is the reverse saturation current, I sh is the shunt current, I ph is the photo current, and I is the overall output current. Based on the processing parameters in the PV panel, the current output and photo current are calculated by equations (10) and (11) refer to Algorithm 1 at Appendix Section.

Designing the Battery Management System.
A lithiumion battery converts chemical energy into electrical energy in this grid integration. For the proposed hybrid power system, the intermittent power supply is supplemented by the battery backup from a lithium-ion battery. Monitoring the state of charge (SOC) is critical for regulating energy storage systems (ESSs), particularly in decentralized and hybrid confgurations. Te current drawn by the battery (ib) and the capacity of the battery (Q) are important factors in determining the SOC and performance of the battery. Te SOC is a measure of the stored energy in the battery and is expressed as a percentage, as shown in the following equation.
From Figure 5, we can see that the battery management system utilizes a state fow chart to manage its various modes and evaluate grid performance. Tis chart represents the output value with "y," the charging state with "data2," and the discharging state with "data3." Tere are fve distinct modes of operation: (i) In mode 1, the photovoltaic (PV) generator produces enough power to meet the load demands and charge the batteries simultaneously. (ii) In mode 2, the PV generator produces sufcient power and the batteries are fully charged, so the batteries are disconnected for protection. (iii) In mode 3, the PV generator produces an insufcient amount of power to meet the demand (0 < Ppv < Pc). In this case, the batteries supplement the power defciency in a compensation mode. (iv) In mode 4, the PV generator does not produce any power (Ppv < 0), so the batteries are solely responsible for supplying power to the load. (v) In mode 5, both the PV generator and the batteries are unable to produce power, resulting in the disconnection of the load  12 International Transactions on Electrical Energy Systems Te battery storage system is equipped with a bidirectional dc-dc converter, allowing for power to fow in both directions between the storage system and the bus. Te storage system utilizes a lithium-ion battery with a capacity of 5 kWh, and battery confguration can be observed from    Figure 5: State fow chart for battery management.
International Transactions on Electrical Energy Systems 13 Battery discharging: Te battery charging and discharging conditions are stated in equations (13) and (14), where E o is the battery constant voltage; K is the polarization constant (Ah 1 ); Exp (t) is the exponential zone dynamics, in V; and Q is maximum battery capacity, in Ah. "it" is the extracted capacity or the actual battery charge, in Ah; i * is the fltered low frequency current dynamics, in A; A is exponential voltage, in V, and B is the exponential capacity, in (Ah) − 1 .

Modeling of the Fuel Cell Stack.
Te fuel cell used in this system comprises of a proton exchange membrane fuel cell (PEMFC), a single boost dc link, and a grid-inverter system with output flters. Te PEMFC is a popular choice for highpower applications as it generates dc-form electrical energy. Te role of the power converter in this system is to regulate the fow of power and reduce harmonics at two diferent feeders. It does this by stabilizing the voltage output of the fuel cell and facilitating efective translation for the inverter input. Te converter uses a PI-controlled system to generate reference voltage for each switching operation, utilizing a pulse width modulation (PWM) technique. Te duty cycle (D) of the boost converter afects its conversion efciency when it is operated in the continuous mode.
Te processing parameters for the fuel cell stack system are listed in Table 6, and a schematic of a conventional gridconnected fuel cell system is shown in Figure6. Tis regulator is used in the inverter components of the fuel cell system and aims to maintain a unity power factor between the fuel cell and the connected load, as well as reduce harmonic currents in microgrids. Figure 7 illustrates the comprehensive control method for the fuel cell system.

Modeling of Diesel Generator.
Distributed diesel generators (DGs) are small, localized generators that can operate independently or in conjunction with a traditional electrical power distribution system (EPS). In this study, the simulated EPS featured two 110/10 kV transformers with a rating of 6300 kVA each, which supplied power to the 400 V bus bar section of a stepdown substation connected to the grid. Te DG used in this system was carefully modeled to include key components such as the internal combustion engine, regulators, feld system, and synchronous generator.
Te DG model, which is integrated with a controller, comprises a speed control mechanism, a drive model, an integration block, and a saturation block connected with delay transportation blocks. Te transport delay in the engine block is linked to a transfer function of e − 0.024 s. Figure 8 shows a design for a Simulink-based diesel engine model with a speed controller. Te speed control module responds to the performance deviation signal and is designed to maintain a certain speed in the diesel motor. Te actuator drive, which is controlled by the monitoring system, regulates the fow of fuel to the engine cylinders. Te drive model includes a delay when adjusting the fuel supply and torque reduction or increase based on the amount of fuel intake delivered to the cylinders. Te DG has a power rating of 8 kW and operates at a frequency of 50 Hz.

Modeling of Grid Integration.
Te proposed microgrid in this study consists of a battery energy storage system (BESS), photovoltaic (PV) panels, a fuel cell (FC) stack, and a diesel generator (DG). Te system's confguration is illustrated in Figure 9.
Te microgrid's specifcations for modeling are based on the ratings of its various components, including the diesel generator (DG), fuel cell (FC), photovoltaic (PV) panels, and battery. Te microgrid's rating in this case is 11 kV/100 kVA, as determined by the ratings of the PV panels, battery, FC, and DG. Te maximum load capacity of the grid-integrated system is 35.4 kW, as indicated in Table 7. Te individual   Figure 6: Structure of PEMFC.
14 International Transactions on Electrical Energy Systems  International Transactions on Electrical Energy Systems power ratings of the various components of the system are also presented in Table 7.

THD Calculation by the Unscented Kalman Filter.
Total harmonic distortion (THD or THDi) is a measure of the deviation in frequency that occurs during the transmission of a signal. It is calculated as the ratio of the total harmonic component powers to the power of the fundamental frequency. In this proposed method, we utilize the unscented Kalman flter (UKF) to calculate THD. UKF is an improvement upon the conventional Kalman flter (KF), which is only valid for linear systems. UKF is more efcient at solving nonlinear THD equations and can provide better accuracy and speed in grid frequency tracking. Te state distribution of inputs x1 (t) and x2 (t) from the grid and point of common coupling (PCC), respectively, are specifed using a minimal set of carefully chosen sample points. Te extended Kalman flter (EKF) is a commonly used technique in a range of nonlinear estimation and machine learning applications, such as predicting the condition of a nonlinear system, predicting characteristics for nonlinear system identifcation, and dual prediction. Te transmission of a Gaussian random variable (GRV) through a dynamic system is an essential step in the Kalman flter (KF) process. In the extended Kalman flter (EKF), the distribution of the system's state variables is represented using a GRV, which is then statistically propagated through the nonlinear system using frst-order interpolation. However, this can cause issues with the modifed GRV's exact mean and covariance, leading to flter divergence in certain cases. To address this issue, the unscented Kalman flter (UKF) employs a deterministic sampling technique. A GRV is still used to estimate the distribution of the system's state, but a small number of sample points are selected based on their relevance. Tis approach allows UKF to avoid the problems associated with GRV transmission in EKF. Te GRV data points accurately refect the true covariance and mean of the system, and when the system undergoes nonlinear propagation, they precisely capture the posterior covariance and mean up to the third order in the nonlinearity. Te unscented transformation (UT) is a method for evaluating the properties of a stochastic process after it has been transformed nonlinearly. If the input signal is assumed to be a sinusoidal wave with constant amplitude, the mathematical model and error covariance can be expressed as follows: Te measured signal is denoted by (t), and X1 (t) represents a state variable in the Kalman flter, where X1 (t) represents the measured frequency signals at the grid and PCC, respectively. When a random variable (of dimension) is propagated through a nonlinear function and the Kalman gain is updated, the nonlinear stochastic diference equation can be expressed as follows: Te state variables are represented by X, the observed signal is denoted by z, the controlled variable is represented by U, and the subscript k represents the sampling time stamp. Te UKF converts the inputs X1 (t) and X2 (t) from the grid and PCC into nonlinear equations (xk) and (xk − 1) at the PCC, respectively, and updates the error covariance. It then compares the result with a reference and generates the corresponding signal.
3.6.1. Algorithm of UKF. Te algorithm starts with initialization of the input data in the vector form � P 0 0 0 where k belongs to {1,2,3, . . ., n}, and based on the above stated equation, the input parameters for the unscented Kalman flter was initialized. Furthermore, the sigma points are calculated using equation (20).
Time update equations of the UKF are stated below: Te UKF was utilized to predict a Mackey-Glass-30 chaotic time series that had been degraded with incremental Gaussian white noise. A nonlinear autoregressive model was developed based on the equations of the time series. Te measurement update equations were used to compute the process noise and measurement noise covariance.
Te scaling parameter of the composite is denoted by λ, and the augmented state dimension is denoted by L. Te process noise covariance is represented by P k̄, and the measurement noise covariance is represented by P k . Te process noise variance represents the residual error following system convergence. Te process parameters of the unscented Kalman flter used in our system are shown in Table 8.
Te unscented Kalman flter algorithm processes the THD calculation parameters for the better performance of the grid-integrated system.

Results and Discussion
Tis section presents the results of modeling and simulation for a microgrid, including a comparison of the novel jellyfsh optimization technique for MPPT with the PSO algorithm using various parameters. Te analysis includes all modes of battery management system performance, the fuel cell curve, grid integration results, and the THD calculation technique. Figure 10 shows the use of a 1Soltech 1STH-215-P PV panel in a 7 series and 7 parallel string confguration for the proposed system. Te panel has an irradiance energy value of 1000 W/m 2 and a constant temperature of 25°C. Te optimization techniques yield a maximum voltage of 203 V, a maximum current of 52.45 A, and a maximum power output of 10.4 kW. Figure 11 shows the maximum solar power tracked by the two optimization techniques-based MPPTs. Te fgures illustrate the calculations of various power parameters, such as minimum and maximum power, peak-to-peak point, mean, median, and RMS value, for both algorithms. Te jellyfsh search algorithm attains a maximum power of 10240 W at 0.120 seconds, with a peak-to-peak point of 10240 W, a mean value of 10140 W, a median value of 10200 W, and an RMS value of 10160 W. Similarly, for the PSO algorithm, the maximum voltage is 9619 W at 0.561 seconds, with a peak-to-peak point of 9619 W, a mean value of 9518 W, a median value of 9583 W, and an RMS value of 9539 W. Te results show that the JS algorithm performs better than the PSO algorithm based on the maximum solar power tracked.

Discussion on the Solar PV Panel.
Te PV curves for the JS algorithm and the PSO algorithm are shown in Figures 12 and 13, respectively. Te PV curve for the JS algorithm shows that the maximum power of 10.4 kW is achieved at a voltage of 200.5 V, while the PV curve for the PSO algorithm indicates that the maximum power of 9837 W is obtained at a voltage of 182.3 V.
Comparison results of P_max tracking in jellyfsh and particle swarm optimization techniques considering the partial shading condition are as follows. Figure 14 compares the maximum tracking power under partial shading conditions for the jellyfsh search (JS) algorithm and the particle swarm optimization (PSO) technique. Te load power for both optimization techniques is measured at irradiances of 200 W/m 2 , 500 W/m 2 , and

Discussion on the Battery Energy Storage System (BESS).
Te battery's discharge curve can be divided into three distinct phases. When the battery is fully charged, the frst phase depicts an exponential voltage decrease, the size of which is determined by the type of battery. Te second phase represents the draining of charge from the battery before the voltage falls well below the battery's rated voltage. Finally, the last phase shows the battery's complete discharge, which occurs when the voltage decreases signifcantly. Figure 17 shows the typical constant current/discharging voltage characteristic curve for a lithium-ion battery. In this case, three regions are easily distinguishable: the exponential region in yellow, the nominal or rated region in grey, and the fnal discharge behavior in blue. Te same system is studied under diferent current values, with the blue line representing a 6.5 A battery, the red line representing a 13 A battery, and the orange line representing a 32.5 A battery. Te nominal and exponential areas are based on the discharge curve of the 6.5 A battery. Te various operating mode conditions of the battery system are described below.     Figure 25: Total combined power generation of the proposed system.

International Transactions on Electrical Energy Systems
According to the state fow chart of the battery management system, mode 1 occurs when the power available from the PV generator (pavailable ≥ 0) is sufcient to power the load and charge the batteries. As a result, the state of charge of the battery system increases gradually which can be observed from Figure 18.
When the PV power is sufcient and the batteries are fully charged, it is necessary to disconnect the batteries for their protection. Tis results in a sudden drop in the state of charge from the starting point in mode 2 of the battery management system which can be observed from Figure 19.
When the power supplied by the PV generator is insufcient (0 < Ppv < Pc), the power of the batteries is added to meet the power demand. Tis is the compensation mode of the battery system, and it results in a gradual drop in the state of charge, which can be observed from Figure 20.
Mode 4 of the battery management system occurs when the PV generator (Ppv < 0) supplies no energy, and the batteries must feed the load. In this case, there is no production from the PV generator and the batteries are discharged. Te load is then disconnected. Tis results in a linear drop in the state of charge (SOC) which can be observed from Figure 21. Te overall output power of the battery system is 5 kW. Figure 22 shows stack voltage (in volts) versus current (in amps), while the second graph shows stack power (in kW) versus current (in amps). Te power rating of the fuel cell is also shown in the fgure. Te power rating of the fuel cell is analyzed at two diferent points: one at 2 kW and another at 2.356 kW (the maximum point). At 2 kW, the voltage and current are 400 V and 5 A, respectively, and at 2.356 kW, the voltage and current are 380 V and 6.2 A, respectively. For the proposed system, the power rating of 2 kW is used.

Discussion on Diesel
Generator. Te results of grid integration of the distributed generator (DG) system are shown in Figure 23. Te maximum voltage obtained from the DG system is 400 volts, and the maximum current value is 38 amps. Te power rating of the present DG system is 8 kW. If the electricity generated by the PV/battery system is insufcient, the diesel generator is used as a backup power source. Figure 24 shows the harmonic analysis of load current, grid current, and inverter current under nonlinear load conditions. Te power fow is almost nonsinusoidal, indicating that the load is nonlinear. One of the main issues with nonlinear loads is the reduction of harmonics produced by them. Based on fast Fourier transform (FFT) analysis, the total harmonic distortion (THD) value is about 0.12% at a frequency of 50 Hz. Te grid-integrated system has a frequency deviation of less than 5%, indicating its efective performance.

Grid Integration.
Te microgrid results states that the efcient system is attained based on the power ratings and optimal integration of the FC, PV, DG, and battery components.
Te overall power generation of the proposed system is shown in Figure 25. From the results, the individual power outputs are stated in Table 9: Te grid integration of the PV, battery, fuel cell, and diesel generator systems results in an overall power rating of 11 kW. Te individual power ratings of the components are as follows: the PV system produces a maximum power of 10.4 kW, the fuel cell generates 2 kW, the battery is used as a backup power source and generates 5 kW, and the diesel generator produces 0.8 kW.
Modifying the voltage commands of a 3-phase converter creates a rotating space vector in Figure 26, as they are always sinusoidal. Te state vector diagram, based on the diferent voltages from each system in the grid integration, shows the International Transactions on Electrical Energy Systems 25 angle and magnitude between the phases of the three-phase system. Te state vector diagram is used for stability analysis in the grid system.

Conclusion
Te jellyfsh optimization (JF) algorithm is a bioinspired optimization algorithm that is based on the motion of jellyfsh in the ocean. Te algorithm mimics the active and passive motions of jellyfsh to move in the search space and fnd the optimal solution. In the context of optimizing a photovoltaic (PV) system, the JF algorithm is used to fnd the maximum power point tracking (MPPT) of the PV system. In the PV system, the electrical components such as the PV panel, DC-DC converter, and battery represent the devices in the JF algorithm. Te objective of the JF algorithm is to fnd the optimal values of the electrical components that maximize the power output of the PV system. Te JF algorithm works by initializing a population of candidate solutions, which represent the diferent combinations of values for the electrical components. Te algorithm then evaluates the ftness of each candidate solution by simulating the behavior of the PV system under diferent environmental conditions. Te ftness function is typically based on the power output of the PV system and any other constraints such as harmonic distortion. Te JF algorithm then applies the active and passive motion of jellyfsh to move the candidate solutions in the search space towards the optimal solution. Te movement of the candidate solutions is guided by the ftness function, which provides a measure of the goodness of each solution. An energy management system (EMS) has been designed and modeled for a microgrid consisting of proton exchange membrane fuel cells, lithium-ion batteries, diesel generators, and photovoltaic systems and integrated with the grid system. Te dynamic behavior of these systems has been modeled using the MATLAB/Simulink framework. Te proposed EMS aims to optimize the use of power from various renewable energy sources, reduce fuctuations in renewable energy sources, and reduce the amount of power supplied from the grid system. Te EMS also has the ability to analyze power line failures and calculate active power, as well as analyze power quality indices such as current and voltage total harmonic distortion (THDV and THDI). Te effective microgrid integration of the system with the fuel cell, PV, diesel generator, and battery results in power outputs of 2 kW, 10.4 kW, 0.8 kW, and 5 kW, respectively. Te experimental results for the grid-integrated system are in line with conventional grid codes. Te overall power rating of the microgrid system is 11 kW, and the harmonic distortion of the system is 0.12%. Te optimal design of the maximum power point tracking (MPPT) controller based on the jellyfsh search algorithm and the particle swarm optimization technique with minimal processing time demonstrates the efectiveness of the MPPT controller design. Te main power source in the system is the PV panels, with the jellyfsh search algorithm achieving the maximum power output. In partial shading conditions, the proposed jellyfsh search (JS) method has faster root mean square error (RMSE) execution duration and more efective power tracking capabilities for the PV system compared to existing training techniques such as particle swarm optimization (PSO). Te results of the JS algorithm are found to be 5.4% better than the PSO algorithm, and the response time for the JS algorithm is also faster. Te modeled grid-integrated system efciently distributes power from various sources to meet the load demand at a minimal operating cost in the energy management system (EMS).  26 International Transactions on Electrical Energy Systems