# Modelica-Based Energy Management of PEMFC Hybrid Power System of Vehicle
## 2 Mathematic Model of Hybrid Power System
### PEMFC Model
#### 2.1.2 Stack Temperature  
The electrochemical reaction of a fuel cell is temperature-dependent, and the operating temperature directly affects its output power, efficiency, and service life. Both excessively high and low temperatures can lead to a decline in the performance of the cell [29]. For instance, high temperatures may cause catalyst deactivation, material aging, and internal moisture management issues, which in turn affect the long-term stability of the fuel cell. On the other hand, low temperatures can make it difficult to start the fuel cell and reduce its efficiency. Therefore, precisely controlling the fuel cell's temperature helps maintain it within the optimal operating range, thereby improving the overall system's efficiency and power output. The temperature model of the PEMFC system primarily describes the dynamic process of temperature variation in the fuel cell stack, the stack cathode, the anode, and the cooling channels. In this study, a cooling system using water circulation is employed to dissipate the heat from the fuel cell stack efficiently and uniformly. This approach effectively prevents localized overheating or overcooling of the stack, allowing for better regulation of the operating temperature of the fuel cell stack [30]. The model constructed in this section includes the heat generated by electrochemical reactions, the heat carried by excess gases, the heat carried by the cooling water, and the net output power. According to the law of energy conservation, the main energy transfer processes are described. The contributions of the kinetic and potential energy of the mass flow are relatively small compared to other energy transfers and can be neglected. The thermodynamic differential equation for the temperature of the fuel cell stack is given by Equation (10) [31]:  
\[ \begin{array}{c}m_{FC}C_{p,FC}\frac{dT_{FC}}{dt}=m_{FC}C_{p,FC}\dot{T}_{FC}\\ =Q_{Gen}-Q_{H2O}^{exp}-\Delta Q_{air}^{excess}-Q_{cooling}-Q_{amb}-P_{FC}\end{array}  \tag{10}\]  
where \(m_{FC}\) is the mass of stack in kilograms, \(C_{p,FC}\) is the average specific heat capacity, \(Q_{Gen}\) stands for heat generated by the stack, \(T_{FC}\) is stack temperature, \(\dot{T}_{FC}\) is the temperature dynamic change, \(Q_{H2O}^{exp}\) refers to the heat flow rate generated by the reaction in the current fuel cell stack that produces water vapor, \(\Delta Q_{air}^{excess}\) is the heat flow rate of the excess air that did not participate in the reaction, \(Q_{cooling}\) and \(Q_{amb}\) is the heat flow rate between the stack and cooling water and ambient air respectively, and \(P_{FC}\) is the electric output power of the stack. The reaction of PEMFC is a complex exothermic chemical reaction process. The heat flow rate of this reaction can be calculated from the mass flow rate of the consumed hydrogen and the reaction energy of the products using Equation (11):  
\[Q_{Gen}=m_{H_{2},react}\Delta H_{react} \tag{11}\]  
where \(m_{H_{2},react}\) is the hydrogen mass flow of reaction consumption calculated by Equation (12), and \(\Delta H_{react}\) is the reaction enthalpy change. \[m_{H_{2},react}=\frac{N_{cell}I_{FC}M_{H_{2}}}{2F} \tag{12}\]  
In order to further refine the energy transfer of electrochemistry in the reaction process, the generated water is assumed to be in liquid form.