## 3 Model Development
### Control Model  
The control model for the thermal management system proposed in this work includes two control parameters: coolant inlet/outlet temperature difference and coolant inlet temperature. This is because fuel cell system temperature control involves two aspects. One is that the radiator must provide sufficient power to timeously dissipate the heat absorbed by the coolant flowing through the stack. This prevents the heat from accumulating inside the stack, leading to high stack temperature and irreversible impact on the stack service life. The other aspect is that by precisely adjusting the coolant flow with the water pump, the coolant inlet/outlet temperature difference is controlled within a specific range, avoiding localized overheating or local condensation. It should be noted that the two aspects are correlated, thus prolonging the adjustment time of the thermal management system and causing temporary high stack temperatures, which is not conducive to its long-term operation. To effectively control the two parameters, the coolant inlet/outlet temperature difference and coolant inlet temperature were first decoupled. The temperature difference is mainly related to the stack-generated heat and the coolant flow rate \(W_{cl}\), while the stack-generated heat primarily depends on the current \(I\). Thus the temperature difference can be expressed as  
\[\Delta T_{st}=f(I,W_{cl}) \tag{33}\]  
Using the dynamic mechanistic model developed above, we carried out simulations to obtain the mapping for setting the coolant flow rates according to the currents, as shown in Figure 4a. Table 4 presents the simulation parameters. Then, we performed feedforward control on the coolant inlet/outlet temperature difference, achieving decoupling from the coolant inlet temperature. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameter** & **Symbol** & **Step** & **Interval** \\ \hline Load current & \(I\) & 20 A & 0–550 A \\ Coolant flow rate & \(W_{cl}\) & 10 L/Min & 80–130 SLPM \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Simulation parameters for coolant inlet/outlet temperature difference control. The traditional proportional integral derivative (PID) control algorithm is often used to control coolant inlet temperature. However, the optimal PID parameters are not always available when the system is under different load currents and preset stack temperatures [43]. When the operating parameters are changed, the optimal values vary, and the control effect will be affected. To solve this issue, a control model combining the dynamic mechanistic model, PSO algorithm, and ANN model is developed in this paper to improve the coolant inlet temperature control. Figure 4b shows the particle swarm optimization algorithm used in the control model. The PSO algorithm can find the optimal solution in an initial random particle group through several iterations. During the iterations, the particles update their current solutions by comparing the fitness value \(f\), finally obtaining the optimal solution. The fitness value \(f\) is based on the control effect (regulating time \(t_{s}\), overshoots \(\sigma\), and steady-state error \(err\)). The smaller the value of the fitness function, the better the control effect. \[f=\text{log}(t_{s}+1)+\text{log}(\frac{2\cdot\sigma}{10^{-3}}+1)+\text{log}( \frac{err}{10^{-2}}+1) \tag{34}\]  
In total, 100 sets of PID parameters are selected under different coolant flow rates, operating temperatures, and load currents. The PSO algorithm is used to iterate each set of parameters for 30 iterations to obtain the optimal PID parameters for each operating condition. The ANN model is one of the most popular data processing tools inspired by the biological structure of the brain and neurons. The trained ANN model can learn the relationship between input/output data and predict the output information based on the input data. In this work, the inputs for ANN training are the current, ambient temperature, and coolant flow rate. The outputs are the three PID parameters.