The proposed solution addresses the issues of high overshoot and long response time in traditional PID control methods for complex nonlinear heating systems with large inertia and pure lag. The Improved Coati Optimization Algorithm (ICOA-PID) introduces an enhanced controller. Firstly, the heating system's primary and secondary piping transfer function models are established. Secondly, the Coati Optimization Algorithm (COA) has been improved in four aspects: the introduction of the chaotic mapping mechanism, nonlinear inertial weighting factors, t-distribution variation, and the coati alarmist mechanism, and the test is carried out using the CEC2022 function set, which performs well in solving most of them in dimension 20; meanwhile, the data are plotted in boxplots. It can be observed that ICOA has both the smallest mean height and the smallest interquartile range (IQR). These verify that the ICOA is able to converge more rapidly, with a greater degree of accuracy and stability than other algorithms. Finally, the simulation experiments were conducted, the step response plot demonstrated that the rise time of the ICOA-PID controller was reduced by 5 seconds in comparison to the pre-improvement period, and by approximately 10 seconds in comparison to the DBO-PID controller. Additionally, the amount of overshoot was reduced by 2% in comparison to the pre-improvement period; the fitness value curves indicate that the fitness value of the ICOA-PID controller is consistently minimized, indicating that it identifies the most optimal set of PID parameters. the error curve exhibits a rapid and pronounced decline, indicating the optimization of parameters to achieve both dynamic responsiveness and static accuracy within the system. The aforementioned results substantiate that the IOCA-PID control methodology is more effective in meeting the indoor thermal demand demands of winter users compared to other algorithmic controllers, and thus possesses certain practical relevance for real-world control applications.