## 5 Conclusions  
This study presents a flexible HVAC modeling framework intended for building digital twin implementation and demonstrated its application for modeling of a building ventilation system. The developed ventilation system model incorporates both data-driven and physics-based methods and includes multiple approaches to ventilation control. The ventilation model is used to simulate the operation of a teaching and office building with different control strategies and compare their performance in regard to air quality, energy cost and environmental impact. A novel approach for air quality evaluation is proposed and used for the MPC modeling and control strategy comparison.  
In the control strategy comparison, it is found that MPC performs significantly better than the current rule-based control scheme for all performance parameters. A balanced MPC approach, which prioritizes both operation cost and air quality, can reduce ventilation system energy cost by 18% while providing significantly better air quality. With a more economic focus, the MPC achieves a 24% cost reduction at some expense to the air quality, and with an air quality focus, the MPC delivers almost perfect air quality (according to the proposed evaluation method), while still providing an 11% cost reduction compared to the current operation strategy. It is also shown that with an environmental focus, the MPC can reduce the CO2 emissions attributed to the ventilation system energy consumption. In this way, the strategy comparison illustrates the potential of MPC for efficient operation and flexible objective prioritization according to stakeholder interests. It also showcases one of the potential applications of the developed framework for building operation optimization.  
This study presents the first case application of the developed framework, so testing and comparison of different component models was limited by the data available for the case study building. Additionally, the model validation is imperfect due to missing knowledge of some system operation details and poor data quality. Moreover, the MPC development and implementation was limited due to computational constraints and software issues.  
For future work, exploring advanced optimization strategies, such as robust or stochastic optimization, to address imperfect information and dynamic uncertainties, including varying occupancy patterns, could enhance the reliability and adaptability of model predictive control (MPC) in HVAC applications. Simultaneously, benchmarking multiple component models for various system types, such as fans, air infiltration dynamics, and occupant CO2 generation, would improve the generalizability and accuracy of ventilation system models across diverse building scenarios. Additionally, leveraging artificial neural networks or other AI models for predicting occupancy patterns based on historical and real-time data could significantly refine the precision of the proposed MPC solution.  
**Author Contributions:** Conceptualization, A.H.A. and M.J.; methodology, A.H.A.; software, A.H.A.; validation, A.H.A.; formal analysis, A.H.A.; investigation, A.H.A.; resources, A.H.A. and M.J.; data curation, A.H.A.; writing--original draft preparation, A.H.A.; writing--review and editing, A.H.A. and M.J.; visualization, A.H.A.; supervision, M.J.; project administration, A.H.A. All authors have read and agreed to the published version of the manuscript.  
**Funding:** This research received no external funding.  
**Institutional Review Board Statement:** Not applicable.  
**Informed Consent Statement:** Not applicable.  
**Data Availability Statement:** The Python model and data used for the presented simulations are available on the repository: [[https://github.com/AHyrup/VentilationSystemModel](https://github.com/AHyrup/VentilationSystemModel)]([https://github.com/AHyrup/VentilationSystemModel](https://github.com/AHyrup/VentilationSystemModel)) (accessed on 31 December 2024).  
**Conflicts of Interest:** The authors declare no conflicts of interest.