# Prediction of Transient Hydrogen Flow of Proton Exchange Membrane Electrolyzer Using Artificial Neural Network

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

_{2}O → 4H

^{+}+ 4e

^{−}+ O

_{2}

^{+}+ 4e

^{−}→ 2H

_{2}

^{+}cations from the anode to the cathode while ensuring the separation of the H

_{2}and O

_{2}produced. PEM electrolyzers can generally operate around a current density of 2 A/cm

^{2}at an approximate voltage of 2.1 V and in a temperature range of 50–80 °C [4]. However, the acidic cell environment in the sulfonic-based membrane forces the utilization of particular materials. These materials need to resist the corrosive condition of low pH and sustain the applied overvoltage at the anode, which is about 2 V, and at relatively higher current densities. The catalyst used in an electrolyzer system, along with the current collectors and separator plates, must exhibit corrosion resistance. This quality is essential because these components are exposed to the harsh conditions of the electrolysis process. Only a limited number of materials can meet the requirements for corrosion resistance under such circumstances [4]. To accomplish this, elevated loadings of precious metal electrocatalysts, for example, platinum (Pt) or iridium (Ir), and expensive limiting corrosion-resistant components such as bipolar plates are needed [4]. In marketable units, differential pressure technology is adopted such that the anodic side is supplied with water at standard pressure. The cathodic side generates H

_{2}at 25–35 bar [5,6]. The hydrogen output from this unit can limit the contamination with oxygen. Moreover, the unit can reduce the minimum electrical load as well as the necessity of oxygen removal [7]. Furthermore, it is important to incorporate a de-moisturizing system in the electrolyzer setup to remove water. This is necessary because during the electrolysis process, the water introduced on the anode side as an inlet can be partially transported through the membrane to the cathode due to diffusion and electro-osmotic drag. Thus, a de-moisturizing system helps maintain optimal operating conditions and prevent unwanted water accumulation in the cathode compartment [8]. Afshari et al. investigated the effect of membrane thickness on cell voltage and hydrogen crossover. They determined that a thicker membrane results in higher voltage losses and lower hydrogen crossover [9]. Additionally, other researchers have discovered that the decreased gas penetration, facilitated by the solid polymeric membrane in PEM electrolyzers, allows the system to be operated at high pressures. This characteristic is beneficial as it opens up the possibility of running the PEM electrolyzer at elevated pressures, which can have advantages in terms of improved overall system efficiency and higher hydrogen production rates [10]. As a result, the complexity of the PEM electrolyzer system is reduced, eliminating the need for additional stages of hydrogen compression, which is often required in other reforming and electrolysis processes. The inherent gas-tight nature of the solid polymeric membrane allows the PEM electrolyzer to directly produce hydrogen at high pressures, streamlining the overall system and making it more efficient compared to alternative methods that involve separate hydrogen compression stages. This advantage contributes to the growing interest and application of PEM electrolysis in various industries seeking efficient and cost-effective hydrogen production methods [11]. Ogumerem et al. have developed a thermal management strategy to address the thermal degradation issue faced by PEM (proton exchange membrane) electrolysis systems at high temperatures. The strategy aims to regulate the system’s operating temperature within an optimal range to minimize the negative effects of heat on the membrane. By implementing cooling mechanisms or heat dissipation techniques, the approach safeguards the PEM electrolysis system, enhances its performance, and extends the membrane’s lifespan. This work contributes to improving the practical applicability of PEM electrolysis technology in various applications [12].

## 2. Procedure

**U**and the output variable layer vector $\mathbf{Y}$. In Figure 1, the input vector

**U**feeds through the time delay block to then go through a weight function matrix ${\mathbf{W}}_{}^{\mathbf{U}}$ and is summed with a bias matrix ${\mathbf{b}}_{}^{\mathbf{U}}$ as the response vector ${\mathbf{n}}_{}^{\mathbf{U}}$ is generated by an activation function g(·), which is a log-sigmoid function in the hidden layer. The neurons in subsequent layers obtain the response from the preceding layer, as illustrated in Figure 1. The response vector ${\mathbf{n}}_{}^{\mathbf{U}}$ then feeds through an output weight function matrix ${\mathbf{W}}_{}^{\mathbf{Y}}$ and is summed with an output bias matrix ${\mathbf{b}}_{}^{\mathbf{Y}}$ as the response vector ${\mathbf{n}}_{}^{\mathbf{Y}}$ is generated by an activation function g(·), which is a linear function in the output layer. Analogously, the number of hidden-layer neurons may vary autonomously. The performance of summation combined with the execution of activation functions to realize the hidden output layer values for a single time step ahead happens because of the structure of the ANN.

**I**, is included to enhance conditioning. Detailed investigations have been conducted to establish suitable values for µ [32]. When values of µ are smaller, Newton’s algorithm is achieved; when values of µ are larger, there is a decline in the gradient.

^{®}function ‘trainscg’ adjusts the weight and bias values of the network [27]. The size of each step is approximated with the assistance of different techniques. Equation (5) shows the term in second order:

## 3. Results and Discussion

^{®}. Four input variables were considered for this study, along with the output variable of hydrogen flow. The developed models utilized >90% of over 1000 datasets for training the model and <10% for testing and validation of the model. The number of hidden layer neurons, the type of learning algorithm, and the inclusion of the time delay structure, shown in Figure 2, were adjusted to obtain different models to find the best-fitting one. Table 2 presents a comparison of the three different algorithms of the ANN time series or dynamic model with time delay using the R

^{2}and the mean squared error. Table 3 shows another comparison of the three different algorithms of the ANN time series or dynamic model without time delay. In both tables, the type of algorithm is shown in Column 1, the count of hidden neurons is presented in Column 2, the R

^{2}results are in Column 3, and the mean squared error values are in Column 4. Figure 3 shows the empirical and model responses of the hydrogen mass flow rate for the ANN models with 1, 10, 20, and 40 hidden neurons and time delay using LMA. Figure 4 captures the experimental and model data of the hydrogen flow rate for the ANN models with varying hidden neurons and time delay using BERA. Figure 5 depicts the experimental and model data of the hydrogen mass flow rate for the ANN models with varying hidden neurons and time delay using SCGA. Figure 6 shows the empirical and model responses of the hydrogen mass flow rate for the ANN models with 1, 10, 20, and 40 hidden neurons and without time delay using LMA. Figure 7 includes plots of empirical and model responses of the hydrogen mass flow rate for the ANN models with varying hidden neurons and without time delay using BERA. Figure 8 shows plots of empirical and model responses of the hydrogen mass flow rate for the ANN models with varying hidden neurons and without time delay using SCGA. In Figure 3, Figure 4, Figure 5, Figure 6, Figure 7 and Figure 8, the y-axis is the hydrogen mass flow rate in kg/h and the x-axis is time in minutes.

^{2}and MSE values, which are show in the blue highlighted rows in Table 2 and Table 3. A model with a lower number of hidden neurons (<5) is likely to have a poor fit compared to other models due to fewer weights and biases. This is illustrated in Table 2 with the example of the ANN model with the time delay structure, SCGA, and one hidden neuron, which obtained a coefficient of determination of 0.7829, much lower than 0.85. An ANN model with a very high number of neurons (>50) can suffer from overfitting, indicated by a low coefficient of determination, as shown by the ANN model without the time delay structure, SCGA, and 50 hidden neurons, which had an R

^{2}of 0.0224. Moreover, models using LMA consistently predict hydrogen flow dynamic behavior more accurately, with a coefficient of determination higher than 0.9 for 10, 20, and 40 hidden neurons, as highlighted in Table 2 and Table 3, compared to the other algorithms for a similar number of hidden neurons. From Table 2 and Table 3, the best-fitting model is the dynamic ANN model using LMA and 40 hidden neurons, which had a coefficient of determination of 0.9013 and a mean squared error of 0.003371, which is less than 1%.

^{2}of active area) was modeled using ANN with a reliable accuracy of <2% with two inputs of electrolyzer electric current and operating temperature in each electrolyzer [14]. Although the results seem to be reliable, the study only considers two input variables, unlike this study, which considers four variables to account for more variation and different operating conditions with less restriction. Moreover, the goal of their study was to explore the hydrogen production rate, yet the focus of the results showed voltage behavior for changes in current, unlike this study, which shows the hydrogen mass flow rate directly. Although there are a few related studies on PEM electrolyzer model development using ANN or similar machine learning methods, the present study does not compare to what is in the literature.

## 4. Conclusions

- The majority of the dynamic ANN models showed responses with relatively high coefficients of determination (greater than 0.8).
- ANN models using any of the three algorithms with the number of hidden neurons ranging from 10 to 40 and inclusion or exclusion of time delay showed a very good fit.
- Dynamic ANN models with 10 to 40 hidden neurons combined with the LMA algorithm had better performance, with most coefficient of determination values being above 0.9.
- With a mean squared error of only 0.00337 and a coefficient of determination of 0.9013, the most suitable ANN model to approximate the hydrogen mass flow rate was the ANN model with the LMA algorithm and 40 neurons. However, the models with 10 and 20 neurons were very close, each with a coefficient of determination of 0.9.

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## Nomenclature

$ANN$ | Artificial neural network |

$PEM$ | Proton exchange membrane |

$w$ | Weight function |

$b$ | Bias |

g(·) | Activation function |

$U$ | Input variable |

$Y$ | Output variable |

${\mathrm{W}}_{}^{\mathrm{U}}$ | Weight function matrix |

${\mathrm{b}}_{}^{\mathrm{U}}$ | Biase function matrix |

${\mathrm{n}}_{}^{\mathrm{U}}$ | Response vector |

${\mathrm{W}}_{}^{\mathrm{Y}}$ | Output weight function matrix |

$MSE$ | Mean squared error |

$COD$ | Coefficient of determination |

$HN$ | Hidden neurons |

$m$ | Data points |

$W$ | Predicted data |

$X$ | Empirical data |

$\overline{X}$ | Averaged data |

${R}^{2}$ | Range between 0 and 1 |

HM | Hessian matrix |

LMA | Levenberg–Marquardt algorithm |

SCGA | Scaled conjugate gradient algorithm |

${\lambda}_{k}$ | Scalar unit |

$\overline{\omega}$ | Vector in space |

$E\overline{\omega}$ | Global error function |

BERA | Bayesian estimation and regularization algorithm |

## References

- Günay, M.E.; Tapan, N.A. Analysis of PEM and AEM electrolysis by neural network pattern recognition, association rule mining and LIME. Energy AI
**2023**, 13, 100254. [Google Scholar] [CrossRef] - Stempien, J.; Sun, Q.; Chan, S. Solid oxide electrolyzer cell modelling: A review. J. Power Technol.
**2013**, 93, 216–246. [Google Scholar] - Ruuskanen, V.; Koponen, J.; Sillanpää, T.; Huoman, K.; Kosonen, A.; Niemelä, M.; Ahola, J. Design and implementation of a power-hardware-in-loop simulator for water electrolysis emulation. Renew. Energy
**2018**, 119, 106–115. [Google Scholar] [CrossRef] - Miller, H.A.; Loos, S.; Bernäcker, C.; Weißgärber, T.; Röntzsch, L.; Meier-Haack, J. Green hydrogen from anion exchange membrane water electrolysis: A review of recent developments in critical materials and operating conditions. Sustain. Energy Fuels
**2020**, 4, 2114–2133. [Google Scholar] [CrossRef] - Grigoriev, S.; Porembskiy, V.; Korobtsev, S.; Fateev, V.; Auprêtre, F.; Millet, P. High pressure PEM water electrolysis and corresponding safety issues. Int. J. Hydrogen Energy
**2011**, 36, 2721–2728. [Google Scholar] [CrossRef] - Deutsches Zentrum für Luft-und Raumfahrt (DLR) (Germany). Water Electrolyzer Technology with Wide Operation Range and Reduced Cost (PRETZEL). Deutsches Zentrum für Luft-und Raumfahrt (DLR) (Germany). 16 November 2021. Available online: https://pretzel-electrolyzer.eu/ (accessed on 20 June 2023).
- Carmo, M.; Fritz, D.; Mergel, J.; Stolten, D. A comprehensive review on PEM water electrolysis. Int. J. Hydrogen Energy
**2013**, 38, 4901–4934. [Google Scholar] [CrossRef] - Bessarabov, D.; Wang, H.; Li, H.; Zhao, N. Electrolysis for Hydrogen Production: Principle and Application; CRC Press: Boca Raton, FL, USA, 2016. [Google Scholar]
- Afshari, E.; Khodabakhsh, S.; Jahantigh, N.; Toghyani, S. Performance assessment of gas crossover phenomenon and water transport mechanism in high pressure PEM electrolyzer. Int. J. Hydrogen Energy
**2021**, 46, 11029–11040. [Google Scholar] [CrossRef] - Schalenbach, M.; Carmo, M.; Fritz, D.; Mergel, J.; Stolten, D. Pressurized PEM water electrolysis: Efficiency and gas crossover. Int. J. Hydrogen Energy
**2013**, 38, 14921–14933. [Google Scholar] [CrossRef] - Scheepers, F.; Stähler, M.; Stähler, A.; Rauls, E.; Müller, M.; Carmo, M.; Lehnert, W. Improving the efficiency of PEM Electrolyzers through Membrane-Specific Pressure Optimization. Energies
**2020**, 13, 612. [Google Scholar] [CrossRef] [Green Version] - Ogumerem, G.; Pistikopoulos, E. Parametric optimization proton exchange and control for a smart proton exchange membrane water electrolysis (PEMWE) system. J. Process Control
**2020**, 91, 37–49. [Google Scholar] [CrossRef] - Becker, S.; Karri, V. Predictive models for PEM-electrolyzer performance using adaptive neuro-fuzzy inference systems. Int. J. Hydrogen Energy
**2010**, 35, 9963–9972. [Google Scholar] [CrossRef] - Chavez-Ramirez, A.U.; Munoz-Guerrero, R.; Ramirez-Arredondo, J.; Ornelas, R.; Arriaga, L.; Siracusano, S.; Brunaccini, G.; Napoli, G.; Antonucci, V. Arico Dynamic Model of a PEM Electrolyzer based on Artificial Neural Networks. J. New Mater. Electrochem. Syst.
**2011**, 14, 113–119. [Google Scholar] [CrossRef] - Abdin, Z.; Webb, C.; Gray, E. Modelling and simulation of a proton exchange membrane (PEM) electrolyser cell. Int. J. Hydrogen Energy
**2015**, 40, 13243–13257. [Google Scholar] [CrossRef] - Biswas, M.; Mwara, K. Model Development of Solid Oxide Fuel Cell Thermal Performance Using Artificial Neural Network. In Proceedings of the 2020 Spring Meeting & 16th Global Congress on Process Safety, Virtual, 17–21 August 2020. [Google Scholar]
- Biswas, M.; Mudiraj, S.; Lear, W.; Crisalle, O. Systematic approach for modeling methanol mass transport on the anode side of direct methanol fuel cells. Int. J. Hydrogen Energy
**2014**, 39, 8009–8025. [Google Scholar] [CrossRef] - Wilberforce, T.; Biswas, M. A study into Proton Exchange Membrane Fuel Cell power and voltage prediction using Artificial Neural Network. Energy Rep.
**2022**, 8, 12843–12852. [Google Scholar] [CrossRef] - Lee, B.; Park, K.; Kim, H. Dynamic simulation of PEM water electrolysis and comparison with experiments. Int. J. Electrochem. Sci.
**2013**, 8, 235–248. [Google Scholar] [CrossRef] - Falcão, D.; Pinto, A. A review on PEM electrolyzer modelling: Guidelines for beginners. J. Clean. Prod.
**2020**, 261, 121184. [Google Scholar] [CrossRef] - Ma, Z.; Witteman, L.; Wrubel, J.; Bender, G. A comprehensive modeling method for proton exchange membrane electrolyzer development. Int. J. Hydrogen Energy
**2021**, 46, 17627–17643. [Google Scholar] [CrossRef] - Hernández-Gómez, Á.; Ramirez, V.; Guilbert, D.; Saldivar, B. Development of an adaptive static-dynamic electrical model based on input electrical energy for PEM water electrolysis. Int. J. Hydrogen Energy
**2020**, 45, 18817–18830. [Google Scholar] [CrossRef] - Hagan, M.; Demuth, H.; Beale, M. Neural Network Design; PWS Publishing: Boston, MA, USA, 1997. [Google Scholar]
- Tafazoli, M.; Baseri, H.; Alizadeh, E.; Shakeri, M. Modeling of direct methanol fuel cell using the artificial neural network. J. Fuel Cell Sci. Technol.
**2013**, 10, 041007. [Google Scholar] [CrossRef] - Mohamed; Ibrahem, H.; Yang, R.; Kim, K. Optimization of Proton Exchange Membrane Electrolyzer Cell Design Using Machine Learning. Energies
**2022**, 15, 6657. [Google Scholar] [CrossRef] - Becker, S.; Karri, V. Implementation of neural network models for parameter estimation of a PEM-electrolyzer. J. Adv. Comput. Intell.
**2010**, 14, 735–740. [Google Scholar] [CrossRef] - The MathWorks Inc. How Dynamic Neural Networks Work. The MathWorks Inc. 28 April 2023. Available online: https://www.mathworks.com/help/deeplearning/ug/how-dynamic-neural-networks-work.html (accessed on 29 June 2023).
- Biswas, M.; Robinson, M.; Fumo, N. Prediction of residential building energy consumption: A neural network approach. Energy
**2016**, 117, 84–92. [Google Scholar] [CrossRef] - Robinson, M.; Manry, M. Two-stage second order training in feedforward neural networks. In Proceedings of the Twenty-Sixth International FLAIRS Conference, St. Pete Beach, FL, USA, 22–24 May 2013. [Google Scholar]
- Crespi, E.; Guandalini, G.; Mastropasqua, L.; Campanari, S.; Brouwer, J. Experimental and theoretical evaluation of a 60 kW PEM electrolysis system for flexible dynamic operation. Energy Convers. Manag.
**2023**, 277, 116622. [Google Scholar] [CrossRef] - Wille, J. On the structure of the Hessian matrix in feedforward networks and second derivative methods. In Proceedings of the International Conference on Neural Networks, Houston, TX, USA, 12 June 1997. [Google Scholar]
- Dennis, J., Jr.; Schnabel, R. Numerical Methods for Unconstrained Optimization and Nonlinear Equations; Society for Industrial and Applied Mathematics: Philadelphia, PA, USA, 1996. [Google Scholar]
- Møller, M.F. A scaled conjugate gradient algorithm for fast supervised learning. Neural Netw.
**1993**, 6, 525–533. [Google Scholar] [CrossRef]

**Figure 3.**Plots of empirical and model responses of the hydrogen mass flow rate predicted by ANN time series with time delay structure and LMA (1, 10, 20, and 40 neurons).

**Figure 4.**Empirical and model data of the hydrogen mass flow rate predicted by ANN time series with time delay structure and BERA with 1, 10, 20, and 40 neurons.

**Figure 5.**Plots of experimental and model responses of the hydrogen mass flow rate predicted by ANN time series with time delay structure and SCGA with 1, 10, 20, and 40 hidden neurons.

**Figure 6.**Plots of experimental and model data of the hydrogen mass flow rate predicted by ANN time series without time delay structure with LMA (1, 10, 20, and 40 neurons).

**Figure 7.**Plots of experimental and model results of the hydrogen mass flow rate predicted by ANN time series without time delay structure and BERA with 1, 10, 20, and 40 hidden neurons.

**Figure 8.**Experimental and model data of the hydrogen mass flow rate predicted by ANN time series without time delay structure with SCGA (1, 10, 20, and 40 neurons).

**Table 1.**Electrolyzer stack variables used in this study [30].

Variable | Range | Units |
---|---|---|

Stack Current (Input) | 80 to 400 | A |

Stack Temperature (Input) | 45 to 60 | °C |

Cathode Pressure (Input) | 28 to 33 | bar (gauge) |

Anode Pressure (Input) | 1 to 2.7 | bar (gauge) |

Hydrogen Mass Flow Rate (Output) | 0 to 1 | kg/h |

Learning Algorithms | HN | COD | MSE |
---|---|---|---|

LMA | 1 | 0.8762 | 0.004183 |

LMA | 5 | 0.8874 | 0.003819 |

LMA | 10 | 0.9000 | 0.003417 |

LMA | 15 | 0.8927 | 0.003661 |

LMA | 20 | 0.9001 | 0.003414 |

LMA | 30 | 0.8970 | 0.003509 |

LMA | 40 | 0.9013 | 0.003371 |

LMA | 50 | 0.8956 | 0.003558 |

SCGA | 1 | 0.7829 | 0.006976 |

SCGA | 5 | 0.8588 | 0.004725 |

SCGA | 10 | 0.8551 | 0.004839 |

SCGA | 15 | 0.8691 | 0.004404 |

SCGA | 20 | 0.8458 | 0.005113 |

SCGA | 30 | 0.7381 | 0.008865 |

SCGA | 40 | 0.8522 | 0.005006 |

SCGA | 50 | 0.0224 | 0.079663 |

BERA | 1 | 0.8763 | 0.004171 |

BERA | 5 | 0.8784 | 0.004105 |

BERA | 10 | 0.8785 | 0.004104 |

BERA | 15 | 0.8854 | 0.003881 |

BERA | 20 | 0.8854 | 0.003884 |

BERA | 30 | 0.8773 | 0.004140 |

BERA | 40 | 0.8773 | 0.004139 |

BERA | 50 | 0.8770 | 0.004150 |

Learning Algorithms | HN | COD | MSE |
---|---|---|---|

LMA | 1 | 0.8762 | 0.004183 |

LMA | 5 | 0.8874 | 0.003819 |

LMA | 10 | 0.9000 | 0.003417 |

LMA | 15 | 0.8927 | 0.003661 |

LMA | 20 | 0.9001 | 0.003414 |

LMA | 30 | 0.8970 | 0.003509 |

LMA | 40 | 0.9013 | 0.003371 |

LMA | 50 | 0.8956 | 0.003558 |

SCGA | 1 | 0.7829 | 0.00698 |

SCGA | 5 | 0.8588 | 0.00473 |

SCGA | 10 | 0.8551 | 0.00484 |

SCGA | 15 | 0.8691 | 0.00440 |

SCGA | 20 | 0.8458 | 0.00511 |

SCGA | 30 | 0.7381 | 0.00886 |

SCGA | 40 | 0.8522 | 0.00501 |

SCGA | 50 | 0.0224 | 0.07966 |

BERA | 1 | 0.8763 | 0.004171 |

BERA | 5 | 0.8784 | 0.004105 |

BERA | 10 | 0.8785 | 0.004104 |

BERA | 15 | 0.8854 | 0.003881 |

BERA | 20 | 0.8854 | 0.003884 |

BERA | 30 | 0.8773 | 0.004140 |

BERA | 40 | 0.8773 | 0.004139 |

BERA | 50 | 0.8770 | 0.004150 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Biswas, M.; Wilberforce, T.; Biswas, M.A.
Prediction of Transient Hydrogen Flow of Proton Exchange Membrane Electrolyzer Using Artificial Neural Network. *Hydrogen* **2023**, *4*, 542-555.
https://doi.org/10.3390/hydrogen4030035

**AMA Style**

Biswas M, Wilberforce T, Biswas MA.
Prediction of Transient Hydrogen Flow of Proton Exchange Membrane Electrolyzer Using Artificial Neural Network. *Hydrogen*. 2023; 4(3):542-555.
https://doi.org/10.3390/hydrogen4030035

**Chicago/Turabian Style**

Biswas, Mohammad, Tabbi Wilberforce, and Mohammad A. Biswas.
2023. "Prediction of Transient Hydrogen Flow of Proton Exchange Membrane Electrolyzer Using Artificial Neural Network" *Hydrogen* 4, no. 3: 542-555.
https://doi.org/10.3390/hydrogen4030035