Optimization of PEMFC Model Parameters Using Meta-Heuristics

The present study introduces an economical–functional design for a polymer electrolyte membrane fuel cell system. To do so, after introducing the optimization problem and solving the problem based on the presented equations in the fuel cell, a cost model is presented. The final design is employed for minimizing the construction cost of a 50 kW fuel cell stack, along with the costs of accessories regarding the current density, stoichiometric coefficient of the hydrogen and air, and pressure of the system as well as the temperature of the system as optimization parameters. The functional–economic model is developed for the studied system in which all components of the system are modeled economically as well as electrochemically–mechanically. The objective function is solved by a newly improved metaheuristic technique, called converged collective animal behavior (CCAB) optimizer. The final results of the method are compared with the standard CAB optimizer and genetic algorithm as a popular technique. The results show that the best optimal cost with 0.1061 $/kWh is achieved by the CCAB. Finally, a sensitivity analysis is provided for analyzing the consistency of the method.


Introduction
To directly convert chemical energy into electricity without combustion, an electrochemical device called a fuel cell is used. Thanks to this characteristic, it has higher electrical performance toward thermal motors, which are restricted by the performance of the Carnot cycle. The by-product of reacting in a fuel cell can be heat, water, carbon dioxide, and hydrocarbons, according to the type of consumed fuel. Gas diffusion layers, gaskets, flow-field plates, collector plates, catalyst layers, and Larminie and Dicks are the main components of this device [1]. The system supplies the requested energy, while the fuel and the oxidizer are existing. To provide the desired current and voltage, they can make series or parallel connections.
The benefits of fuel cells include cleanliness, connection to micro-turbines, silent operation, no moving elements, and lower greenhouse effects [2][3][4]. Among different types of fuel cells, the polymer electrolyte membrane fuel cell (PEMFC), because of its several advantages, is considered the popular one. Some of these advantages are lower weight, lower temperatures of operation, higher density of operation, and capability for decreasing price. The PEMFC is a widely used fuel cell among different power levels that was initially modeled to be used in a spacecraft at NASA. The main fuel of this device is hydrogen. The operating temperature of a PEMFC is imitated to the range between 70 • C and 80 • C. To provide faster electrochemical reactions, expensive catalysts, such as platinum, were utilized in this type of fuel cell [5,6]. Some prominent advantages of PEMFCs is their higher startup speed, higher density of power, and lower temperature of operation. Electrodes, end plates, washers, dipoles, and ion exchange membranes are the most important components of the polymer membrane fuel cell. In the last years, optimization of this system was noticed by researchers, and various economic and functional designs have been presented [7,8].
The modeling of the fuel cell stacks is performed to obtain two significant purposes. The first one is to estimate the efficiency of the fuel cell by polarization curve analysis, and the next purpose is to investigate the fuel cell stack while the cell operates; this helps to propose an optimum design for it. The primary mathematical PEMFC design was presented in the year 1992, and the achievements indicated good structure with the experimental data [9].
Solsona et al. [8] introduced a control-oriented model to analyze the low-temperature PEMFC. The results were then verified based on the empirical data from Na f ion (r) PEMFC, including a humidifier. The comparison of the proposed model with the empirical data confirmed the method efficiency for the analysis of the fuel cell.
Hirano et al. [10] analyzed a PEMFC performance based on numerical analysis. To do the analysis, a model was proposed to indicate the correlations of fuel cell performance, features of the material, and gas diffusion layers. The results were analyzed by performing it on the PEMFC numerical model. Taleb et al. [11] presented a fractional order-based design of a PEMFC stack. The primary objective was to model the PEMFC system based on a fractional calculation to obtain accurate and compact results. The final results confirmed that the obtained values by the proposed method have proper similarity to the laboratory test bench.
Kumar et al. [12] presented a different design for PEMFCs. The method was then analyzed based on ARX and ARMAX validation to verify the method modality. To obtain the proper load current, the study utilized PID and PI controllers. The MATLAB platform was used for the design simulations.
As it is clear, various classic methods exist for this system identification. However, although the introduced methods' application for the identification of the PEMFC is so profitable, they have a big shortcoming. Due to the consideration of all physical concepts of PEMFC by the classic methods, such as power, thermodynamics, momentum's conservation, the complexity of the model is increased.
Furthermore, to develop the precision of the model and to obtain a favorable accuracy, compared with the empirical data, it needs to consider the best amounts for the model parameters. Recently, different types of approaches were presented for this purpose. The use of meta-heuristic algorithms, due to their ability for faster and simpler solving of nonlinear models, are exponentially increasing [13][14][15][16]. Some examples of these methods are the dragonfly algorithm [17], deer hunting optimizer [18_ENREF_20], multi-verse optimizer [19_ENREF_18], improved invasive weed optimization algorithm [20_ENREF_19], and chaotic grasshopper optimizer [21].
Duan et al. [13] proposed an optimal design for the PEM fuel cell stack by the satin bowerbird optimization algorithm (SBOA). The SBOA algorithm is employed to optimize the procedure efficiency analysis. A comparison of the results with several various approaches was performed to indicate the method's performance. The achievements were also verified by the experimental data to show the algorithm's performance.
Carton et al. [22] presented a 3D electrochemical design for an OPCF. The presented model was then compared with a double channel simulation and empirical data that showed a promising match with the empirical data. Simulation results showed that the flow plates in OPCF develop the fluid distribution in this device by 54% performance at 0.7 V.
Cao et al. [15] utilized an improved optimization technique for modeling, designing, and simulating the PEMFC systems with an optimal solution. The optimization method was defined by the seagull optimizer, and the purpose was to use that tool for the best identification of parameters of the PEMFC stack. The model was then assessed by two empirical PEMFC models and was put in comparison with several meta-heuristics to indicate the efficiency of the algorithm.
Yu et al. [23] introduced another method for the PEMFC parameter estimation to develop the model performance. The study proposed the optimization of ENN for this purpose. The optimization was based on the blending of two new optimizers: the World Cup optimizer (WCO) and fluid search optimizer (FSO). The achievements showed better accuracy of the proposed model than the PEM fuel cell design parameters.
Fathy et al. [24] suggested a combined differential evolution and vortex search optimizer for optimal PEMFC parameter estimation. After the design and simulation, the analysis was applied to four experimental benchmarks to show the efficiency of the method. The achievements verified the excellence of the presented approach, compared with the other methods.
Generally, optimizers have proper results for the PEM fuel cell model, which is thanks to the proper capability of them to avoid the local minima, compared to the classic approaches [25][26][27]. A new optimal design for a PEM fuel cell-based system is presented in this paper. The model parameters are then optimized by a newly developed collective animal behavior optimizer (CAB). The results are then validated by empirical data to show the method's precision.

The Model of the Studied System
The overall structure of the analyzed model is depicted in Figure 1. The model considered in this study has a 50 kW fuel cell stack. These types of fuel cells are widely used in vehicles, power plants, military and space equipment, and heat and power cogeneration systems. The air entering the fuel cell passes through the compressor and then enters the compressor after the pressure rises. In this system, humidifiers, pumps, and electrical control devices are considered system peripheral parts. The main purpose of the optimal modeling in the fuel cell stack is to obtain optimal values for the system pressure parameters, its input hydrogen and air, its operational temperature, and its density of current flow to provide the minimum feasible cost. After modeling the system, the next step is to solve the problem, formulate the objective function, and model it concerning the parameters defined. In the following, the objective of the system is given in detail.

Modeling of the Fuel Cell
The system objective function under study is the minimization of the overall cost, including the cost of investment (C 0 ) and the operating cost (C t ) by considering the discount rate (R d ) as follows: The investment cost of the fuel cell stack includes the storage tank (C st ), stack (C stack ), auxiliary costs (C aux ), and fuel costs (C f uel ), i.e., The fuel cell stack of a PEMFC includes different components, such as electrodes, ion exchange membranes, screws, bipolar surfaces, gaskets, and end plates, and other joints. The utilized catalyst in the stack is platinum that has its share in the cost of making the system. The overall cost ($/m 2 ) is calculated from the following equation [28]: where c mem describes the cost of the membrane ($/m 2 ), c e is the cost of the electrode ($/m 2 ), c bp determines the cost of the bipolar plates ($/m 2 ), c ex describes the cost of auxiliaries, such as washers and end plates ($/m 2 ), C montage determines the cost of the stack montage ($/m 2 ), V t determines the fuel cell voltage (v), i represents the cell density, and c pt is the cost of the platinum ($/m 2 ) that is achieved based on the following equation: where C ptg describes the cost of each kilogram of platinum ($/kg) and M pt stands for the amount of catalyst used (kg/m 2 ). In the above relation, the cost of electrodes, the cost of the bipolar plates, and the lateral costs of transport are independent of the current density, while the current density depends on the rate of the catalysis and membrane performance. To calculate the fuel cost, all the input costs to the system are consumed, so the fuel cost is calculated from the underlying relationship.
where c H2 describes the cost of each kilogram of H 2 , P stack represents the fuel cell power, η determines the stack performance, and H 2 TV is the thermal value of hydrogen (kJ/kg). Figure 2 shows the general structure of a PEMFC [29]. The cost of an ancillary system, which is known as the equilibrium cost, is a fraction of the fuel storage and the stack costs, and includes the costs of the compressor, humidifier, electrical control equipment, and other auxiliary equipment in the system. It is formulated as follows [29]: The following equation indicates the unit operating cost, and since these costs are continuously generated by the operation of the power generation system over 90 months, they must be adjusted accordingly. In this study, the manufacturing time of the stack is not considered; only its costs are taken into account, and the time taken into account is also the time of the cell's operation [29].
where R i describes the inflation ratio, R f i represents the fuel inflation ratio, λ H 2 is the hydrogen stoichiometric coefficient, and t 0 is the functional lifetime of the fuel cell. All of the simulation is returned for 90 months, which is the fuel cell's operating lifetime. Both the investment cost and the operational cost are a function of the stack efficiency. The system efficiency is achieved by dividing the net output power by the net input power [30].
where P stack describes the fuel cell's stack power (w), P aux represents the power of the peripheral devices (w), and µ s determines the inverse stoichiometric coefficient. Since in the studied system, the compressor and other peripherals use the power of this system, to obtain the system's net outputted power, the power of the peripherals should be decreased by the achieved power from the fuel cell [31]. The constant 1.25 in the denominator is also an experimental coefficient that is intended for the fuel cell stack systems to operate the system with considering the peripherals, so the stack efficiency is a function of the cell voltage, stack power, stoichiometric fuel rate, and power of other accessories.
There are three main voltage losses in the fuel cell: activation voltage loss, Ohmic voltage loss, and over-potential saturation voltage loss. So, based on [32,33], the output fuel cell voltage is achieved by the following equation: (9) where E N describes the Nernst relation and defines the cell voltage reversibility, N nc determines the connected cells' number, E O stands for the Ohmic voltage loss, E ops refers to the overpotential saturation, and E op describes the activation overpotential per cell. The Nernst equation for the PEM fuel cell is obtained as follows [34]: where, where A determines the active area of the membrane, I FC represents the operational current of the fuel cell, P a and P c describe the partial pressures as an inlet for positive and negative electrodes, respectively, and R ha and R hc stand for the electrodes' relative humidity. P H 2 O is the saturation vapor pressure in the PEMFC and can be calculated as the following given equation [35]: In the operating changes, the reference temperature is considered 25 • C. The formulation of the Ohmic voltage loss can be defined as follows: where, The overpotential activation voltage drop is calculated as given below: where, where C O 2 and C H 2 illustrate the saturation of O 2 and H 2 in the cathode's catalytic interface (mol/cm 3 ), which are achieved as follows: The over-potential saturation (E ops ) is formulated by the following equation [15]: where I is the membrane thickness; S refers to the membrane surface (cm 2 ); I FC is the PEMFC operating current; T FC defines the operating temperature of the cell ( • C); β i describes the experimental coefficients; λ determines the controlling parameter; β defines a parametric coefficient; ρ m is the membrane resistivity; J determines the standard current density and J max is the highest current density; P H , P O 2 , and P H 2 O are the partial pressure of the H 2 , O 2 and H 2 O, respectively; P a describes the inlet pressure for the anode and P c for the cathode; R hc represents the vapor relative humidity at the cathode and R ha the anode; C H2 is the hydrogen saturation and C O2 is the oxygen saturation (mol/cm 3 ); and R m and R c are the membrane and connection resistances, respectively. Table 1 illustrates the optimal value of some undefined parameters based on [15].
On the other hand, to calculate the stack efficiency, in addition to being specific to the stack's power, the auxiliary (accessory) power must also be calculated. It should be noted that the extra power supply for the 50 kW power production is estimated to be 5.2 kW based on [36].
where T e is the input air temperature ( • C), P in and P sys are the input and the system pressures (atm), and the following holds: .
Another investment term is the fuel storage cost that is calculated by the following equation: where F determines the Faraday constant, A is the cell area (m 2 ), t describes the fuel cell performance time (9 month/year), and C s describes the hydrogen's storage cost per kg that is determined based on the hydrogen amount stored as defined below: 244 $/kg f or 27, 000 kg 1.752 $/kg f or 276, 000 kg 1.044 $/kg f or 27, 600, 000 kg (25) As aforementioned, the independent variables of the model are the stack operating temperature, system pressure, air stoichiometric coefficient, and hydrogen as the system inputs as well as the current density. The operating temperature of the system shall be such that it protects both the high temperature of the water and water vapor and does not cause the membrane to break. Therefore, its high level is considered to be 90 • C and its low level is considered to be 60 • C. The stoichiometric coefficient of air and hydrogen is considered the ratio of each of the inlet gases to its theoretical value, so the minimum value of these values is set to 1. Since these values are not high, the upper limit is assumed to be 3. The system pressure cannot be lower than the atmospheric pressure, as the compressor is not capable of compressive pressure; therefore, the low pressure is 0.12 MPa and its upper limit is considered to be 0.48 bar [36]. The high and low current density limits are also equal to 1 and 0, respectively. By the aforementioned equations, the objective function can be defined as given below: Such that the following holds: Converged Collective Animal Behavior Algorithm.

Collective Animal Behavior Algorithm
Meta-heuristic algorithms are based on stochastic searching the solution, and although only a few numbers were shown for converging to the best solution, the simple structure of them, high maneuverability, and above all their higher quickness made them popular optimization tools in the last years [23]. Recently, different models of meta-heuristics were introduced, which all have their strengths and weaknesses. Considering these characteristics and improving them based on different theories can make them stronger from their typical version with more profits. Meta-heuristic algorithms are inspired by different phenomena, from nature [26,37,38] to human social behaviors [25,[39][40][41][42][43].
Cuevas et al. [44] proposed a new approach in 2019, which was an inspiration for collective animal behavior (CAB). The CAB algorithm was modeled based on a collection of different operations that simulate the association of social animal behaviors. Here, the problem solution is defined by the animal position that is placed in the solution space. The value of cost is also determined by animal dominance through the group. An advantage of this optimizer is that it considers a two-part memory for storing the optimal solutions based on previous experiences. One part is the memory that keeps the optimal location of the animal per iteration (Mg), and the next one stores the optimal historical locations over the optimization (Mh). A detailed description of the CAB algorithm is explained in the following.
The optimizer begins with some locations of the animal. The location of each animal, p contains a D-D vector with parameter values to be optimized. The CAB optimizer contains several identical random distributed amounts between the predetermined upper and minimum bounds such that the following holds: where p i,j determines the j th parameter of the i th animal, σ represents a random integer by a mean value equal to 0 and value of variance of 1, j refers to the individual, and i the parameter indices. After generating the new population, they are sorted and stored in the memories Mg and Mh following their cost function. During the operation of the swarm, the first B constituents (i.e., [p 1 , p 2 · · · p B ]) of the new position for animals are obtained based on the historical memory M h plus a slight randomly perturbation surrounding them, i.e., where m l h represents the l th number of the M h and v describes a randomly small length vector. The algorithm uses a randomly local absorption by the individuals to improve the exploitation. This is performed by applying for an identical random number between 0 and 1. In this mechanism, if r m has an amount higher than a determined threshold (T), it can be attracted to the nearest M g in the solution space in the present iteration, and if the r m has a value less than the threshold, a definite position for the animal can be attracted by the best nearest historical location (M h ): where r m describes a random value, and m closest h and m closest g determine the closest elements of M g and M h to x i .
Afterward, for improving the random moving of the animals with probability P i , the following model is considered: where r determines a random value for animal position initializing again randomly. The animals with more communication have better value with the minimum distance, which depends on how the animals' swarm behaves. So, during connecting the animals, the most dominant of them stay and the others are eliminated. The updating steps for historical memory are performed as follows: Consider M U the total memory, i.e., ; if the distance <δ, the animal with the better cost value remains and the other is eliminated.
The elements of M U from phase 2 achieve the B optimum amount to build the new M h .
The distance amount δ is formulated as shown below: where p high j and p low j describe the pre-defined higher and minimum bound of the j th the variable in a D-dimensional space, respectively. Converged CAB Algorithm Among the different advantages of the CAB algorithm, it shows that sometimes, its solution gives premature convergence. Here, two important modifications are performed to resolve that shortcoming. The first modification is performed based on a self-adjustable weighting to handle the tendency speed to the optimal solution. To update the animals' position in this way, a controlled random value is implemented on the swarm exploration and the "repulsive effect" terms. To make a proper balance between exploration and exploitation, initial iterations search with a high searching limit, and the final ones are explored by a local search. This mechanism was applied to the random movement term as shown below: where, where f (p worst ), and f (p best ) refer to the worst and the best solutions' cost values, respectively, for the random moving. Based on the mentioned structure, the weight value for the random moving is increased incrementally to reduce the best and the worst solutions' differences.
The next mechanism that is employed here is the chaos approach, which is applied to resolve the local optimization problem. Based on the chaos mechanism, the optimal solution is sometimes likely to be stuck in the local optima, which makes a misleading solution for the other animals in the swarm, and, in following the local optimal solution, consequently, results in premature convergence.
To find a solution for this issue, the random values in the algorithm are turned into pseudo-random values by the chaos mechanism. This theory has sequences and ergodic random features that are very useful to develop the premature convergence of the algorithm [45,46]. In the proposed algorithm, the logistic map, as a widely used mechanism in chaos theory, is used. By algorithm development, the equations below are updated as follows: where, where ρ i describes the amount for the i th chaotic iteration, and the primary amount ρ 1 ∈ [0, 1] is a random amount. Figure 3 shows the workflow of the suggested CCAB algorithm.

Algorithm Confirmation
To validate the proposed CCAB algorithm efficiency, some unimodal and multimodal test functions were utilized. The achievements of applying the suggested CCAB optimizer were put in comparison with several various meta-heuristic optimizers, the World Cup optimizer (WCO) [25], emperor penguin optimization (EPO) [47], gravitational search algorithm (GSA) [48], and typical CAB algorithm [44], to declare its high efficiency. The general information about the test functions for verification is given in Table 2.

Model Function Formulation Optimum
Unimodal Rotated High Conditioned Elliptic Multimodal Shifted and rotated Rosenbrock Shifted and rotated Ackley The population size for all the optimizers is set to be 120, and the stopping criteria are defined by the highest value of the evaluated functions. The dimension of the functions is equal to 30. The optimum effectiveness is obtained by runs of more than 45 as stated in Table 3 for each function. As observed, "Med" describes the result fitness values' median, "std" determines the standard deviation, and "min" and "max" are the lowest and highest cost values for the optimizers, respectively. The results show that the presented optimizer gives the optimum achievements compared with other optimizers for the evaluated test functions.

Calculation of Optimum Parameters
The model is developed with the objective function for minimizing the cost of fuel cell fabrication based on the proposed converged collective animal behavior (CCAB) algorithm and solving the optimal values for each of the main parameters. As can be observed, the optimal operating temperature is 75.2 • C, the optimal system pressure is approximately 0.47 MPa, the optimal density of the current is almost 0.61 mA/cm 2 , and the optimal stoichiometry coefficients are 1.42 for air and 1.25 for hydrogen. Table 4 indicates the optimal values for optimization parameters. The optimal costs for the proposed CCAB, standard CAB, and GA are estimated at 0.1061 $/kWh, 0.1124 $/kWh, and 0.1603 $/kWh. Figure 4 depicts the performance diagram of the optimizers in the optimization process. The results show how as time passes and the number of new iterations becomes more and more objective, the objective function shifts to the lowest feasible amount. In the following, for the sensitivity analysis of the system performance, variables are repeatedly changed each time, but the values of the other parameters are replaced with the optimal values obtained by the CCAB algorithm.

The Pressure Changes Affect the Construction Cost of the Cell
As can be concluded from the results of Figure 5, by increasing the inlet pressure of the system up to 5 bar, the total cost of it is decreased by 20%. However, this increase in pressure due to the mechanical and physical mechanisms of the membrane and the electrodes, and also the bipolar plates is not feasible. By the increase in pressure, also the linkages between the gas diffusion plates and the catalyst are eliminated, while the gas diffusion surfaces generally consist of carbon coatings or paper carbon, which are corrosive to the mechanism. Therefore, consideration of the structure of its constituents is adapted.

The Temperature Changes Affect the Construction Cost of the Cell
Assuming that the operating temperature of the fuel cell is variable and that the other modeling parameters are stable (their optimal value), the total cost of the system decreases with increasing temperature ( Figure 6). However, two points need to be noted: firstly, Nafion's heat resistance as a membrane of the fuel cell is a limiting element for the exceedingly high operation temperature, and the second is that the best way for the protons to pass by the membrane is when the water is moved in the two steps of the heater and operation fluid. The only water step in the fuel cell is the steam step if the peak operation temperature is increased, which has an impact on the hydrogen exchange. Therefore, the efficiency of the system is greatly reduced if all the parameters are affected. Therefore, by considering all of the effective parameters in the fuel cell performance as variables, the optimal mode for its operation is 75.2 • C. At this temperature, the membrane passing water is completely biphasic.

The Current Density Effect on the Construction Cost of the Cell
The total cost changes, as concerns the current density changes, are depicted in Figure 7. Notably, due to the relationships presented in the modeling section, it is not possible to directly modify the current density. However, investigations to find out how much the system is optimized for parameter changes indicate that the cost of the overall system is increased with an increase in the current density. This is because one of the most important methods to increase the porosity of the porous membrane-catalyst-porous current is to use rather cost-effective approaches when fabricating the membrane electrode group, so the optimal amount of this parameter based on the objective function is 0.61 mA/cm 2 .

The Stoichiometric Coefficients of Hydrogen and Air Effect on the Construction Cost of the Cell
The following figure (Figure 8) depicts the changes in the total cost of the system of fuel cells relative to the changes in the stoichiometric coefficients of the reactants. As can be seen, in both forms, the cost of the process increases if the proportion of the stoichiometry is increased. The difference between them is that changes in the stoichiometric air ratio have a low pronounced effect on the hydrogen cost. This is also due to the high cost of construction, storage, and transport of hydrogen. Therefore, it is increased to obtain the optimal parameter values, but it is worth noting that when this ratio increases, which is directly proportional to the increase in the inlet air, the compressor power can be a factor limiting the cost reduction. Finally, by considering all the cases, the impact of the entire efficiency of the system on the cost of the system is given in Figure 9. As can be seen, by improving the performance of the fuel cell, its total cost is decreased.

Conclusions
To directly convert chemical energy into electricity without combustion, an electrochemical device, which is called a fuel cell, is used. Because of the various benefits of this device, including cleanliness, connection to micro-turbines, silent operation, no moving elements, and lack of GHG emission, it has become a favored energy source recently. One of the biggest disadvantages of these energy conversion systems is their cost of construction and operation. This study attempted to find the best operating conditions in a 50 kW fuel cell stack to minimize its cost and its accessories, such as compressors and humidifiers. In this regard, a functional-economic model was developed for the system under study in which all components of the system are modeled economically as well as electrochemically-mechanically. The objective function here was solved by a newly improved metaheuristic by the authors called the converged collective animal behavior (CCAB) optimizer. The optimal cost was compared with standard CAB and GA, and the best optimal value was achieved by the CCAB with 0.1061 $/kWh. Afterward, a sensitivity analysis was applied to the above-mentioned performance parameters. The results declare that as the temperature and the system pressure increases, the system cost decreases, but since the structure of the membrane and the fuel electrode must be considered in terms of thermal resistance and mechanical strength, limiting factors for their control and achieving optimal performance (higher efficiency) are to be taken into account. On the one hand, increasing the stoichiometric ratio of air and hydrogen increments the entire system cost, which is logical, given the conditions of production and storage of this transducer. At the same time, increasing the density of current initially decreases the costs and then increases it, which is due to the porosity of the triple layer of the membrane-electrocatalyst-gas diffusion plates, which can be calculated based on the performance parameters and the relations governing the economic-functional modeling and the change rate of the system relative to it.