## 4 Discussion  
Although the literature shows that in hardware in the loop applied to power systems, the systems can be divided into two specific topics, \"electric hardware-in-the-loop\" (EHIL) and \"thermal hardware-in-the-loop\" (THIL), this fact was not found in the bibliometric analysis, where most keywords were related to EHIL. Figure 10: Factorial analysis of HIL in energy systems using R-studio software and bibliometrix library. Data obtained from Scopus in April 2023. Query: (TITLE-ABS-KEY(((“hardware in the loop” AND (energy)) ANDNOT “synthetic aperture”))). EHIL systems are used to assess electric power systems and components, such as generators, inverters, and motors [1; 6; 8; 9; 10]. These systems use real-time simulation and physical hardware to create a virtual environment for evaluating electrical components. EHIL systems are used in a variety of applications, including testing power systems for electric vehicles and renewable energy sources. For example, EHIL has been used to test battery management systems for electric vehicles to improve their performance and reliability [32]. In addition, EHIL has been used to test the impact of renewable energy sources, such as wind turbines and solar panels, on the power grid [33; 34; 35; 32]. THIL systems, on the other hand, are implemented to evaluate thermal systems and components, such as heat exchangers, refrigeration systems, and air conditioning systems. THIL systems use real-time simulation and physical hardware to create a virtual environment for testing thermal systems. THIL is used in applications such as testing HVAC systems for buildings to improve their energy efficiency and reduce their environmental impact [36; 37]. While EHIL and THIL are typically used separately to test electrical and thermal systems, there is an emerging trend to combine these two techniques to test systems that require both electrical and thermal performance verification. For example, EHIL and THIL were used together to assess electric vehicle thermal management systems [32]. In this application, EHIL was used to test the performance of the electric powertrain, while THIL was used to test the performance of the thermal management system. Smart cities rely on interconnected systems to deliver essential services such as energy, transportation, and water. These systems are becoming increasingly complex, with sophisticated control strategies and real-time data management. Hardware-in-the-loop (HIL) simulation offers a way to test these systems in a controlled environment without the risk of disrupting city operations. In recent years, HIL simulation has gained attention as a tool for testing and optimizing smart city systems. HIL simulation has been used in a variety of smart city applications, including transportation systems [12; 13; 14], energy management systems [15; 16; 17], lighting systems [18], 5G networks [13; 19], and urban ecosystems [20; 21]. In energy management systems, HIL simulation has been used to evaluate the performance of microgrid systems. For example, [PERSON] et al. (2022) used HIL simulation to assess the performance of a hybrid energy storage control strategy on an islanded microgrid system under different load conditions. The results showed that the cyclic lifetime of the battery storage system could be increased with peak shaving due to a reduced amount of charging and discharging operations, and an excessive energy buffering control method could increase the islanded operation time by using nearly 10% of the otherwise lost energy [15]. In recent years, HIL simulation has gained attention as a tool for testing and optimizing buildings. Building systems, such as HVAC, lighting, and energy management systems, are becoming increasingly complex as they incorporate more sophisticated control strategies and integrate with other building systems. HIL simulation offers a way to assess these systems in a controlled environment without the risk of disrupting building operations [16; 17; 22; 23].