## 3 Thermal Controller Design  
### Fuzzy Logic Control Method  
FLC mimics human thinking and decision-making processes to handle system uncertainty and vagueness. Unlike conventional binary logic control systems that consider only all-or-nothing situations, FLC allows for varying degrees between complete truth and complete falsehood, providing a more flexible and adaptive control strategy. Hence, this study presents an FLC rule to address specific thermal control problems mainly because it effectively handles temperature uncertainty and nonlinearity. First, a set of fuzzy rules was defined and constructed based on expert knowledge and practical operational experience to describe the behavior of the thermal control system. Next, a fuzzy inference engine was utilized to evaluate these rules and assess the degree of fuzziness of the control actions based on real-time input data. Finally, through a defuzzification process, the fuzzy control actions were converted into crisp output values, which drove the thermal control system to achieve the desired temperature performance by determining the flow rate required by the electric three-way valve. This flow rate was subsequently adjusted within the hydrogen production system based on feedback from the RTD. The design of FLC typically follows a systematic framework based on the Mamdani inference method. The process begins with the definition of fuzzy variables and their corresponding membership functions, which represent the inputs and outputs of the system. These functions are often modeled using triangular or trapezoidal shapes to effectively handle uncertainty and vagueness. Next, fuzzy rules are established, capturing expert knowledge through IF-THEN statements that describe the relationships between inputs and desired outputs. This step is essential, as the rules form the foundation for the decision-making process of the FLC controller. In the inference phase, the Mamdani approach employs fuzzy reasoning to evaluate the formulated rules, determining the degree to which each rule is activated based on the current inputs. This evaluation allows the controller to derive suitable control actions from the fuzzy rules. Finally, the process concludes with defuzzification, where the aggregated fuzzy output is converted back into a crisp value. This is commonly achieved using the centroid method, which calculates the precise control action needed. Overall, this structured approach enables FLC to manage complex, nonlinear systems, providing robustness and flexibility in various control applications [24]. The detailed design steps are as follows. Step 1: The fuzzification of input variables involves converting real-valued input values into fuzzy values. This step utilizes fuzzy sets and membership functions to describe the degree of each input variable. Assuming \(x\) is an input value, \(\mu_{A_{i}}(x)\) represents the membership degree of \(x\) to the \(i\)-th fuzzy set \(Ai\), in the range of [0, 1]. Step 2: The establishment of a rule base involves creating a set of fuzzy rules that describe the relationship between the input variables and output variables. These rules, based on expert experience or knowledge, take the form of \"IF...THEN...\" conditional statements, determining how output decisions are derived from specific input conditions. For example, a fuzzy rule \(R_{j}\) could be structured as the following: \(R_{j}=\) IF \(x\) is \(A_{i}\) AND \(y\) is \(B_{i}\), THEN \(z\) is \(C_{i}\), where \(A_{i}\), \(B_{i}\), and \(C_{i}\) represent fuzzy sets associated with input \(x\), \(y\), and output \(z\), respectively. Step 3: Mamdani inference involves performing inference on the fuzzified inputs using the Mamdani inference method to generate fuzzy outputs. This method compares the degree of matching between the inputs and the input conditions of each rule, determining the shape of the output membership function based on these matches.