Simulation platform for the assessment of PEM electrolyzer models oriented to implement digital Replicas

.


Introduction
In the last decade, hydrogen has taken a leading role in the development of multiple sectors [1].The versatility of this element has led to an evolution in the technologies and applications associated with it, e.g. as a substitute for fossil fuels in the automotive sector [2].The dependence on fossil fuels and the associated carbon emissions are also envisioned to be reduced with the utilization of hydrogen technology [3].
In the energy field, the integration of hydrogen as an energy carrier alongside renewable energies has encouraged the development of hydrogen-based systems together with smart grids and microgrids in recent years [4].Hydrogen is applied to cope with the intermittency of renewable energies, as well as for long-term energy storage [5].In this regard, the role of hydrogen is emphasised as a strategy within the Sustainable Development Goals of the UN.Namely, hydrogen is expected to support the achievement of the Goal 7, i.e. affordable and clean energy [6].
An electrolyzer is an electrochemical device that generates hydrogen by separating the elements of a compound.These devices are grouped according to their principle of operation, highlining alkaline, Polymer Electrolyte Membrane (PEM) and solid types.PEM electrolyzers (PEMEL) are widely used in combination with distilled water to produce high purity hydrogen.Moreover, this electrochemical process does not generate pollutant products, so by using a renewable energy source to power the PEMEL, the hydrogen generated is denoted as green hydrogen.PEMEL are integrated in renewable energy applications because of their high-speed response to changes in operating conditions [7].
Electrolyzer models are required to understand and study their electrochemical behavior as well as to evaluate their performance.In particular, Equivalent Circuit Models (ECM) are used in scientific literature to develop accurate models based on electrical laws and represent the behavior of complex equipment.In the scope of hydrogen generation, ECM are widely studied.Atlam and Kolhe [5] propose an ECM for PEMEL through experimental analysis on a single cell studied under steady-state conditions.The work in Awasthi et al. [8] depicts a MATLAB/Simulink-based model, separating the PEMEL into four parts: anode, cathode, membrane and voltage.For this purpose, the molar balance between cathode and anode is studied together with the Nest and Butler-Volmer equations.The behaviour of a PEMEL in a hybrid system of photovoltaic energy and hydrogen generation is studied in Ismail et al. [9].In this context, the characteristic parameters of the electrolyzer are determined by means of an ECM and Tafel's law.In Guilbert and Vitale [10] and Guilbert et al. [11] models for PEMEL are developed and validated through experimental testing under dynamic operating conditions.The work described in Jansen et al. [12] implements Simulink models of hydrogen fuel cell and electrolyzer according to the Faraday's law in the context of an off-grid combination of PV generation, hydrogen and battery storage.In Virji et al. [13] a PEMEL model is implemented and simulated using MATLAB/Simulink.Models are also required to develop Digital Replicas (DR) of physical equipment.The DR is framed within the Industry 4.0 paradigm and is referred to a virtual simulation that aims to mimic the real-time behaviour of the replicated device [14].This virtual tool provides an ideal environment for testing the operating conditions of the device, isolating it from the rest of the components.DR are commonly modeldriven approaches, i.e. they are based on mathematical models of the physical asset.As asserted in Mohammadshahi et al. [15], a virtualised model is the first step toward the implementation of a DR of the system.
In fact, DR are receiving a lot of attention from Academia and industry.The amount of works related to this paradigm is increasing daily [16,17], even in the form of patents [18].It must be noted that most of publications are devoted to DR in industrial fields [19], whilst in energyrelated systems there is a minor amount of research.Herein, recent works in the energy scenario are commented.DR of wind turbines are reported in Tao et al. [20] and González-González et al. [21].Buildings are digitally mirrored in O'Dwyer et al. [22] from an energy perspective.A DR approach for microgrids is presented in Park et al. [23].The work in Steindl et al. [24] proposes a general framework for DR in industrial energy systems.Applications of DR for energy services are reviewed in Onile et al. [25].Digital replication of batteries under model-driven and data-driven approaches is studied in Wu et al. [26].DR for electric vehicles are also studied in Van Mierlo et al. [27] and Bhatti et al. [28].The use of DR to support decision making processes is presented in Granacher et al. [29] oriented towards energy systems design.However, there is not mention to hydrogen-related frameworks in the aforementioned works.
Therefore, there are very scarce works dealing with DR of PEMEL and fuel cells in literature.The most relevant ones are now briefly commented.Wang et al. [30] present a 3D model-based DR for PEM fuel cells.It uses a mathematical model which couples the heat and mass transport processes and the electrochemical kinetics.Also for PEM fuel cells, in Meraghni et al. [31] a data-driven replica is reported with prognostics purposes.In Ogumerem and Pistikopoulos [32] a DR of a PEMEL is presented using a mathematical model.The goal is to design a Model-based Predictive Controller (MPC) to regulate the thermal behavior of the electrolyzer.A DR of a 750 kW electrolyzer in a power Hardware in the Loop (HiL) scheme is developed in Jain et al. [33].Among the future works in Jansen et al. [12], the authors point out the development of a DR of fuel cell and electrolyzer.
Consequently, there is a need of tools to model and simulate this type of complex device aiming at promoting the development and implementation of DR.
Moreover, when managing models of complex equipment, the models reported in literature are adjusted for specific system and simulated, without enabling customisation or edition.In this regard, such valuable models and simulation environments are closed in the sense that easy interaction with the user and customisation of the model parameters is not provided.This constitutes a drawback when the model must be adjusted to different devices, configurations or situations.
To overcome this limitation, a step beyond modeling consists of building a Graphical User Interface (GUI) to establish a user-friendly and intuitive interaction with the operator of the energy system.Commonly, a GUI is used to display graphical and numerical information of the facility, even with real-time capabilities.The role of GUI for energyrelated applications is highlighted in recent literature [4,[34][35][36].In the case of simulation approaches, the GUI facilitates the adjustment and customisation of parameters as well as the graphical illustration of the simulated results.
This paper presents a simulation platform based on MATLAB/ Simulink for the study of various models of PEMEL.To achieve this purpose, a set of well-known PEMEL models are implemented and simulated in Simulink environment.Furthermore, the App Designer toolbox has been used to develop a GUI to visualise and customise the parameters of the different models and the generated results.Both environments are hosted and interconnected by MATLAB, sharing information during their operation.
Concerning energy-related approaches, MATLAB has been reported as versatile and powerful tool to deploy GUI but there are scarce works in literature about GUI related to PEMEL models.Particularly, MATLABbased GUI for equipment devoted to generation and consumption of hydrogen are even scarcer.Illustrative examples of using MATLAB to implement GUI together with simulation capabilities are now commented.MATLAB GUI is used in Smaoui and Krichen [37] to deploy a simulation interface for a hybrid system combining PV and wind generation with hydrogen (fuel cell and electrolyzer).The user can simulate different time intervals but is not able to modify the implemented models.In Jafari and Malekjamshidi [38] MATLAB is applied to implement a GUI which displays and records data of a prototype of microgrid (PV and fuel cell).However, simulation is not considered in such research.A valuable contribution in the field of hydrogen equipment simulation is found in Vivas et al. [39], where MATLAB is used to make up a simulator for the hybridization of renewable energy sources with hydrogen.This simulator includes the model of an alkaline electrolyzer based on Faraday's law as well as a GUI.
For a clearest overview of previous research about PEMEL models and GUI, Table 1 summarizes the main features of the aforesaid literature and of the present work.Five categories have been considered, namely type of model, used software, implementation of GUI, availability of customisation capabilities and multiplicity of models.
According to the review of previous papers conducted by the authors, as can be checked in Table 1, to date there are no works that simulate and compare different models under a GUI with capabilities of easy interaction and fully customisation of the models.Consequently, the proposal constitutes a novelty in literature.
It must be remarked that the goal of this proposal is not to develop an own model of PEMEL, but to present a tool and methodology to facilitate analyses and comparisons between different models, widely tested and

Table 1
Main features of previous literature.validated in the literature, in order to select the most suitable one to implement DR of experimental equipment.Indeed, the motivation arises from the fact that this work is framed in an on-going R&D project devoted to the digital replication of a hybrid microgrid which combines photovoltaic power and hydrogen for off-grid applications.
The structure of the rest of the paper is as follows.The second section explains the principle of operation of PEMEL and describes the models selected for the development of the simulation platform.Section 3 reflects the design of the simulation platform, focusing on the structure and operation of the GUI through App Designer.Section 4 details the implementation of the platform through a set of simulations on the described models, displaying the functionalities provided by the proposed work.Finally, the most relevant conclusions of the work are depicted.

PEM electrolyzer: Operation and models
This section describes the working principle of the PEMEL as well as the models selected for the design and implementation of the simulation platform.

Working principle
The electrolysis is an electrochemical reaction that allows to split a compound into its fundamental components by means of electricity.Electrolyzers use this working principle for generating hydrogen by splitting various compounds.There are three main types of electrolyzers: PEM, solid oxide and alkaline.Focusing on the PEM type, this device is water-powered and uses a proton exchange membrane and a solid polymeric electrolyte for the electrolysis process.After that process, the results are oxygen and hydrogen gas, as shown in Eq. ( 1): Particularly, when the PEMEL is powered by a renewable energy source, e.g.photovoltaic or wind energy, the resulting hydrogen is called green hydrogen [40].This designation is given by the fact that the whole process does not generate any kind of pollutant product, either in obtaining the input energy from the electrolyzer, or to obtain the hydrogen produced.In terms of structure, all electrolyzers consist of basic units called cells.These cells are responsible for the electrolysis and can be arranged in series, forming a stack, or in parallel.Each cell consists of three parts, the anode, the cathode and the membrane.The diagram in Fig. 1 shows an example of a green hydrogen generator using a PEMEL consisting of 8 cells in series.Fig.2.

Selected PEM electrolyzer models
This section gives a brief description of the PEMEL models available in the literature that have been used for the development of the simulation platform.These models are based on ECM, where each electrical component forming the circuit refers to effects associated with the internal operation of the electrolyzer.The aim of the work is to implement the models selected from the literature in the simulation platform.Therefore, the following subsections illustrate the behaviour of each model through the same expressions described in the works [5,[8][9][10].
The objective of these models is to determine the relationship between the input current I and the voltage measured at the electrolyzer terminals V.The V-I curve resulting from this relationship represents the characteristic curve that defines the operation of the electrolyzer.This curve is particularly illustrative for determining the behaviour of the PEMEL and is therefore used in the models and tests carried out in the literature as a starting point for studying this device [5,[8][9][10].The

Table 2
Experimental values of the electrical components of the model in [10].

Electrical component
Value remaining parameters of the electrolyzer, such as power or efficiency, are derived from this curve.To achieve this objective, each model develops a different methodology, studying the behaviour of the complete electrolyzer or of an individual cell.

Model for a PEM electrolyzer under steady-state conditions
An ECM for PEMEL is developed and validated in the reference [5] and this model is used in the present work to study the behaviour of the PEMEL under steady-state conditions.The equations and derivations below are cited and summarized from Atlam and Kolhe [5].
As can be seen in the figure, the behaviour of the electrolyzer is represented by a reversible voltage e rev in series with a resistance R i .e rev is the voltage of the electrolyzer without considering the losses.This potential groups the ideal electrochemical potential V i , along with the activation over-potential, meanwhile R i represents the over potential during the operation of the electrolyzer.
Vi is defined as the useful volage for the electrolysis process and is obtained from the increase of the Gibbs free energy according to Eq. ( 2). Being: The study of the model is started by analysing the electrolyzer under nominal operating temperature and pressure conditions (T = 20 • C, p = 1 atm).Under these conditions, the cell voltage is determined by the non-linear expression in Eq. ( 4), where e rev = 1.4676V, V i = 1.233V and The hydrogen flow rate generated v H (ml min − 1 ) for the operating point of the electrolyzer/cell is determined from Faraday's law    according to the Eq. ( 5).
The useful electrochemical power of hydrogen P H2 can be derived from V i as indicated in the Eq. ( 6).
The total power consumed P by the cell is defined in Eq. (7).
Finally, the cell efficiency η e is defined by Eq. ( 8) as the ratio of the electrochemical power of hydrogen P H2 to the total power consumed P.
After this analysis under nominal conditions, the performance of the cell is generalised for any operating temperature and pressure range.For this purpose, R i and e rev are modelled as a function of T and p.
V(T, p) = e rev (T, p) − e rev (T, p)e − 5 0.02 I + IR i (T, p) (11) Finally, in Atlam and Kolhe [5] an expression is given to determine the electrolyzer voltage as a function of the distribution of the cells in the electrolyzer, where n s and n p are the number of cells in series or in parallel respectively.

Modelling by varying temperature and pressure
In Awasthi et al. [8] the model of a PEM cell is developed based on its physical structure.Under this approach, the cell model is divided into      13).
As indicated in Eq. ( 13).E is a function of T and p.In this expression, the pressure is decomposed into the various partial pressures of the compounds involved in the electrolysis.In this expression, the E 0 rev term is determined through Eq. ( 14), whose value is dependent on the difference between T and T amb .
The activation overvoltage η act is defined in terms of current density i by the Butler-Volmer equation as given in Eq. (15).
The ohmic overvoltages η ohm are associated with the resistive effects present in the electrolyzer cell and are calculated by Eq. (16).

Model based on
Tafel's law.The model presented in Ismail et al. [9] results from the experimental study of a PEM type cell serving as the load of a photovoltaic powered system.The equations and derivations below are cited and summarized from Ismail et al. [9].In this context, the behaviour of the cell is represented by the diagram in Fig. 3, where the cell voltage is expressed in Eq. ( 17) as a function of four terms: the theoretical voltage V th , the anodic overvoltage V anode , the cathode overvoltage V cathode , and the ohmic voltage drop V ohm .
V cell = V th + V anode + V cathode + V ohm (17) In this case, the relationship between the input current and the cell voltage is determined through Tafel's law, from which Eq. ( 18) is obtained.
The parameters a, b and c are defined according to the characteristics of the electrolyzer cell, such as geometry, materials or working temperature and pressure.These parameters are determined by means of an experimental test carried out at an operating temperature of 80 • C, obtaining the values of a = 1.8018, b = 0.0632 and c = 0.0482.Derived from Eq. ( 18), the voltage of the electrolyzer is obtained as a function of the distribution of its component cells.
Where s and p refer to the number of cells in series and in parallel, respectively.The volume of total hydrogen generated by the electrolyzer is calculated according to the ideal gas law by Eq. (20).
Where N cell is the total number of cells making up the electrolyzer (s × p).
The electrolyzer efficiency is given by the Eq.(21).This model separates the electrolyzer into three parts: anode, cathode and membrane.The electrical elements representing them are associated with local effects of the electrolyzer behaviour.On the one place, the group R 1 C 1 represents the cathode operation.In particular, R 1 simulates the Gibbs free energy and heat losses at the cathode.The V int voltage reproduces the useful power used for hydrogen production.On the second place, the group R 2 C 2 represents the operation of the anode.
In this group, R 2 simulates only the heat losses at the cathode.Between anode and cathode, the R int resistance is located representing the losses in the membrane.
The values of these parameters are determined through a series of laboratory experiments where dynamic operating conditions for the electrolyzer are established.These values are shown in Table 2.
Using the calculated parameters, the expressions defining the behaviour of the electrolyzer are determined.Firstly, the voltage of the electrolyzer is given by the Eq. ( 22).
Where R tot is the sum of the resistances R 1 , R 2 and R int .
The useful power used for the generation of hydrogen P H is calculated by Eq. (23).
The total power consumed or input power P in is determined by Eq. (24).
Finally, the efficiency of the electrolyzer is defined in Eq. ( 25) as the ratio of useful power to input power.

Simulation platform and GUI
This section describes the development of the simulation platform used to study the different PEMEL models.At the same time, a GUI has been designed to facilitate the control of the platform and the visualisation of the results obtained in the simulations.

Operation of the simulation platform
The simulation platform designed in MATLAB is based on the interaction between three different environments: App Designer, Simulink, and Workspace.
On the first place, App Designer is a specific toolbox dedicated to the design of applications and GUI.This plugin has been used to design the GUI aimed to control the simulation platform.On the second place, Simulink is an environment for systems modelling and simulations.The studied models have been replicated using block diagrams to carry out the simulations.Finally, the default MATLAB database, called Workspace, has been used as a bridge to transmit data between Simulink and the GUI, while acting as a temporary database.
Through the GUI, the user takes control over all aspects of the models: setting parameters, running the simulation, displaying results, saving data, and so on.All of this is done through commands that the interface sends to Simulink and MATLAB.The diagram in Fig. 5 depicts the communication between the environments and the exchange of data together with the execution of commands.
The operation of Simulink and the GUI is linked to the exchange of data between these environments.On the one hand, Simulink requires user-set input data to simulate the behaviour of models.On the other hand, the GUI uses the simulation output data to represent the simulation results.
Each of these environments uses a different database.Applications and interfaces created in App Designer define their variables locally in a stand-alone database.In contrast to this toolbox, Simulink can read and store data in any defined database.Due to this discrepancy, it has been decided to use the MATLAB Workspace as a common database for data exchange.This one provides several advantages in the functioning of the application: Simulink uses this database by default, no pre-configuration of the database is necessary, and GUI can export and read variables to the database easily through specific commands.Fig. 6 shows the interaction between the different environments abovementioned and the databases.

App Designer structure
The graphical appearance and functionalities provided by the GUI are conditioned by those used in the App Designer environment.This toolbox provides a series of tools for the development of a GUI through the simultaneous management of two different tabs: Design view and Code view.
Firstly, the Design view tab allows the graphical configuration and customisation of the interface through the use of a component library that facilitates the interaction between the GUI and the operator.Its layout, shown in Fig. 7, consists of the component library, a central area where the GUI appearance is previewed, and a browser where the components used are sorted and their internal characteristics are presented.
The other screen called Code view is intended for programming the actions performed by the interface during its execution, as well as modifying internal properties of the components, such as their display.Regarding its distribution, shown in Fig. 8, it consists of a column where the different events and callbacks used to programme the GUI operation are presented, a central area where the interface actions are programmed by means of codes, and finally, the component browser, maintaining the same qualities as in the Design view tab.
The key to the functioning of the App Designer environment is based on the interaction between these two windows.To begin with, each programmable event in the Code view tab is linked to an element in the Design view tab.In this way, the actions that the GUI can perform depend primarily on the elements placed in the Design view screen.In turn, the Code view tab allows the modification of internal features not accessible from the component browser.The diagram in Fig. 9 indicates the different interactions between the Design view and Code view tabs.

Graphical appearance of the GUI and navigation map
In terms of the graphical aspect presented by the GUI, its operation is based on navigation through tabs.The use of tabs allows the information to be presented to the user in an ordered and grouped manner, facilitating its visualisation and interpretation.The diagram in Fig. 10 presents the navigation map of the developed GUI, where the relations between the different screens are depicted.
The GUI starts with a main menu screen called Electrolyzer model selector, from which to access a set of tabs by means of buttons.The second level of the interface contains specific windows for each studied model that can be accessed via the buttons under the names of each of the models (Atlam, Awasthi, Ismail or Guilbert).Furthermore, the Models comparison button on the main screen provides access to a tab dedicated to the analysis and comparison of the results obtained by simulating the different models.As the last depth layer, within each model tab, there is a plot figures button, which changes the displayed screen to one dedicated to the representation of the operating curves of each model.

Main menu screen
The Electrolyzer model selector tab contains the buttons to access the model screens and the Models comparison tab.Due to the graphical similarity of the model screens, the main menu serves as a starting point to the interface, as well as a transit screen when switching between model tabs.Fig. 11 shows the appearance of this main window.

Model tabs
The model tab constitutes the main core of the GUI.Through this screen, the operator has control over the configuration of the digital model and its simulation.To explain the performance and layout of this tab, the Atlam model [5] has been selected as an example (Fig. 12).
As can be observed in the figure, the elements that make up the tab are distributed in different areas according to their purpose.To begin with, there are three areas dedicated to the configuration of the simulation: Input variables (blue dotted line), Model internal parameters and constants (black dotted line) and Stack configuration (purple dotted line).These areas contain numerical input fields that modify the input variables of the digital model in Simulink.Modifying these input variables results in a variation of its performance in the simulation.Concerning the control of the model, the Model control buttons (red dotted line) contains three sequential buttons and one selector for the execution of the simulation and results representations process.The GUI control buttons area (green dotted line) contains a series of buttons associated with different GUI functionalities and navigation options.In turn, a dynamic text window guides the actions performed by the user during tab operation, indicating whether a specific action is in progress or has been completed.Finally, a graphic space has been reserved in this tab for the representation of the characteristic I-V curve of the electrolyzer.This curve defines the operation of the electrolyzer by showing the voltage variation in response to input current variations.
The flowchart in Fig. 13 shows the sequence of actions to be performed by the operator to archive a successful simulation of the model and representation of its results.The colours used in the flowchart are associated with the different areas explained in Fig. 12.The loop of actions represented in the flowchart illustrates the ability of the GUI to perform consecutive simulations while operating on the model tab.

Plot figures tabs
The Plot figures tabs of the models represent the bottom level of the GUI navigation map.These screens are dedicated to the graphical representation of the results obtained in the simulations through curves.The layout of the elements and the appearance of these tabs are identical for all models implemented in the GUI.Due to this fact, this window can only be accessed through the model tab to which it is associated, to avoid confusing the user during the execution of simulations.Fig. 14 shows the appearance of the Plot figures tab.The axes associated with each of the graphic spaces indicate the represented variable and its corresponding unit.In turn, due to the adjusted size of the graphic spaces, the axes are auto-scaled according to the range represented to cover the entire curve.
Almost the entire window is occupied by four charts, intended to represent the characteristic curves of the electrolyzer.At the bottom, the Atlam model button allows navigation between the model tab and this one.Below is the button calls Legend ON/OFF that enables and disables the display of the legends in each of the graphs, facilitating the display of curves when running multiple simulations.

Models comparison tab
The last window of the interface is the Models comparison tab.This  screen is accessible via the main screen.Its purpose is to provide the user with a graphical space to compare the curves resulting from the various simulations of the digital models.This helps the operator to carry out the study of the electrolyzer and its models.
Regarding the elements that make it up, the window is almost entirely occupied by a single graphic.In contrast to the Plot figures tabs, this screen seeks to analyse a single curve from different models, thus focusing attention on the differences between the curves represented.The compared models are selected by means of the check boxes in the Model selector area.In turn, the curve represented in the graphic space is selected by means of a drop-down selector in the area Curve selector.The remaining elements of the tab perform similar functions to their counterparts in the other tabs seen above.Fig. 15 shows the appearance of the Models comparison tab and its elements.

Features and functionalities of the GUI
As seen in the GUI design section, the tabs that constitute the interface are made up of elements with distinct functions.LED indicators or numeric fields, serve as visual indicators or data input fields for the user, respectively.In contrast, buttons are complex components that allow the execution of actions previously programmed in the interface code.Each button is identified by its name, which makes it possible to differentiate it from the rest and to indicate its function to the user.Depending on their specific function, each button can be categorised into Navigation buttons, Data management buttons, Simulation control buttons or Visualisation buttons.Table 3 summarizes the buttons abovementioned according to a classification by category and action performed.

Results and discussion
This section illustrates the operation of the simulation platform designed.For this purpose, a representative simulation case is run on one of the models presented previously and the results obtained are represented on the GUI.

Simulation case
For the simulation case, the Atlam model [5] is selected as an example of electrolyzer performance.As indicated above, the behaviour of these models is replicated by means of block diagrams in the Simulink environment.Fig. 16 depicts a part of the block diagram of the Atlam model, where the different parameters used in it can be observed.
During this study, the values associated with the internal parameters of the model have been kept constant in order not to alter the model described.On the other hand, the stack configuration, input variables, temperature and working pressure conditions have been modified in order to test the model operation.The set of parameters and values used in this simulation are shown in Table 4.
As shown in Table 4, the simulated electrolyzer consists of a stack of 3 cells in series.Through this configuration, it is possible to compare the performance between the stack and a single cell.

Simulation results
After determining the conditions of the simulation case, the GUI is Fig. 17 shows the model tab together with two different coloured I-V curves.For this particular curve, blue represents the nominal conditions used in Atlam and Kolhe [5] and red indicates the simulated conditions in this case.
The I-V curve has a non-linear shape with two distinct zones.This form is homologous to those described in the literature models [8][9][10].At low current ranges (from 0 to 0.05 A), the curve resembles a step ramp, which represents the threshold voltage that the cell must overcome to start electrolysis.In later current ranges (higher than 0.05 A), the curve takes the form of a straight line whose slope is modified by variations in temperature and working pressure.In the case of the curves shown in the figure, for a current of 0.5 A, v cell (20 • C) = 1.639V while v cell (60 • C) = 1.563V, where a downward trend of the slope is observed with increasing temperature.Fig. 18 shows the appearance of the Plot figures tab after the simulation, where the rest of the curves are displayed.In this window, a comparison is made between the behaviour of the electrolyzer and that of a single cell.In this way, the effects of modifying the parameters of the stack configuration on the operation of the PEMEL can be observed.For this purpose, the cell curves are graphed in blue and the electrolyzer curves in red, all of them under the conditions of the simulation case.
The I-v H curve shows an increase in hydrogen generation due to an increment in the number of cells that compound the stack.For the case of I = 0.6 A, v H _ cell = 5 ml/min while v H _ el = 15 ml/min, tripling hydrogen production due to the number of cells in the stack.Comparison of the I-V el and I-V cell curves reflects a higher total electrolyzer voltage as a result of the increased number of cells in series, as defined by the model in Eq. ( 12).Taking as an example the value of I = 0.6 A, the value of V cell = 1.563V while V el = 4.689 V, thus affirming the relationship between electrolyzer voltage and cell number.This voltage increase translates into an increase in the total power consumed, as seen in the Pv H and P-η curves.
Section 3 highlights the ability of the GUI to perform successive simulations on the same model, being able to represent all the results obtained in the graphs.To demonstrate this feature, an additional simulation case has been run on the model by modifying the temperature and pressure conditions to T = 20 • C and p = 4 atm.The results obtained from this simulation are presented together with the previous simulation in Fig. 19 and Fig. 20.
The I-V cell curve resulting from this new simulation allows to determine an upward trend of the cell voltage with increasing working pressure, as can be seen from the voltage values for 20 shows the rest of the electrolyzer and cell curves for each of the simulations, together with a common legend for each graphical chart.The effects associated with the increase in working pressure are visualised in these graphs, where the I-v H and P-v H curves describe a reduction in hydrogen generation and an increase in power consumption respectively.Due to this, the P-η curve shows a worsening of the efficiency of the electrolyzer, according to the values given for the cell efficiency at I = 1 A: η cell (20 • C, 1 atm) = 0.685, η cell (60 • C, 1 atm) = 0.727 and η cell (20 • C, 4 atm) = 0.664.

Comparison of models
Through the Models comparison tab, the user is able to perform a combined representation of the last cases simulated in each model in order to compare the curves obtained.To show the applicability of this window, an identical simulation case is carried out for all the models described, configuring a stack formed by 3 cells in series working under Fig.21 depicts the I-V curves of a single cell and the stack of each of the models.From this information it is determined that the behaviour of the Atlam, Awasthi and Guilbert models are similar, with minor differences in voltage.On the contrary, the Ismail model presents a higher voltage value than the rest.To put this statement into context, the cell voltage values of the models at I = 1 A are presented: The Atlam and Awasthi model curves have an identical step-like shape, with the voltage difference increasing as cells are added in series to the stack.This discrepancy between the models is due to the fact that Awasthi considers the ambient temperature as well as the anode and cathode partial pressures in determining the electrolyzer voltage.In contrast, the Guilbert model gives a curve with a linear shape, due to Eq. ( 22).This approach is indicated in Atlam and Kolhe [5] as a viable solution for the study of electrolyzer operation.The curve obtained from the Guilbert model gives similar values to the Atlam and Awasthi model without taking into account the factors of temperature or working pressure.
Fig. 22 shows the model P-v H curves comparing the single cell and stack values.This figure shows the effects of the voltages observed in Fig. 21 and the differences between the models.Thus, the Ismail model stands out in power consumption due to the high voltage value determined by Eq. ( 19).The rest of the models present similar curves with very approximate values.In turn, the figure highlights the relationship between hydrogen production and the number of cells in the electrolyzer, where a significant increase in the generated flow rate is observed before due to the increase in the cells in series of the stack.This behaviour is identical in all the models, with discrepancies in the power consumed in each of them due to the differences in the calculated voltages.
Fig. 23 shows a comparison of the efficiency of the electrolyzer versus its power consumption.To determine the efficiency, the models relate the values of the ideal voltage used for electrolysis and the electrolyzer voltage.For the Guilbert case, the value of V int is considered as a constant unrelated to variations in temperature or pressure.Comparing the cell efficiency values for the models at I = 1 A, it can be seen that the Guilbert model has the highest value: η cell_Atlam = 0.752, η cell_Awasthi = 0.766, η cell_Guilbert = 0.909 and η cell_Ismail = 0.665.The Atlam and Awasthi models present close efficiency values through they both study the effects associated with the ideal voltage due to variations in the working temperature and pressure.In particular, Awasthi includes the ambient temperature parameter in its model, which affects the ideal voltage and differentiates it from the Atlam model.
The simulated values in Ismail's model are the smallest of all those represented in the graph.Ismail's model takes a constant ideal voltage value (V i_Ismail = 1.23 V), as in the Guilbert model, but its cell voltage value is much higher than in the other models (V cell_Ismail = 1.85 V), as shown in Fig. 21.

Discussion
The previous section highlights the potential of the platform to undertake the analysis of PEMEL models, either locally through the specific tabs for each model, or through a comparison of different simulation cases.In the latter case, it is illustrated a common behaviour of the PEMEL, differing numerically between them due to the expressions taken into consideration to define the model parameters.These differences are key to determine which model is closer to the behaviour of an experimental PEMEL.For this purpose, the platform facilitates the  The simulation platform designed is an innovative tool for the simulation and analysis of multiple PEMEL models, facilitating the study of these devices through an intuitive and user-friendly GUI.This interface gives the user full access to each model to modify and experiment with it, allowing the user to visualise the effects associated with these changes.This customisation implies a novelty compared to the literature, which present pre-set and closed models and the user is only allowed to enter input variables, thus limiting the ability to analyse and understand the results represented.At the same time, the functions presented in the GUI can be easily modified or extended thanks to the App Designer toolbox, whose programming nature allows further modifications to the GUI.Furthermore, the interconnected environment-based structure of the simulation platform allows the catalogue of models available for the interface to be extended, and may include not only PEM, but also alkaline and solid models, acquiring a more generalist character.To do so, it is only necessary to include the new model in Simulink and create a new tab in the GUI according to the new model.In this way, the application acquires the capacity to evolve and improve according to the user's needs.
In a similar sense, an interesting aspect to consider is the interaction between water transport and PEMEL operation.In this context, some  models study internal water flow as a key factor in the PEMEL performance, resulting in effects associated with degradation mechanisms and influence in internal model parameters, such as ohmic losses.The implementation of this type of models in the presented simulation platform is possible thanks to its versatility and ease of use, enriching the catalogue of available models and the results of the obtained comparisons.
As indicated in the introduction, the described platform has been conceived with the aim of studying the behaviour of PEMEL in order to develop a DR of a physical device.Beyond this, the characteristics of the described platform highlight its versatility.As a result, this tool can be used for various purposes such as the study and analysis of the behaviour of PEMEL in the field of research, with the aim of characterising physical devices.In the academic field, the application provides a virtual environment to teach about the operation of PEMEL in a visual and interactive way.

Conclusions
This work has presented the design, operation and implementation of a simulation platform based on MATLAB/Simulink for the study of PEMEL models.The application is intended to facilitate the study and analysis the behaviour of this device with the aim of developing a DR of an experimental PEMEL framed in a smart microgrid.The information provided by the simulation platform allows the identification of the most suitable model for the behaviour of the experimental electrolyzer.
A GUI has been developed using the App Designer toolbox for the control of the platform, as well as for the representation of the curves resulting from the simulations and the comparison between the models.The interaction of these three environments constitutes the working principle of the simulation platform.The proposal allows fully customisation of the model parameters and working conditions through the GUI, which constitutes a novelty in literature.
Regarding the GUI, the handling of App Designer has been described, as well as the structure and performance of the interface, highlighting the functionalities of each of the elements that compose it.
The models implemented in the platform have been described and compared by means of a series of simulations executed through the GUI, where the differences between the models can be appreciated due to the expressions used in each one of them.Future work will use the data collected from the simulations performed through the platform to develop a DR of an experimental PEMEL.To this end, the models hosted on the platform will be used as a starting point to develop the replica model that matches the operation of the physical device.Another future guideline will deal with the study of models focussed on the water transport influence in PEMEL operation, and their implementation in the simulation platform.

Fig. 5 .
Fig. 5. Relationship between environments involved with the simulation platform.

Fig. 9 .
Fig. 9. Synergy between the tabs of the App Designer environment.

F
.J. Folgado et al. four components: anode, cathode, membrane and voltage.The equations and derivations below are cited and summarized from Awasthi et al. [8].Based on the abovementioned structure, the model describes the operation of the cell considering variations in operating temperature T and pressure p, as well as variations in ambient temperature T amb .In this case, the relationship between the input current and the cell voltage is determined by a set of over voltages and the open circuit voltage E. This open circuit voltage is calculated by the Nernst equation expressed in Eq. (

F
.J. Folgado et al.2.2.2.2.Dynamic emulation of a PEM electrolyzer.The model developed in Guilbert and Vitale[10] defines an ECM whose components are determined by the dynamic study of a stack consisting of three cells in series.This electrical model is shown in the Fig.4.The equations and derivations below are cited and summarized from Guilbert and Vitale[10].

Fig. 16 . 4 F
Fig. 16.Part of the Simulink block diagram of the Atlam model.

Table 3
GUI buttons and actions.