Optimal Parameter Estimation of Proton Exchange Membrane Fuel Cells

The problem of parameter estimation of the proton exchange membrane fuel cell (PEMFC) model plays a significant role in the simulation and optimization of a PEMFC system. In the current research, a moth flame optimization algorithm (MFOA) is used to identify the best parameters of PEMFC. Two different PEMFCs, Nedstack PS6, 6 kW, and SR-12 PEM 500 W are used to demonstrate the accuracy of the MFOA. Throughout the optimization process, seven unidentified parameters (℥1, ℥2, ℥3, ℥4, λ, R, and B) of PEMFC are appointed to be decision variables. The fitness function, which needed to be minimum, is represented by the root-mean-square error between the calculated voltage of the PEMFC and the experimental dataset. The results attained by the MFOA are compared with the sine cosine algorithm (SCA) and particle swarm optimization (PSO). The following metrics are considered in the comparison: best value, worst value, average value, standard deviation, and efficiency. The main findings verified the supremacy of the MFOA in estimating the best parameters of the PEMFC model in comparison with PSO and SCA. For the Nedstack PS6, the efficiency values are 24.50458%, 79.477%, and 38.84747% for MFOA, PSO and SCA, respectively. For PEMFC (SR-12 PEM), the average efficiency values are 14.965%, 79.933% and 31.87% for MFOA, PSO, and SCA, respectively.


Introduction
The increasing global demand for low carbon-emitting fuel cell-based vehicles and growing adoption of clean sources of energy production have augmented the need for developments in fuel cell technology [1]. Furthermore, increasing power sector and augmented distributed power generation capacities globally will further support the development of the fuel cell market [2]. A fuel cell stack is an electrochemical device that converts the chemical energy of the fuel (most often hydrogen) into electrical energy [3]. By application, the fuel cells are divided into transportation, portable, and stationary applications. Advances in fuel cell technology are occurring rapidly in the transportation sector due to the extensive use of fuel cells in heavy-duty land vehicles, such as public transportation buses. In addition, stationary fuel cell power systems are gaining more attention in commercial and residential buildings. Stationary fuel cells can be used in several applications such as supplying co-generation power, combined heat and power, off-grid primary source power systems, and backup power sources [4]. Fuel cells are classified into proton exchange membrane fuel cells (PEMFC), phosphoric acid fuel cells (PAFC), alkaline fuel cells (AFC), and microbial fuel cell (MFC) [5]. PEMFCs are responsible for most of the developments in fuel cell technology in 2020 and are expected to increase at the highest rate from 2021 to 2025 as a result of their applications in fuel cell-based electric vehicles.
An accurate model of a PEMFC depends on the availability of parameters that are unavailable in the manufacturing datasheet. It is therefore mandatory to determine the unknown PEMFC parameters to provide an accurate model closely matching the experimental data under various operational conditions [6].
The output voltage of a PEMFC relies on parameters related to the chemical procedures occurring inside the PEMFC [7]. Some approaches are utilized to estimate the correct parameters of PEMFC. Among these approaches, modern optimization-based methods are employed to solve the PEMFC parameter identification problem due to their consistency, robustness, and simplicity. For example, Qin et al. [8] proposed an improved fluid search optimization algorithm to solve the problem of PEMFC. Additionally, Yuan et al. [9] suggested an optimized technique to estimate PEMFC parameters using an enhanced edition of the sunflower optimization algorithm. Cao et al. [10] introduced a linear-quadratic-Gaussian optimal process to control the PEMFC system. To enhance the performance of the control system, a modified version of the whale optimization algorithm has been used. El-Hay et al. [11] proposed a method based on an interior search algorithm to determine the steady-state and transient parameters of fuel cells. In the study, a proportional-integral controller is integrated with the dynamic model to enhance its performance throughout transient disturbances [11]. Meanwhile, Menesy et al. [12] suggested an efficient parameter extraction strategy based on a modified artificial ecosystem optimizer applied to the model of PEMFC. The cost function is represented by the sum of squared errors between the measured and estimated voltage of the fuel cell.
In this work, a moth flame optimization algorithm (MFOA) is used to identify the best parameters of a PEMFC. Two different PEMFCs (NedStack PS6 and SR-12 PEM 500 W) are used to demonstrate the accuracy of the MFOA. Throughout the optimization process, seven unidentified parameters (℥ 1 , ℥ 2 , ℥ 3 , ℥ 4 , λ, ℛ, and B) of a PEMFC are appointed to be decision variables. The objective function, which needs to be the minimum, is represented by the root-mean-square error (RMSE) between the calculated voltage of a PEMFC and the experimental dataset. The results attained by the MFOA are compared with the sine cosine algorithm (SCA) and particle swarm optimization (PSO).
The contributions of the current work are briefly summed as follows: MFOA is applied to estimate the best parameters of the PEMFC model. A comprehensive comparison is made with PSO and SCA. The superiority and reliability of the MFOA-based strategy in solving the PEMFC parameter identification problem is validated.
The rest of the paper is organized as follows. Section 2 presents a general description of the parameter identification problem of PEMFCs. A brief overview of the core idea of the MFOA, PSO, and the SCA are introduced in Section 3. Section 4 discusses the obtained results. Finally, the main findings are outlined in Section 5.

Problem Formulation
Details of the steady-state characteristics of PEMFC are described using electrochemical relations [13]. Fig. 1a shows the structure of a PEMFC. The PEMFC model includes seven undetermined parameters. It is mandatory to correctly identify these parameters to obtain polarization curves that correspond to the experimental data. ℥ 1 , ℥ 2 , ℥ 3 , and ℥ 4 denote the semi-empirical parametric factors of the PEMFC, with λ representing a scalar factor varying from 10 to 24, ℛ denoting the contact resistance (Ohm), and B representing a parametric coefficient (volt).
The output voltage of a PEMFC versus the current density is plotted in Fig. 1b. To estimate the output voltage (V out ), three voltage drops must be considered [7]: activation, ohmic, and concentration voltage drops. The following relationship represents the output voltage of a PEMFC: where V a , V o , and V c are the activation voltage drop, ohmic voltage drop, and concentration voltage drop, respectively.
The thermodynamic potential (E N ) can be calculated using the following relationship: where T is the cell temperature, P Ã O2 denotes the oxygen pressure, and P Ã H2 denotes the hydrogen the pressure. Next, the activation loss can be estimated as follows: where C Ã O 2 denotes oxygen concentration, and i f represents the cell current. The ohmic loss is calculated follows: where R m denotes the ohmic membrane resistance, and ℛ is the contact resistance.
The concentration loss is defined by where J max denotes the maximum current density.
The PEMFC stack includes several series-connected cells to increase the total voltage. Therefore, the total stack voltage of PEMFC (V s ) is defined as follows: The main purpose of this work is to estimate the best parameters of the PEMFC model using three different optimizers: MFOA, PSO, and SCA. As mentioned above, the seven undetermined parameters of the PEMFC model are designated during the optimization process as decision variables. The fitness function, which needs to be the minimum, is represented by the RMSE between the calculated voltage and the experimental dataset. The optimization problem can be defined using the following relationships [14].
where f 1 ; f 2 ; f 3 ; and f 4 denote nonlinear functions. Therefore, the cost function can be formulated mathematically by the following [7]: Subject to the following constraints: where k is number of samples and V m k ð Þ is the measured data.

Brief Overview of Optimization Algorithms
In this paper, three optimization algorithms are considered: MFOA, PSO, and SCA.

Moth Flame Optimization Algorithm
The original version of MFOA was proposed by Mirjalili [15]. The key motivation of MFOA is the navigation method of moths in nature called transverse orientation. Moths fly at night by maintaining a fixed angle with the moon, which is an effective mechanism for traveling in a straight line for long distances. However, these sophisticated insects are trapped in a useless and deadly spiral path around artificial lights. 1 An updating process for MFOA can be carried out based on the following. The logarithmic spiral is defined for MFOA by the following relationship.
where D i denotes the distance between the moth and the flame.
b is a constant, which is assumed to be 1.
M i denotes the ith moth, and F j denotes the jth flame.

Particle Swarm Optimization
Originally suggested by Kennedy and Eberhart [16], PSO is one of the most prominent optimizers. The core idea of PSO is extracted from the flocking behavior of birds in nature. The original PSO method is simple and easy to execute. Every particle is a candidate solution. PSO comprises two vectors: location and velocity. The location vector includes values for each variable in the problem. To modify the location of particles, velocity is considered. PSO defines the magnitude and direction of the step size for each dimension and particle independently 2 . The updating process for velocity and location of particles can be defined as follows.
V is the velocity, P best is the best solution, g best is the global best.

Sine Cosine Algorithm
The original version of SCA was proposed by Mirjalili [17]. The SCA creates multiple initial random candidate solutions and requires them to fluctuate outwards or towards the best solution using a mathematical model based on sine and cosine functions. Several random and adaptive variables are also integrated into the algorithm to emphasize exploration and exploitation of the search space in different optimization milestones. 3 The updating process for SCA can be executed based on the following. where x denotes the position of the current solution. P denotes the position of the destination point. The value of r 1 can be estimated using the following relationship.
where t and T are the current iteration and the maximum number of iterations, respectively. r 2 , r 3, and r 4 are random numbers, which can be defined as follows:

Results and Discussion
The parameters of two PEMFCs, Nedstack PS6 and SR-12 PEM 500 W, are determined in this current research using MFOA, PSO, and SCA. The specifications of the considered PEMFCs are presented in Tab. 1 [14].
To be fair in the comparison, the population size and maximum number of iterations for MFOA, PSO, and SCA are set to 30 (population size) and 100 (maximum number of iterations). During the optimization procedure, the RMSE between the calculated cell voltage and measured data is used in the fitness function, which needs to be the minimum. The unknown parameters of the PEMFC model are designated as decision variables. The lower and upper limits of these parameters are given in Tab. 2 [14,18].       Fig. 4 (upper). There is high matching between the estimated dataset applying MFOA and the experimental data. The coefficient of determination and the mean absolute error values are 0.9984 and 0.2304, respectively. The variation of the absolute error is demonstrated in Fig. 4 (left down). The maximum absolute error is 0.57. This confirms the precision of the MFOA in determining the actual parameters of NedStack PS6. The  result of the whiteness test for NedStack PS6 applying MFOA is displayed in Fig. 4 (right down). The key objective of such a test is to guarantee that the selected model parameters describe the measured data completely without any mismatch. It was determined using the residual autocorrelation function (RACF) at different time lags. Referring to Fig. 4 (right down), the RCAF values vary from -1 to +1.

Conclusion
In this research, a moth flame optimization algorithm (MFOA) has been used to estimate the seven unknown parameters (℥ 1 , ℥ 2 , ℥ 3 , ℥ 4 , λ, ℛ, and B) of the PEMFC model. Two types of PEMFCs, NedStack PS6 6 kW and SR-12 PEM 500 W are used to demonstrate the accuracy of the MFOA. The achieved polarization characteristics of the PEMFC model using MFOA were closely matched with the measured data. Four statistical metrics: standard deviation, RMSE, efficiency, and the coefficient of determination are used to compare the results obtained by MFOA with the sine cosine algorithm (SCA) and particle swarm optimization (PSO). For NedStack PS6, the mean fitness function values are 5.984966, 0.161541, and 0.425626, respectively, for MFOA, PSO, and SCA. The lowest STD of 0.040965 is achieved by MFOA. The efficiencies are 24.50458%, 79.477%, and 38.84747% for MFOA, PSO, and SCA, respectively. For PEMFC (SR-12 PEM), the smallest fitness of 0.185512 is reached using MFOA flowed by 0.526204 using SCA. The lowest STD of 0.05995 is achieved by MFOA. The average efficiency values are 14.965%, 79.933%, and 31.87% for MFOA, PSO, and SCA, respectively. These results confirm the superiority of MFOA compared with PSO and SCA in determining the unknown parameters of the PEMFC model. In the future, other types of PEMFCs will be considered to test the robustness of the MFOA.
Funding Statement: The authors received no specific funding for this study.
Conflicts of Interest: The authors declare that they have no conflicts of interest to report regarding the present study.