## 1 Introduction and Review of Existing Research
### Thermoeconomics and ML  
This work, included in the IA-TERM project, develops a methodology that manages intelligent systems to optimise the behaviour of buildings' energy systems throughout their useful life, combining the disciplines of thermoeconomics and ML. The aim is to detect anomalies and quantify their effects, showing their potential to reduce energy consumption and mitigate the impacts of climate change.  
Intelligent energy management and thermoeconomic diagnosis offer a powerful approach to optimising both the energy efficiency and cost-effectiveness of buildings as a step towards ZEB buildings. By integrating ML advanced energy management systems with thermoeconomic diagnosis, more informed decisions can be made that balance energy savings, operational costs, and sustainability goals. As technology continues to evolve, this approach will play an increasingly critical role in advancing the sustainable development of the built environment.  
There are several works that suggest mixing the disciplines of thermoeconomics and ML in industrial systems, as they see this fusion as necessary to advance in the analysis and diagnosis of thermal systems. In 2009, [PERSON] published the book _Exergy, Energy System Analysis and Optimization_[7], a comprehensive book on exergy, energy systems and their optimisation. In volume 3, the author presents for the first time the idea of using ML together with exergy-based models to design energy systems. Later, in 2011, [PERSON] et al. [16] published a paper in which they performed diagnosis on gas turbines using thermoeconomic diagnosis and ML diagnosis. The authors conclude that thermoeconomic diagnosis allows locating the anomaly and ML identifies the type of anomaly. In the work published by [PERSON] et al. in 2016 [17], a new thermoeconomic diagnosis methodology is developed that allows locating the intrinsic malfunctions in the components of an external combustion gas turbine. For this purpose, it combines thermoeconomic diagnosis with an artificial neural network. One of the most prolific authors combining ML and thermoeconomics is [PERSON] who, together with other authors, optimises and applies thermoeconomic analysis using ML methods with genetic algorithms [18] and neural networks [19; 20; 21]. Finally, the most recent works are those published in 2020 [22], 2022 [23], and 2023 [24], which are related to the optimisation of industrial thermal systems.  
Therefore, according to the works that combine thermoeconomics and ML, there is a trend in this direction in recent years; always applied in industrial systems. However, only the works of [PERSON] et al. and [PERSON] et al. incorporate diagnosis objectives, but they do not work with dynamic thermal systems, nor with buildings. Because of that, this work proposes, for the first time, a methodology based on the combination of ML and thermoeconomic diagnosis for the maintenance of thermal systems in buildings, overcoming obstacles, and adapting to the specific characteristics of these dynamic systems.  
This paper is structured into five main sections. First, the (1) introduction and review of existing research are presented. This is followed by the (2) motivation of the work and the detailed description of the (3) proposed methodology. The paper then moves on to the (4) conclusions, and finally, it concludes with a (5) discussion of the findings.