**1. Introduction**

Proton exchange membrane fuel cells (PEMFC) can contribute to achieving the goal of a sustainable energy supply and production. High efficiency and power density as well as zero emissions are beneficial for both stationary and mobile applications. However, designing the water management, cooling and media supply of a PEMFC-system is challenging. A model-based approach for the simulation of such a system can be a valuable tool in this matter.

Many PEMFC-models have been developed in the past, with varying objectives. Some models intend to deliver highly accurate results through means of computational fluid dynamics (CFD) [1–4] whilst others target a faster simulation by reducing the complexity [5,6]. However, in terms of computational time, these models still operate in the range of min or hours. This makes them unsuitable for large system simulations like complete vehicles or even real-time evaluation. To account for this, simplified fuel cell models have been developed in recent history to reduce the required CPU-time at the expense of accuracy [7–9]. Some of the aforementioned models have been made publicly and freely available, others remain closed-source. Additionally, depending on the chosen programming language as well as structure of model inputs and outputs, the compatibility with various simulation environments might be restricted.

After considering the previous research on fuel cell modeling, the motivation for creating the presented model was to combine the following three aspects. First, the compatibility with commonly used 1D simulations' environments. Since each software has its strengths, weaknesses and price, individual programs might not be available for everyone who would benefit from a fuel cell model. In particular, educational facilities often lack the funds to provide expensive licenses. Offering a model that can be used in multiple environments, and therefore can be utilized by a large audience, was a

primary motivation. Second, there is a low computational demand. Since large systems (e.g., cars or trains completing a drive cycle) consist of many components, each individual model is required to be of reduced complexity in order to keep the overall simulation time low. However, the operating conditions inside of such a dynamic system are constantly shifting. This is why a compromise between speed and accuracy, but with a focus on speed, was another objective. Third, there is an open-source software license. Since open-source models can be further expanded upon and offer value for research, education and development, this represented the third requirement.

The model at hand was designed to be used either as a cell model or as part of a fuel cell stack. In its core, it represents a cell model with internal (optional) scaling for stack parameters like cell area and quantity. In order to ensure compatibility, the MATLAB–Simulink (version used: R2016b by The MathWorks, Inc.) environment was chosen. Furthermore, to allow for fast calculations and even real-time applications, simplified equations are used, even though the underlying Nernst-equation has recently been found to show considerable inaccuracies [10]. Additionally, to further reduce the computational demand, no discrete model was used for the membrane electrode assembly (MEA). A compromise was made between simulation quality regarding water and gas transport and the speed of the calculations.

Possible use cases for the presented model are the creation of polarization curves or the cell performance estimation under varying conditions like in a moving vehicle. Figure 1 depicts the basic structure of the program code, which was designed to be run inside of a MATLAB-function-block as part of a Simulink model. Based on various inputs and physical parameters, the model estimates cell voltage as well as several other outputs in every time step. A complete list of the model inputs, outputs and parameters is provided as Supplementary Material. The calculations inside the code consist of simplified equations, presented in the following section.

**Figure 1.** Model structure and calculation order. Italic functions are implemented as a subfunction.
