The Use of MATLAB Programming to Compare Experimental vs Modeled PEMFCs using the Nernst and Butler-Volmer’s Equation-Based Mathematical Models

For the analysis of Proton Exchange Membrane Fuel Cell (PEMFC’s) efficiency, the Nernst equation and Butler-Volmer's concepts were used. The mathematical models using both equations were developed in MATLAB and compiled. The results generated by the output current based on the input parameters of the experimental data were compared with the experimental results for the two modeled PEMFCs. The parameters temperature, pressure, hydrogen concentration, and oxygen concentration at different values of external resistance were used to determine the change in output current in both models built in MATLAB. This sensitivity analysis generated negative output current values and highly dissimilar values with the experimental results for the same input parameters for both models due to the less use of input parameters in the model. The results showed that the PEMFC's performance is affected by most parameters, and many influencing parameters must be used to develop a perfect mathematical model of the PEMFC.


INTRODUCTION
One kind of electrochemical cell that directly transforms the chemical energy of hydrogen and oxygen into electrical energy is a PEMFC (Proton Exchange Membrane Fuel Cell).It belongs to the fuel cell class, which produces electricity using an electrochemical reaction between an oxidizing agent and a fuel.Because of their excellent energy efficiency and environmental friendliness, PEMFCs, or fuel cells, or FCs, have become a beautiful alternative energy source (Kreuer, 2001;Kruczek, & Matsuura, 1998).PEMFCs have a lot of fixed and mobile applications and are an intriguing substitute for traditional power generation (see Figure 1) (Ziogou et al, 2018).

Fig. 1 Diagram for illustration of PEMFC
Proton exchange membrane (PEM) fuel cells use a proton-conducting polymer membrane as the electrolyte (Ünlü et al, 2010).They may be powered by hydrogen and are primarily intended for mobile, stationary, and transit applications.They can quickly adjust their output and have a low operating temperature to meet shifting power needs.The materials and assembly techniques employed in fuel-cell stacks significantly impact the fuel cells' performance.They must maintain constant pressure, prevent gasses and liquids from escaping, and avoid becoming overly stressed.
Such PEM fuel cells can be mathematically modeled.As more potent fuel cell stacks become available and must be integrated into power systems, fuel cell modeling is becoming increasingly crucial (Sankar, & Jana, 2021).Hydrogen gas is the fuel cell's primary energy source (Friede et al, 2004).A mathematical model can be developed based on hydrogen input as a source for electricity generation through the fuel cell.In the stack, heat and liquid water are produced due to the reaction between the oxygen supplied by the cathode and the hydrogen supplied by the anode, which produces electrical energy (Hajimolana et al, 2012).Research is being conducted to improve PEMFC in the following areas: operation and control, modelling and simulation, design, and construction (material, membrane, and catalyst) (Sankar, & Jana, 2021).PEMFCs' complicated behaviour, which includes nonlinearity and spatial fluctuations, presents intriguing challenges for these tasks (Hajimolana et al, 2012).The mathematical model optimized with the input parameters, if it shows results similar to the practical PEMFCs, can be applied to predict the current generated by PEMFCs, and such models help to lower resources invested in practical models.Generally, the capacity to model and optimize the process and then develop suitable strategies based on this optimized model is one element that makes advanced control systems successful (Methekar, 2010).
To develop a mathematical model for a Proton Exchange Membrane (PEM) fuel cell and understand the electrochemical processes inside the cell, two essential tools are the Nernst equation and the Butler-Volmer equation.The Nernst equation provides a theoretical basis for comprehending the fuel cell's thermodynamics by enabling the cell potential to be calculated depending on variables like temperature and reactant partial pressures.However, the Butler-Volmer equation, which considers variables like charge transfer coefficients and overpotential, is essential for characterizing the kinetics of the electrochemical reactions at the electrodeelectrolyte interface.Researchers and engineers can simulate and predict the performance of PEMFCs under various conditions by combining these equations inside a modeling framework.The mathematical model, which is frequently applied with the use of MATLAB or similar tools, makes it easier to optimize essential parameters, which helps with the design and development of dependable and effective PEMFC systems for a range of applications.
The remaining sections of the study are organized as follows: section 2 describes the methodology; section 3 presents the results and discussions; and finally, section 4 concludes the article with conclusions, recommendations, policy insights, and future works.

METHOD
A comprehensive mathematical model of a PEMFC must consider several variables and operations.Ohm's law and the Nernst equation are frequently used in basic models.A basic MATLAB code that used these fundamental equations to determine the current generated by a PEMFC when the user enters a few parameters was used to create a PEMFC.Similarly, using the Butler-Volmer equation, an alternate method of simulating a proton exchange membrane fuel cell is to characterize the electrochemical kinetics at the anode and cathode.According to the Butler-Volmer equation, the PEMFC was designed to estimate the current produced by a PEMFC.

Nernst model
An electrochemical cell's electromotive force (EMF) and the activities (concentrations for ideal solutions) of the chemical species involved in the cell reaction are related by the Nernst equation, a fundamental electrochemical equation.When simulating the voltage output of fuel cells, such as PEMFC, the Nernst equation is especially helpful (Omran et al, 2021;Yadav et al, 2022). Where:  Ecell is the cell potential,  E 0 cell is the standard cell potential,  R is the ideal gas constant (8.314J/(mol K)),  T is the absolute temperature (in Kelvin),  z is the number of moles of electrons transferred in the cell reaction, The electrochemical oxidation of hydrogen at the anode and the reduction of oxygen at the cathode are commonly associated with the pertinent cell processes in a PEMFC.The following can be used to illustrate these reactions: Anode Reaction: H2 2H + + 2e - Cathode Reaction: The overall cell reaction is the sum of these two half-reactions: Applying the Nernst equation to the half-reactions allows us to calculate the Nernst potentials for the anode and cathode, which are then used to determine the cell voltage.The Nernst potentials (ENernst) for the anode and cathode are given in Equation ( 2) and Equation (3) (Wagner et al, 1998;Chen et al, 2011;Benchouia et al, 2013;Yakabe et al, 2000;Mugikura, & Asano, 2002;Singh et al, 1999;Bessler et al, 2007). Here:  E 0 Cathode and E 0 Anode are the standard electrode potentials for the anode and cathode respectively,  [H + ] and [O2] are the concentration of protons and oxygen, respectively.
The overpotentials and, ultimately, the cell voltage is calculated using these Nernst potentials.It's important to realize that this is a simplified model, and for a more realistic depiction of PEMFC performance in real-world settings, other elements like activation losses, mass transport constraints, and other electrochemical phenomena must be considered (Stafell et al, 2019;Colombo et al, 2023).
Here, [ H2] and [O2] stand for the oxygen and hydrogen concentrations, respectively.The terms related to temperature, Faraday's constant, standard potentials, and the natural logarithm of the concentration terms are displayed in the equation's structure.

Model Generation
The mathematical model was developed in MATLAB using the code mentioned below based on the concepts discussed above for Nernst model (see Figure 2).The following experimental data as mentioned in Table 1 below were obtained from (Riad et al, 2023) and were used for the PEMFC model discussed above.

RESULTS AND DISCUSSION
The MATLAB's code was compiled to determine the results generated by the parameters for which the following results were obtained as shown in Table 2. Similarly, sensitivity analysis was performed on varying random input parameters due to which the following results were obtained as shown in Fig. 3 below:  (5) Where:  i is the current density,  i0 is the exchange current density/ related to the rate of the electrochemical reaction at equilibrium,  α is the charge transfer coefficient,  F is Faraday's constant. η is the over potential. R is the ideal gas constant. T is the absolute temperature.
Modeling charge transfer processes at the anode and cathode of electrochemical cells, including fuel cells, is frequently done using the Butler-Volmer equation.The anode and cathode reactions in a PEMFC can be independently studied using the Butler-Volmer equation.
For our model, the following procedures in writing code were followed: a) User Input: Nernst potentials and the standard electrode potential (0 V for hydrogen and 1.23 V for oxygen).

Model Generation
Based on the concepts discussed above for the Butler-Volmer model, a mathematical model was developed using the following code in MATLAB.

Data inputs
The same experimental data obtained from (Riad et al, 2023) has been used to determine the results for the above code.

Model's results
The input parameters shown in Table 1 above showed the following output results when used in the mathematical model: The input parameters shown in Table 1 above showed the following output results when used in the mathematical model: Similarly, sensitivity analysis was performed on varying random input parameters due to which the following results were obtained as shown in Fig. 8 below:

Compare of experimental Vs model results
The experimental and the modeled PEMFC showed high dissimilarity in output current as shown by the results obtained while compiling the code.The experimental and developed mathematical model's results when compared determine the effect of change in external resistance on current generated.The following results as shown in Fig. 9 below were obtained.
Mathematical modeling was done and sensitivity analysis was essential to determine the effects of design parameters on the fuel cell's performance (Dickinson, & Wain, 2020).The analysis was performed to check the sensitivity of the results proposed models based on two of the popular concepts applicable in PEMFC.The comparison between the experimental and the modeled PEMFC showed that the current generated by the PEMFC gets highly affected by external resistance and the sensitivity analysis shown in Fig. 4 and Fig. 8 show that the results are greatly affected by the change in each type of input parameter such as current, pressure, temperature, concentration of oxygen and concentration of hydrogen.
Our experimental model could not predict the current with good accuracy as shown by the plots in Fig. 5, Fig. 6, Fig. 8 and Fig. 9 where the experimental results showed a high degree of dissimilarity with the current generated by our proposed models for the change in external resistance however, the overall analysis was helpful to check the feasibility of the proposed models to estimate the applicability of the proposed models in determining the output current generated by PEMFC based on the input parameters current, pressure, temperature, concentration of oxygen and concentration of hydrogen as we discussed above.
Similarly, sensitivity analysis was performed on varying random input parameters due to which the following results were obtained as shown in Fig. 8 below:  Mathematical modeling was done and sensitivity analysis was essential to determine the effects of design parameters on the fuel cell's performance (Dickinson, & Wain, 2020).The analysis was performed to check the sensitivity of the results proposed models based on two of the popular concepts applicable in PEMFC.The comparison between the experimental and the modeled PEMFC showed that the current generated by the PEMFC gets highly affected by external resistance and the sensitivity analysis shown in Fig. 4 and Fig. 8 show that the results are greatly affected by the change in each type of input parameter such as current, pressure, temperature, concentration of oxygen and concentration of hydrogen.
Our experimental model could not predict the current with good accuracy as shown by the plots in Fig. 5, Fig. 6, Fig. 8 and Fig. 9 where the experimental results showed a high degree of dissimilarity with the current generated by our proposed models for the change in external resistance however, the overall analysis was helpful to check the feasibility of the proposed models to estimate the applicability of the proposed models in determining the output current generated by PEMFC based on the input parameters current, pressure, temperature, concentration of oxygen and concentration of hydrogen as we discussed above.

FINDINGS
From the above analysis, we found that the modeled PEMFC is not completely accurate in predicting the current generated by PEMFC in general life however; it gives insights on how the current generated gets influenced by various parameters.The results are found highly dissimilar from the experimental results which can be due to the need for additional parameters in modeling an ideal PEMFC simulated model.Thus, the overall analysis showed that our proposed models cannot be applicable in determining the current generated by PEMFC and more parameters are essential to create a perfect PEMFC's mathematical model to predict the current generated by it more accurately.
Butler-Volmer's theories and the Nernst equation were used to analyze the efficiency of proton exchange membrane fuel cells (PEMFCs), and the results were quite insightful.Based on these equations, two mathematical models were created in MATLAB and contrasted with the outcomes of the experiments.The models attempted to forecast variations in output current by taking into account variables like temperature, pressure, hydrogen concentration, and oxygen concentration at various external resistance values.Due to the restricted use of input parameters, the sensitivity analysis did reveal several issues, such as negative output current values and notable discrepancies with experimental data.

RECOMMENDATIONS
It is advised to increase the parameters taken into account in the mathematical models in light of the limits that have been found.The PEMFC models may be more accurate and useful if wider ranges of affecting elements, such as extra electrochemical and environmental variables, are included.Moreover, the sensitivity analysis should be improved to better match the simulated outputs with the experimental results.

POLICY INSIGHTS
The results highlight the significance of a sophisticated method for PEMFC modeling and the requirement for a larger range of influencing parameters.
To make informed judgments on fuel cell technology, policymakers and academics should acknowledge the complexity of PEMFC behavior and give priority to complete models.This realization necessitates teamwork to provide uniform modelling procedures among fuel cell researchers.

FUTURE WORKS
Subsequent studies ought to concentrate on improving the mathematical models with the addition of a wider variety of parameters.Closing the gaps found could result in the creation of PEMFC models that are more precise and useful.Furthermore, investigating cutting-edge modelling strategies and taking into account newly developed technologies may help to continuously enhance PEMFC predictions.It is recommended that scientific communities work together to build a strong basis for PEMFC modelling in order to promote fuel cell technology development.

Fig
Fig. 2 Nernst's model in MATLAB

Fig
Fig. 4. Plots of sensitivity analysis of the model 3.1.Comparison of model vs experimental results The experimental and the modeled PEMFC showed high dissimilarity in output current as shown by the results obtained while compiling the code.The experimental and developed mathematical model's results when compared determine the effect of change in external resistance on the current generated.The following results as shown in Fig. 5 below were obtained.

FigFig. 7 .
Fig. 6.Butler-Volmer's model in MATLAB 3.4 Output The model's code when compiled asked for the following values as input parameters:

Fig
Fig. 8. Plots of sensitivity analysis 3.8.Comparison of experimental Vs model results The experimental and the modeled PEMFC showed high dissimilarity in output current as shown by the results obtained while compiling the code.The experimental and developed mathematical model's results when compared determine the effect of change in external resistance on current

Fig. 9 .
Fig. 9. Plot for resulting current variation in experimental and modeled PEMFC