Before modeling, I recommend creating a sketch of the heat transfer process in the form of a Piping & Instrumentation Diagram (P&ID) or a Process Flow Diagram (PFD). This will provide you with a clear and comprehensive visual representation of the entire process, helping you better understand its components.
If you are using Simulink / Simcape, you can model the system based on the P&ID or the PFD. Simply search for and insert the relevant equipment (blocks) or use the MATLAB function block, which describes the mathematical relationship between the input and the output.
Regarding the issue you are facing, it's essential to check the mathematical model of the thermal system. This will help identify what went wrong with the thermal controller's mathematical equation and provide insights into resolving the problem.