Optimizing Integration of Fuel Cell Technology in Renewable Energy-Based Microgrids for Sustainable and Cost-Effective Energy

: This article presents a cost-effective and reliable solution for meeting the energy demands of remote areas through the integration of multiple renewable energy sources. The proposed system aims to reduce dependence on fossil fuels and promote sustainable development by utilizing accessible energy resources in a self-contained microgrid. Using the Hybrid Optimization Model for Electric Renewable (HOMER) software, the study examined the optimal combination of energy sources and storage technologies for an integrated hybrid renewable energy system (IHRES) in the Patiala location of Punjab. The total life cycle cost (TLCC) is the main objective of this manuscript. The HOMER result is taken as a reference, and the results are compared with the optimization hybrid algorithm (PSORSA). From this, it is clear that the proposed algorithm has less TLCC as compared to others. Two combinations of energy sources and storage technologies were considered, namely solar photovoltaic (PV)/battery and solar PV/fuel cell (FC). The results showed that the solar PV/FC combination is more cost-effective, reliable, and efﬁcient than the solar PV/battery combination. Additionally, the IHRES strategy was found to be more economically viable than the single energy source system, with lower total life cycle costs and greater reliability and efﬁciency. Overall, the proposed IHRES model offers a promising solution for meeting energy demands in remote areas while reducing dependence on fossil fuels and promoting sustainable development.


Introduction
One of the essential components for a nation's economic development is the availability of power. In many countries, 17% of people, particularly those in remote areas, still have no access to power [1]. The high costs of network transmission in remote regions often necessitate the use of diesel generators to meet load requirements. The high cost of diesel fuel, environmental pollution, and scarcity of fossil fuels make diesel power generation not always an affordable and effective option. The use of renewable energy has been investigated as a potential solution to this problem by many scholars in the past few years. The use of renewable energy systems, particularly solar PV systems, can be a viable alternative in isolated areas [2]. Solar PV systems can provide renewable and sustainable energy with minimum environmental impact. Furthermore, they are relatively easy to install, maintain, and operate. As a result, they are increasingly being adopted in rural and remote areas. Solar PV systems are also cost-effective and can reduce energy costs in the • A hybrid system configuration incorporating solar PV/battery energy storage and solar PV/fuel cell based methods is presented in this manuscript for an optimal hybrid system configuration. • The optimization model presented in this article is used to accomplish a case study in Patiala. The purpose of the paper is to minimize the total life cycle costs (TLCC).

•
The TLCC is calculated by considering the cost of generation, installation, and operation of the system. • The results show that the optimal hybrid system configuration can reduce the total cost as compared to the standalone solar PV system. Section 2 describes the system model and the methodology. Section 3 presents the results and discussion. The conclusion is in Section 4.

System Description
To analyze and quantify the cost of both systems, two models of HRES (Solar PV/Battery and Solar PV/FC) have been evaluated with HOMER (Version 3.14.0). The hourly electricity demand of the micro-grid was simulated for a period of twenty years, and the results were compared in terms of total life cycle cost (TLCC). Cost optimization was performed to identify the optimal configuration and evaluate the economic feasibility of both systems. For HOMER simulation to assess the optimization outcomes of these two models, additional input data is required, which is provided in the following section.

•
Load Profile Data: As can be seen from Table 1, the baseline and scaled load on a daily basis has an average value of 175.47 kWh, the average (kW) load level with a scaled load level of 7.3 kW, the peak capacity load level with a scaled load level of 25.47 kW, and the load factor for the baseline, and scaled load level at 0.5 is assumed. Based on the annual load data presented in Tables 2 and 3, the weekday and weekend loads are calculated. • Battery Bank: The conventional approach to storing electrical energy is to use a battery bank. Assembling one or more batteries in order to store energy electrochemically is also considered electrochemical storage [9]. Using HOMER software, a battery is modelled as an energy storage system that can store a specified amount of direct current (DC) with a fixed energy efficiency round-trip. It determines whether a battery needs to be replaced based on the number of charge and discharge cycles [10]. The battery system can be used in various applications such as energy storage in renewable energy systems, power-grid support, uninterruptible power supply, and others. It is important to note that batteries have a finite lifespan and, thus, need to be replaced at regular intervals. To ensure batteries are replaced on time, a battery system can be used to monitor their condition. This system can also be used to alert when the battery needs to be replaced. Additionally, the system can be used to optimize battery performance. Table 4 represents the battery description which is used in the proposed model.   • Solar PV Panel: Electricity is generated by solar panels by absorbing sunlight. However, there are certain variables that affect the PV's output, such as temperature and sunlight. Solar panel output is also affected by shading, dust, and dirt. To maximize the output, it is important to install the panels in a location that receives direct sunlight and is not affected by shade. Regularly cleaning the panels can help maintain their efficiency. Panels should also be angled correctly to maximize the amount of sunlight received. Additionally, panels should be installed in areas with low temperatures to ensure optimal performance. • Fuel Cell: An electro-chemical device that converts chemical energy into electrical energy is called a fuel cell (FC). Fuel cells are available in a variety of configurations based on the types of electrodes, operating characteristics, and power ranges they operate at. Fuel cells can be used to generate power for a wide range of applications from home heating and cooling systems to electric vehicles. Additionally, fuel cells are clean and efficient sources of energy, producing no emissions and creating no waste. Among the variety of FCs available on the market, Proton Exchange Membrane Fuel Cells (PEMFCs) are the most commonly used due to their excellent start-up time and low operating temperature. PEMFCs are also known for their high energy efficiency and low emissions, making them an ideal choice for clean energy applications. Additionally, they are relatively compact and lightweight, making them suitable for powering vehicles, portable electronics, and other applications. PEMFCs are also relatively inexpensive compared to other types of fuel cells, making them a cost-effective option for many applications. Furthermore, they are relatively low-maintenance, making them an attractive option for many users. • Electrolyzer: Carbon-free hydrogen can be produced from renewable energy sources by electrolysis. The electrolysis process involves splitting water into hydrogen and oxygen using electricity. During this reaction, an electrolyzer is used. An electrolyzer can range in size from a small appliance that can be used to manufacture hydrogen at a small scale to a large scale, central production facility that can be connected directly to renewable or non-greenhouse gas-emitting electricity sources. The hydrogen produced by electrolysis is considered to be a clean energy source, as there are no carbon emissions generated during the production process. This makes it an attractive alternative to traditional fossil fuels. Additionally, hydrogen can be stored and used as a fuel for transportation. Furthermore, hydrogen can be produced from renewable sources such as solar, wind, and water, making it an even greener option. Hydrogen also has a high energy density and can be used in stationary power plants.

•
Hydrogen Storage Tank: Hydrogen is stored in hydrogen tanks and supplied to fuel cells for energy generation after it is produced by the electrolyzer [11]. During a day, hydrogen is produced by the electrolyzer and stored in the hydrogen tank, which is used when there is no PV generation. The stored hydrogen is then used as a source of renewable energy, which is converted into electrical energy by the fuel cell. This electrical energy can then be used to power the electric vehicle or stored in the battery for later use.

Methodology
The proposed system is optimized, simulated, and modeled using HOMER software. The results from this process allowed us to analyze the performance of the system. We then Energies 2023, 16, 4482 6 of 18 used this information to make adjustments and improve the system's efficiency. Finally, we validated the system to ensure its accuracy and reliability. As discussed below, two cases are examined in this manuscript: Case 1: Solar PV/Battery: Figure 1 shows the IHRES consisting of solar photovoltaics and a battery bank. In this case, solar PV is the primary source of supply, while batteries serve as a storage medium.
when there is no PV generation. The stored hydrogen is then used as a source of renewable energy, which is converted into electrical energy by the fuel cell. This electrical energy can then be used to power the electric vehicle or stored in the battery for later use.

Methodology
The proposed system is optimized, simulated, and modeled using HOMER software. The results from this process allowed us to analyze the performance of the system. We then used this information to make adjustments and improve the system's efficiency. Finally, we validated the system to ensure its accuracy and reliability. As discussed below, two cases are examined in this manuscript: Case 1: Solar PV/Battery: Figure 1 shows the IHRES consisting of solar photovoltaics and a battery bank. In this case, solar PV is the primary source of supply, while batteries serve as a storage medium.   when there is no PV generation. The stored hydrogen is then used as a source of renewable energy, which is converted into electrical energy by the fuel cell. This electrical energy can then be used to power the electric vehicle or stored in the battery for later use.

Methodology
The proposed system is optimized, simulated, and modeled using HOMER software. The results from this process allowed us to analyze the performance of the system. We then used this information to make adjustments and improve the system's efficiency. Finally, we validated the system to ensure its accuracy and reliability. As discussed below, two cases are examined in this manuscript: Case 1: Solar PV/Battery: Figure 1 shows the IHRES consisting of solar photovoltaics and a battery bank. In this case, solar PV is the primary source of supply, while batteries serve as a storage medium.
Solar PV panel rating is represented by P t s ; loss factor or derating is represented by f loss , due to dirt, shadows, temperature, etc.; the hourly solar radiation incident at the surface of solar PV panels (W/m 2 ) is represented by H i (t); and standard incident radiation (1000 W/m 2 ) by H t . Converter: When a system contains AC and DC components, DC to AC and AC to DC power converters are required. Fuel cells, solar PV panels, and batteries produce DC output while AC load is considered. Upon the peak load demand P m L (t), converter size is taken. As shown in Equation (2), the inverter rating P in v is calculated as follows: where the efficiency of the inverter is denoted by ï in v .
• Battery Bank: During times when the power from renewable systems is insufficient or absent, a battery is used to store excess energy. An accurate estimation of the state of charge (SOC) can lead to the measurement of energy. Equation (3) can be used to calculate the SOC of a battery: A battery's input/output voltage is denoted by P b (t), the battery's efficiency by ï battery , and its voltage by V bus . A positive value indicates that the battery is charging, while a negative value indicates it is discharging. Equation (4) gives you the round-trip efficiency of a battery: The charging efficiency ï c battery and discharging efficiency ï d battery of the battery are depicted in [12]. It is estimated that the battery has a round-trip efficiency of 92%. Additionally, discharging and charging efficiencies are assumed to be different and calculated as 100% and 85%, respectively. As shown in Equation (5), SOC max is the maximum value of SOC and equals the aggregate capacity of the battery bank C n : Single battery capacity should be denoted as C b , total battery number should be denoted as N battery , and number of batteries connected in series should be denoted as N s battery . SOC min is the minimum discharge limit that can be reached by the battery bank. System constraints can be applied according to the usage of the battery bank. Batteries are connected in series in order to achieve desired bus voltage. As shown in Equation (6), a series of batteries is calculated as follows: An individual battery's voltage is represented by V battery . In battery modeling, the maximum charge or discharge power at any given time is also a major factor. Equation (7) calculates maximum charge current based on maximum charge current: where the maximum charge current in amperes is denoted as I max .
• Fuel Cell: In hydrogen fuel cells, chemical energy is converted directly into electric power, while at the same time, heat and water are produced as by-products as long as fuel is available. Hydrogen fuel cells are considered to be a clean and renewable source of energy, as they do not emit any greenhouse gases [13]. They are also highly efficient, with some fuel cells achieving up to 80% efficiency. The anode and cathode The anode's chemical reaction is as follows: The cathode's chemical reaction is as follows: The overall chemical reaction is as follows: Across the membrane, hydrogen gas dissociates into protons and electrons at an anode on the left, forming the concentration gradient between the electrodes. The gradient causes protons to diffuse across the membrane while leaving electrons behind. In relation to the anode, the cathode becomes positively charged when protons drift towards it. Since the membrane prevents electrons from passing through, the remaining electrons are drawn to the positively charged cathode, causing current to flow the other way. According to Equation (11), fuel cells produce the following voltage: Equation (12) shows the maximum voltage that can be generated by a cell given a reversible open circuit voltage, an ohmic voltage drop, an activation voltage drop, and a concentration voltage drop.
where ∆G o is an electric work which is called Gibbs free energy; the number of moles is denoted by n; F is a Faraday's constant; specific entropy is denoted by ∆S; absolute temperature is denoted by T; T re f is taken as 25 • C; P 0.5 O 2 , P 1 H 2 , P 1 H 2 O are pressure of pure oxygen, hydrogen, and H 2 O as fuel; and R is gas constant, respectively. Equation (13) shows the total power output of a stack of fuel cells P FC : In a stack of fuel cells, p FC and I FC represent rating and current, respectively. A major component of fuel cell modeling for power generation is hydrogen mass flow rate Q H 2 D 1 . According to Equation (14), 1 kW fuel cells consume hydrogen in kg/h at the following mass flow rate: The intercept coefficient t α 1 , α 2 . and P s FC of a fuel cell is measured in kilograms per hour per kW, and its rated capacity is measured in kilowatts. In the case of a fuel cell rating of 1 kW, taking into account α 1 and α 2 to be 0.0003 and 0.58 kg/h/kW, Q H 2 D 1 calculated is 0.059 kg/h. For a fuel cell to generate 1 kW of power, 0.059 kg of hydrogen is required per hour [14].

•
Electrolyzer: The electrolyzer converts the surplus electricity from the PV panels into hydrogen, which is stored in a hydrogen tank and used to power the fuel cell. Hydrogen production by the electrolyzer is the primary aspect to consider. Equation (15) The heating value of hydrogen in MJ/kg, and the efficiency of the electrolyzer P s el , HV H 2 and n el are 1 kW, MJ/kg, and kWh/kg, respectively. Electrolyzers are estimated to be 90% efficient [15]. The mass flow rate of hydrogen in an electrolyzer with 142 MJ/kg heating value will be 0.02268 kg/h/kW. Based on this, 1 kW electrolyzers produce 0.02268 kg/h hydrogen.

•
Hydrogen Tank: The electrolyzer produces hydrogen that is stored in hydrogen tanks for use in fuel cells. As the electrolyzer produces hydrogen during the day, the hydrogen tank stores it, as well as supplying hydrogen to the fuel cell when no PV power is generated. A decision variable for the proposed system was the size of the hydrogen tank, T H 2 in kilograms. t is m H 2 (t), the time at which hydrogen is available to flow. As shown in Equation (16), hydrogen is available at a given time after being produced by the electrolyzer.
In Equation (15), P el is the power consumed by the electrolyzer, and m H 2 Q 1 is the mass flow rate of hydrogen produced in kg/h by a 1 kW electrolyzer. Equation (17) calculates this available hydrogen stored in a hydrogen tank: where T H 2 (t − 1) is the hydrogen in the tank at the previous hour. Hydrogen is used to generate power in a fuel cell. Equation (18) represents the mass flow rate of hydrogen taken from hydrogen tank by a fuel cell at a particular time: Based on Equation (14), the mass flow rate of hydrogen consumed by 1 kW fuel cell is calculated in kg/h. Equation (19) calculates the remaining hydrogen in the hydrogen tank after taking hydrogen: The amount of hydrogen T H 2 (t − 1) in the tank at the time is t − 1.

Rat Search Algorithm (RSA)
Various sizes and weights of rats belonging to two species are studied in this study, which provides insights into their behavior as intelligent and social rodents. Among the activities they engage in within their territorial communities are grooming, tumbling, hopping, boxing, and chasing. It is not uncommon for rats to exhibit violent behavior during competitions for prey, resulting in fatalities. Mathematically modeling the aggressive behavior of rats during chases and battles is the focus of this research.

Mathematical Modeling:
Chasing: Animals such as rats engage in social agonistic behaviors to pursue prey in groups. For math modeling, we assume the most effective search agent knows where the prey is, The rat's position is denoted by → Q j (z), while the best optimal solution is denoted by → Q s (z). The values of B and D are specified by Equations (21) and (22).
where, z = 0, 1, 2, . . . .., Max iter D = 2. rand () A parameter S represents a random number, while a parameter D represents a random number, with values [0, 2] and [1,5], respectively. In the iterative process, B and D are responsible for optimizing the performance of these parameters during exploration and exploitation.
Fighting: Rats engage in battles with their prey using Equation (23) as a mathematical representation.
The rat search algorithm updates the next position of the rat by utilizing equation → Q j (z + 1). As a result, the optimal solution is maintained, and the locations of other search agents are adjusted in relation to it. In order to facilitate exploration and exploitation, the parameters B and D have been adjusted. RSA proposes a solution that can be obtained with a minimum amount of operators. The pseudo-code of the rat search algorithm is presented in Algorithm 1, and the flow chart of that algorithm is shown in Figure 3.

Hybrid Particle Swarm Optimization and Rat Search Algorithm (PSORSA)
We propose a hybrid approach to combine two algorithms for increased effi Our approach enhances the precision of results achieved by RSA by leveragin which is a precursor algorithm to the class of optimization algorithms known as algorithms. As a result of our hybrid method, the system is not trapped in local min and is also enhanced in accuracy. This enhances the speed of the system and ensu system finds the global optimum within reasonable time. The combination of R PSO thus provides a powerful hybrid approach to optimize the system. The method is also extremely cost effective, since it does not require a large amount putational power to achieve the desired result. The combination of RSA and PS provides a powerful and cost-effective solution to optimize the system. The flow that algorithm is shown in Figure 4.

Hybrid Particle Swarm Optimization and Rat Search Algorithm (PSORSA)
We propose a hybrid approach to combine two algorithms for increased efficiency. Our approach enhances the precision of results achieved by RSA by leveraging PSO, which is a precursor algorithm to the class of optimization algorithms known as swarm algorithms. As a result of our hybrid method, the system is not trapped in local minimums and is also enhanced in accuracy. This enhances the speed of the system and ensures the system finds the global optimum within reasonable time. The combination of RSA and PSO thus provides a powerful hybrid approach to optimize the system. The hybrid method is also extremely cost effective, since it does not require a large amount of computational power to achieve the desired result. The combination of RSA and PSO thus provides a powerful and cost-effective solution to optimize the system. The flow chart of that algorithm is shown in Figure 4.

Objective Function and Constraints
• Objective Function: A value that minimizes the total life cycle cost (TLCC) is the objective function. Costs associated with ongoing operation and maintenance (C&R) and capital and replacement (O&M) will be included in the total life cycle cost of the project. These costs should be weighed against the expected benefits of the project to determine the optimal value of the objective function. A variety of techniques, such as cost-benefit analysis, can be used to ensure a thorough evaluation of the project, which is given in Equation (24): In a mathematical model, the capital recovery cost (CRF) is determined based on the interest rate (j) and system life span (m), which occur at the beginning and during the duration of the project. The CRF is used to calculate the value of the project by taking into account the amount of money needed to pay off the initial investment. It is a key factor in determining the profitability of a project and is given in Equation

Objective Function and Constraints
Objective Function: A value that minimizes the total life cycle cost (TLCC) is the objective function. Costs associated with ongoing operation and maintenance (C&R) and capital and replacement (O&M) will be included in the total life cycle cost of the project. These costs should be weighed against the expected benefits of the project to determine the optimal value of the objective function. A variety of techniques, such as cost-benefit analysis, can be used to ensure a thorough evaluation of the project, which is given in Equation (24): In a mathematical model, the capital recovery cost (CRF) is determined based on the interest rate (j) and system life span (m), which occur at the beginning and during the duration of the project. The CRF is used to calculate the value of the project by taking into account the amount of money needed to pay off the initial investment. It is a key factor in determining the profitability of a project and is given in Equation (25): where maximum number of solar PV panel is denoted by N max solar , maximum rating of fuel cell is denoted by N max f uel cell ; maximum rating of electrolyzer is denoted by N max electrolyzer ; maximum rating of size of hydrogen tank is denoted by N max hydrogen tank ; and maximum rating of size of battery is denoted by N max battery .

Results and Discussion HOMER Based
A case study is presented in Patiala using the optimization model. In the south-eastern part of Punjab, northwestern India, Patiala has an altitude of 257 m and is situated at 30.3398 • N, 76.3869 • E. The work focuses on two case studies, namely Solar PV/Batterybased system and Solar PV/Fuel Cell-based system [16,17]. Table 5 lists the specifications of the components of hybrid systems. To develop and implement a renewable-based hybrid energy system, the TLCC reliability index is of the utmost importance. In this manuscript, some parts of the suggested IHRES are evaluated for their ability to fulfill a community's AC (Alternating Current) and DC (Direct Current) primary load requirements. The size of the bi-directional plant is determined by its peak load. Bi-directional converters are assumed to be 90% efficient. The HOMER software is used to calculate the cost of all the system components. In this study, we used five main parameters, such as the rating of the solar PV panel, the fuel cell, the battery, the electrolyzer, and the size of the hydrogen tank. Inverter size was not considered as an optimization parameter; it was selected based on peak load demand. It was assumed that the project would last 20 years at a 5% interest rate. The two cases are considered as discussed below:   Figure 1, IHRES consists of a solar photovoltaic system and a battery bank. A battery serves as a storage device in this case, with Solar PV as the main source of supply. Table 6 and Figure 5 show the overall system component cost for this case. The total capital, replacement, and O&M cost are 252,251, 68,375, and 31,153. From Table 6, it is observed that the TLCC of battery, converter, and solar PV is 136,213, 67,682, and 147,884, respectively, but the overall TLCC of the system is 351,779. The Figure 6 shows the TLCC of all the system for case 1.  Figure 2, IHRES consists of solar photovoltaics and fuel cells. As a storage device, fuel cell is used in this case as a main source of supply in addition to Solar PV. Table 8 and Figure 7 show the overall system component cost for this case. The total capital, replacement, and O&M cost are 244,910, 62,569, and 23,893. From Table 8, it is observed that the TLCC of fuel cell, electrolyzer, hydrogen tank, converter, and solar PV is 112,825, 29,448, 890, 62,940, and 125,269, respectively, but the overall TLCC of the system is 331,372. Figure 8 shows the TLCC of all the system for Case 2.     Figure 2, IHRES consists of solar photovoltaics and fuel cells. As a storage device, fuel cell is used in this case as a main source of supply in addition to Solar PV. Table 8 and Figure 7 show the overall system component cost for this case. The total capital, replacement, and O&M cost are 244,910, 62,569, and 23,893. From Table 8, it is observed that the TLCC of fuel cell, electrolyzer, hydrogen tank, converter, and solar PV is 112,825, 29,448, 890, 62,940, and 125,269, respectively, but the overall TLCC of the system is 331,372. Figure 8 shows the TLCC of all the system for Case 2.   Using HOMER software, the costs of the entire component were calculated of the proposed system. These parameters were then compared with the proposed algorithm, as well as their parent algorithms, as previously mentioned. The feasible and optimal solution was determined by ranking the parameters based on TLCC, as shown in Table 7. Table 7 displays the results in TLCC format for HOMER, RAT, PSO, GWO, and HHO case studies. While the proposed hybrid system took hours to simulate with HOMER, the simulation time was significantly reduced with the help of developed algorithms. From the results, it was concluded that the proposed algorithm outperformed both the parent algorithms, compared algorithm, and the HOMER simulation. Case 2: Solar PV/Fuel Cell Based System: According to Figure 2, IHRES consists of solar photovoltaics and fuel cells. As a storage device, fuel cell is used in this case as a main source of supply in addition to Solar PV. Table 8 and Figure 7 show the overall system component cost for this case. The total capital, replacement, and O&M cost are 244,910, 62,569, and 23,893. From Table 8, it is observed that the TLCC of fuel cell, electrolyzer, hydrogen tank, converter, and solar PV is 112,825, 29,448, 890, 62,940, and 125,269, respectively, but the overall TLCC of the system is 331,372. Figure 8 shows the TLCC of all the system for Case 2.    Using HOMER software, the costs of the entire component were calculated for the proposed system. These parameters were then compared with the proposed algorithm, as well as their parent algorithms, as previously mentioned. The feasible and optimal solution was determined by ranking the parameters based on TLCC, as shown in Table 9. Table 9 displays the results in TLCC format for HOMER, RAT, PSO, GWO, and HHO case studies. While the proposed hybrid system took hours to simulate with HOMER, the simulation time was significantly reduced with the help of developed algorithms. From the results, it was concluded that the proposed algorithm outperformed both the parent algorithms, compared algorithm, and the HOMER simulation.  Using HOMER software, the costs of the entire component were calculated for the proposed system. These parameters were then compared with the proposed algorithm, as well as their parent algorithms, as previously mentioned. The feasible and optimal solution was determined by ranking the parameters based on TLCC, as shown in Table 9. Table  9 displays the results in TLCC format for HOMER, RAT, PSO, GWO, and HHO case studies. While the proposed hybrid system took hours to simulate with HOMER, the simulation time was significantly reduced with the help of developed algorithms. From the results, it was concluded that the proposed algorithm outperformed both the parent algorithms, compared algorithm, and the HOMER simulation.  Based on the results obtained, the performance of the system presented in Case 2 is significantly better than that in Case 1. Based on the above comparison, the Case 2 is the more economical system. Case 2 has a lower cost of all the components, a lower TLCC overall, and a fuel cell instead of a battery, which is more economical.
Fuel cell systems with hydrogen as a fuel are gradually replacing lithium-ion batteries. It is possible for fuel cells to replace lithium-based batteries, which cause water and air pollution. It costs approximately five times more to produce a lithium-based battery that has been recycled than one that has been extracted from the ground. All battery manufacturing units are unconsciously extracting more and more lithium from the Earth, causing the Earth to become a 'lithium dump'. There is real potential for fuel cells to qualify as technology that generates electricity with harmless byproducts. Hydrogen fuel cells have the advantages of scalability, low greenhouse gas emissions, and silent operation. Unlike a battery, the fuel cell does not self-discharge. It does not release any hazardous gases either. This makes it an ideal choice for powering electric vehicles, homes, and businesses. It can also be used in stationary applications such as backup power and grid-scale energy storage.

Conclusions and Outcomes
The aim of this manuscript is to provide an optimal configuration for stand-alone hybrid solar PV/battery systems and solar PV/fuel cell systems. According to the reliability index, the objective function is to minimize the total life cycle cost (TLCC). With the HOMER software, it has been possible to determine the optimal size of different components such as solar PV, fuel cells, converters, batteries, hydrogen tanks, and electrolyzers. It is obvious from the TLCC that Case 2 has a higher economic benefit than Case 1. Through proper sizing of components and efficient energy flow management between system components, a cost-effective AC/DC hybrid energy system can be designed. The HOMER software can help to identify the most cost-effective combination of components to meet the user's energy needs. By optimizing the size and configuration of the system, the user can maximize the economic benefits and ensure a reliable energy supply. The HOMER software is an invaluable tool for designing AC/DC hybrid energy systems, as it can quickly analyze the various options and determine the most cost-effective solution. The HOMER software is used as a reference in the manuscript. The main disadvantage of HOMER software is that it takes lot of time to simulate the things to overcome that disadvantage optimization results are conducted. Here, it is seen that the proposed algorithm TLCC is lower than the rest of the compared algorithms as well as HOMER software. Furthermore, it can accurately predict the system's performance and energy output.