You are on page 1of 5

World Congress on Software Engineering

Interface Design and Software Development for PEM Fuel Cell Modeling
based on Matlab/Simulink Environment

Yancheng Xiao Kodjo Agbossou


School of Computer Science and Technology Department of Electrical and Computer Engineering
Huazhong University of Science and Technology University of Quebec at Trois-Rivieres
Wuhan, China Trois-Rivieres, Canada
e-mail: yancheng.xiao@hotmail.com e-mail: kodjo.agbossou@uqtr.ca

Abstract—This paper is dealing with the interface design and The voltage overshoots/undershoots are not easy to
software development for proton exchange membrane (PEM) simulated by using a electrochemical model[6] but can be
fuel cell modeling based on Matlab/Simulink environment. modeled by combining a computational fluid dynamics
Three models used in the software, steady-state mode, (CFD) model[7]. This paper have the voltage overshoots/
dynamic model and thermodynamic model, are described
undershoots appearing in the results, which is come from the
first. These models are then implemented through the graphic
user interface (GUI) programming by Simulink, and the combination of the well known electrical dynamic model
simulation results are visualized. There are voltage overshoots/ and the new developed thermodynamic model.
undershoots appearing in the results, which is come from the
combination of electrical dynamic model and thermodynamic II. MODELS OF PEM FUEL CELL
model. For the interface design and software development, a
GUI file(*.fig) is designed in Matlab interactively, a main A. Steady-State Model
program (*.m) is coded using Matlab language, and a The cell voltage of a PEM fuel cell can be represented
Simulink model (*.mdl) is designed based on the fuel cell by a polarization curve, which can be obtained from the
model in the work. The Matlab main program calls Matlab
open circuit voltage E by substituting some polarization
GUI file and Simulink diagram to complete the fuel cell
simulation. The software are applied to PEM fuel cell and losses, such as activation loss Vact , ohmic loss Vohm and
solid oxide fuel cell (SOFC) successfully.
concentration loss Vcon , so we have
Keywords—software development; interface design; fuel cell; V = E − Vact − Vohm − Vcon , (1)
modeling; Matlab; Simulink
where Vact , Vohm and Vcon are in the form of voltage drop
I. INTRODUCTION (better for representing losses). We can also write the cell
The proton exchange membrane (PEM) fuel cell is voltage equation (1) as
widely researched recently for solving the problem of V = E + η act + ηohm + η con , (2)
energy and environment[1]. Three models used in the
software, steady-state mode[2], dynamic model[3] and where η act , η ohm and η con are in the form of voltage gain,
especially thermodynamic model, are fundamental and so we have
important for the simulation. η act = −Vact , ηohm = −Vohm , ηcon = −Vcon . (3)
These models are implemented by Simulink, and the
The open circuit voltage in Equation (2) can be
simulation results are visualized. The activation loss, ohmic
expressed by Nernst potential:
loss and concentration loss can be clearly seen in
polarization curves. Further there are maximum power E = 1.229 − 8.5 × 10 −4 (T − 298.15) + 4.308
points appearing in the P-I curves, which is useful for
maximum power point tracking control of fuel cell[4].
(
× 10−5 T ln pH 2 + 0.5 ln pO2 ) ,

Although Simulink itself is a graphic user interface and the polarization losses are
(GUI) programming environment[5], we need make GUI for η act = −0.9514 + 3.12 ×10 −3 T − 1.87 ×10−4 T ln i
packing Simulink model to let the user more easy to use the ,
software. The Matlab main program calls Matlab GUI file + 7.4 × 10 −5 T ln CO2
and Simulink diagram to complete the fuel cell simulation. ηohm = −iRint and ηcon = B ln (1 − i / ilim ) .
The software are applied to PEM fuel cell and also solid
oxide fuel cell (SOFC) successfully. where T is cell temperature, i is current, ilim is limit
current, and B = 0.016 .

978-0-7695-3570-8/09 $25.00 © 2009 IEEE 318


DOI 10.1109/WCSE.2009.344
The partial pressures of hydrogen and oxygen are III. SIMULINK MODEL AND SIMULATION RESULTS
⎡ ⎛ 1.635i / A ⎞ pa ⎤ A. Simulink Diagram
pH 2 = 0.5 pHsat2O ⎢exp⎜ − 1.334 ⎟ sat − 1⎥ ,
⎢⎣ ⎝ T ⎠ pH 2O ⎥⎦ There are a main simulation system and some
subsystems in the model. Decomposing the simulation into
⎡ ⎛ 4.192i / A ⎞ pc ⎤ different parts made the algorithm and the diagram more
pO2 = pHsat2O ⎢exp⎜ − ⎟ − 1⎥. clear and easier to find out and solve the bugs. Main
⎣⎢ ⎝ T 1.334 ⎠ pHsat2O ⎦⎥ simulation system and some subsystems are shown in Fig.1
The concentration of oxygen can be calculated by to Fig.3.
pO2 ⎛ 498 ⎞
CO2 = exp⎜ 6 ⎟. PEM Fuel Cell Modeling

5.08 × 10 ⎝ T ⎠
i

i VI Graph
Current Vohm

sat
The saturation pressure of water pH 2O can be obtained from
T
Vohm

Ohmic Loss
Ra PI Graph

sat −2
log10 p H 2O = −2.18 + 2.95 × 10 TC i Vcon

,
Vcon
T Pstack Power

−5 2 −7 3
− 9.18 × 10 TC + 1.44 × 10 TC Vact0
Concentration Loss

24
Ra

TC = T − 273.15 . The internal resistance is


Vstack Voltage

where i T0
T

i Vact0
Ra

Vact
Vcell
PO2 i

Rint = 1.605 × 10 −2 − 3.5 × 10 −5 T + 8 × 10 −5 i . Steady State


Temperature
Steady State
Activation Loss
Dynamic
Activation Loss
Vact Vcell
Current

B. Dynamic Model T0
i PH2
T Temperature

PH2 E

For the dynamic model of PEM fuel cell, the transient i

E-V
T T PO2 PO2

Nernst Potential
E Total Loss
Pressure H2
Partial Pressure

activation loss Vact will be the solutions of the following Dynamic


Temperature
Pressure O2

differential equation:
Figure 1. Main simulation system
dVact i Vact
= − , (4)
dt C RaC 3

C is the charge double layer capacitance, Ra is the


i
where Division 1
Vact
1
1 Subtract s
xo
equivalent resistance:
Vact
C

V +V
1 Integrator
2
Ra
Ra = act 0 con , Product V0

i
Figure 2. Dynamic model subsystem
and Vact 0 = −η act is the steady-state activation loss and is
used as the initial condition of the differential equation. 2

Equation (4) is solved by using a Matlab/Simulink i 24


1/10 T
Heat Ncell 1

integrator.
3 Subtract s
E-V 1/(mC)
xo

30+273.15 1
C. Thermodynamic Model 10 1 Integrator
T0 T
Tf
T-Tf hA

For the thermodynamic model of PEM fuel cell, the


transient temperature T will be the solutions of the Figure 3. Thermodynamic model subsystem
following differential equation:
dT B. Steady-State Simulation Results
Ct = i (E − Vcell ) − H (T − T f ) (5) Parameters used in the simulation are: Number of cells:
dt
24; Anode partial pressure: 2.0 atm; Cathode partial
where Ct is total thermal capacitance for all the volume or pressure: 1.0 atm; Temperature: 80 ℃; Limit current: 25.1A;
mass of fuel cell, J/K, and H is total heat transfer Capacitance: 1F.
coefficient for all the surface of fuel cell, W/K, T f is The ramp current is a current form 0A to 25A with a
slop of 5, the steady-state voltage and power of fuel cell are
reference temperature of environment, K, T is lumped shown in Fig.4 and Fig.5.
temperature of fuel cell, K. The initial temperature T0 for The activation loss, ohmic loss and concentration loss
the differential equation can be obtained from the steady- can be clearly seen in polarization curves. And there are
state thermal model. The differential equation (5) is also maximum power points appearing in the P-I curves.
solved by using a Matlab/Simulink integrator.

319
Figure 4. Steady-state voltage of fuel cell Figure 6. Dynamic temperature of fuel cell

Figure 5. Steady-state power of fuel cell Figure 7. Dynamic voltage of fuel cell

C. Dynamic Simulation Results B. Graphic User Interface (GUI) Design


The dynamic temperature and dynamic voltage of fuel The graphic user interface (GUI) for above fuel cell
cell are shown in Fig.6 and Fig.7. There are voltage model is designed by means of Matlab GUI Application
overshoots/ undershoots appearing in the results, which is function. The interface for input parameters and output
come from the combination of electrical dynamic model graphics is show as Fig.8. This GUI uses only the Plot
and thermodynamic model. button callback. When a user clicks the Plot button, the
callback performs three basic tasks: it gets user input from
IV. GUI DESIGN BASED ON MATLAB ENVIRONMENT the edit text components, calculates data, and creates the
graphic plot.
A. Simple Fuel Cell Model
To illustrate the graphic user interface design, a simple V. MATLAB GUI FOR SETTING SIMULINK PARAMETERS
fuel cell model for simulating the cell voltage of a PEM fuel
A. Connection of Matlab GUI with Simulink Diagram
cell or solid oxide fuel cell (SOFC) can be represented by a
polarization curve, which can be obtained from the open For illustration, the above simple fuel cell model
circuit voltage E by substituting some polarization losses, expressed with equation (6) is implemented by Simulink
such as activation loss, ohmic loss and concentration loss, diagram. The parameters for above Simulink diagram will
i.e.[1] come form the edit texts of graphic user interface (GUI) in
Fig.8. Users of the software can directly input the
⎛ i + in ⎞ ⎛ i + in ⎞ parameters though the GUI, the software will transfer them
V = E − (i + in )r − A ln⎜⎜ ⎟⎟ + B ln⎜⎜1 − ⎟ .(6)
⎝ i0 ⎠ ⎝ il ⎟⎠ into Simulink.

320
Figure 8. GUI for a simple fuel cell model

Figure 10. Application of GUI to SOFC


B. Application of GUI for PEM Fuel Cell and SOFC
Now we have designed a GUI file(*.fig) in Matlab
interactively, a main program (*.m) using Matlab language, VI. CONCLUSIONS
and a Simulink model (*.mdl) based on the fuel cell model. (1) Three models used in the simulation software,
Run the Matlab file (*.m), the GUI of the software will steady-state mode, dynamic model and thermodynamic
be pop up. The parameters for PEM fuel cell have been model, are described first. These models are then
already set in the GUI. Press button “Plot” in the GUI, the implemented by Simulink, and the simulation results are
Matlab interface will call Simulink model with the visualized.
parameters transferring and the software begins to simulate. (2) A GUI file(*.fig) is designed in Matlab
The parameters in edit texts of the Matlab GUI has been interactively, a main program (*.m) is coded using Matlab
passed to Simulink model successfully. The results for PEM language, and a Simulink model (*.mdl) is designed based
fuel cell is shown as Fig.9. on the fuel cell model in the work.
For SOFC, the parameters need to change by inputting (3) The Matlab main program calls Matlab GUI file and
to the edit texts in GUI. Then, press the Plot button, the Simulink diagram to complete the fuel cell simulation. The
voltage-current graphics of SOFC comes out. The software are applied to PEM fuel cell and SOFC
parameters for SOFC modeling have been changed from successfully.
PEM fuel cell in above GUI, and passed to Simulink model (4) The activation loss, ohmic loss and concentration
automatically, as shown in Fig.10. loss can be clearly seen in polarization curves. Further there
are maximum power points appearing in the P-I curves,
which is useful for maximum power point tracking control
of fuel cell.
(5) The results of dynamic simulation show that the
activation loss is highly relative with the charge double
layer capacitance. There are voltage overshoots/
undershoots appearing in the results, which is come from
the combination of electrical dynamic model and
thermodynamic model.
REFERENCE
[1] J. Larminie, A. Dicks. Fuel Cell System Explained. JOGN WILEY
&SONS, LTD, Chichester, 2000
[2] R. F. Mann, J. C. Amphlett, M. A. I. Hooper, H. M. Jensen, B. A.
Peppley, P. R. Roberge. Development and application of a generalised
steady-state electrochemical model for a PEM fuel cell. Journal of
Power Sources 2000, 86 (1-2), 173-180.
[3] P. R. Pathapati, X. Xue, J. Tang. A new dynamic model for predicting
transient phenomena in a PEM fuel cell system. Renewable Energy
Figure 9. Application of GUI to PEM Fuel Cell 2004, 30 (1), 1-22.

321
[4] Z. D. Zhong, H. B Huo, X. J. Zhu, G. Y. Cao, R. Yuan. Adaptive [6] J. M. Correa, F. A. Farret, L. N. Canha, M. G. Simoes. An
maximum power point tracking control of fuel cell power plants. electrochemical-based fuel-cell model suitable for electrical
Journal of Power Sources 2008, 176 (1), 259-269. engineering automation approach. IEEE Transactions on Industrial
[5] S. Doolla, S. S. Bhat, T. S. Bfiatti, M. Veerachary. A GUI based Electronics 2004, 51 (5), 1103-1112.
simulation of power electronic converters and reactive power [7] K. P. Adzakpa, K. Agbossou, Y. Dube, M. Dostie, M. Fournier, A.
compensators using MATLAB/SIMULINK. IEEE 2004 International Poulin. PEM fuel cells modeling and analysis through current and
Conference on Power System Technology, Singapore, 21-24 voltage transient behaviors. IEEE Transactions on Energy Conversion
November 2004. 2008, 23 (2): 581-591.

322

You might also like