Hybrid White-Box/Black-Box Modeling and Control of a CO2 Heat Pump System Using Modelica and Deep Learning: A Case Study on Return-Water Temperature Control
Abstract
1. Introduction
- (1)
- a validated DNN surrogate for a computationally complex CO2 heat pump trained on operational data;
- (2)
- a hybrid integration of the surrogate into a physics-based Modelica system to enable dynamic, long-horizon simulations;
- (3)
- a control-oriented evaluation of hysteresis-based strategies (baseline) quantifying energy use, stratification, and cycling frequency, providing a reference for future MPC design.
2. Methodology
2.1. Heating System
2.2. CO2 Heat Pump
2.3. Black Box CO2 Heat Pump Model
2.4. White Box System Model
3. Results
3.1. Black Box Model Validation
3.2. Comparison of Control Strategies
4. Discussion
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Abbreviations
| DNN | Deep Neural Network |
| FMU | Functional Mock-up Unit |
| COP | Coefficient of Performance |
| HTGC | High-Temperature Gas Cooler |
| LTGC | Low-Temperature Gas Cooler |
| MPC | Model Predictive Control |
References
- Aghili, S.A.; Rezaei, A.H.M.; Tafazzoli, M.; Khanzadi, M.; Rahbar, M. Artificial Intelligence Approaches to Energy Manage-ment in HVAC Systems: A Systematic Review. Buildings 2025, 15, 1008. [Google Scholar] [CrossRef]
- Cowan, J. International performance measurement and verification protocol: Concepts and Options for Determining Energy and Water Savings-Vol. I. In International Performance Measurement & Verification Protocol; Efficiency Valuation Organization (EVO): Washington, DC, USA, 2002; Volume 1. [Google Scholar]
- ASHRAE. Guideline 14-2002: Measurement of Energy and Demand Savings; ASHRAE: Atlanta, GA, USA, 2002. [Google Scholar]
- Arendt, K.; Jradi, M.; Shaker, H.R.; Veje, C. Comparative analysis of white-, gray-and black-box models for thermal simulation of indoor environment: Teaching building case study. In Building Performance Analysis Conference and SimBuild: Co-Organized by ASHRAE and IBPSA-USA; ASHRAE: Atlanta, GA, USA, 2018; pp. 173–180. [Google Scholar]
- Ruiz, G.R.; Bandera, C.F.; Temes, T.G.-A.; Gutierrez, A.S.-O. Genetic algorithm for building envelope calibration. Appl. Energy 2016, 168, 691–705. [Google Scholar] [CrossRef]
- Elmqvist, H.; Boudaud, F.; Broenink, J.; Brück, D.; Ernst, T.; Fritzson, P.; Jeandel, A.; Juslin, K.; Klose, M.; Mattsson, S. ModelicaTM—A Unified Object-Oriented Language for Physical Systems Modeling. A Unified Object-Oriented Language for Physical Systems Modeling: Tutorial and Rationale, Version 1.3; Modelica Design Group: Lund, Sweden, 1999. [Google Scholar]
- Shahcheraghian, A.; Madani, H.; Ilinca, A. From white to black-box models: A review of simulation tools for building energy management and their application in consulting practices. Energies 2024, 17, 376. [Google Scholar] [CrossRef]
- Suite, T. TLK Energy. The Library for Thermodynamic Systems. Available online: https://tlk-energy.de/en/software/til-suite (accessed on 12 January 2025).
- Liang, J.; Li, T. Detailed Transient Study of a Transcritical CO2 Heat Pump for Low-Carbon Building Heating. Buildings 2025, 15, 3489. [Google Scholar] [CrossRef]
- Ciulla, G.; D’Amico, A. Building energy performance forecasting: A multiple linear regression approach. Appl. Energy 2019, 253, 113500. [Google Scholar] [CrossRef]
- Mocanu, E.; Nguyen, P.H.; Gibescu, M.; Kling, W.L. Deep learning for estimating building energy consumption. Sustain. Energy Grids Netw. 2016, 6, 91–99. [Google Scholar] [CrossRef]
- Sun, Y.; Haghighat, F.; Fung, B.C. A review of the-state-of-the-art in data-driven approaches for building energy prediction. Energy Build. 2020, 221, 110022. [Google Scholar] [CrossRef]
- Hopfe, C.J.; McLeod, R.S.; Rollason, T. Opening the black box: Enhancing community design and decision making processes with building performance simulation. In Proceedings of the Building Simulation 2017, IBPSA, San Francisco, CA, USA, 7–9 August 2017; pp. 920–929. [Google Scholar]
- Sazon, T.A.S.; Zhang, Q.; Nikpey, H. Development of a surrogate model of a trans-critical CO2 heat pump for use in operations optimization using an artificial neural network. In IOP Conference Series: Materials Science and Engineering; IOP Publishing: Bristol, UK, 2023; Volume 1294. [Google Scholar]
- Sazon, T.A.; Zhang, Q.; Nikpey, H. Comparison of different strate-gies for operating a solar-assisted ground-source CO2 heat pump system for space and water heating. Energy Convers. Manag. X 2024, 22, 100604. [Google Scholar]
- Rahal, M.; Ahmed, B.S.; Renström, R.; Stener, R.; Wurtz, A. Data-driven heat pump management: Combining machine learning with anomaly detection for residential hot water systems. Neural Comput. Appl. 2025, 37, 16203–16229. [Google Scholar] [CrossRef]
- Rousseau, P.; Laubscher, R. A Condition-Monitoring Methodology Using Deep Learning-Based Surrogate Models and Parameter Identification Applied to Heat Pumps. Math. Comput. Appl. 2024, 29, 52. [Google Scholar] [CrossRef]
- Song, G.; Melikov, A.K.; Zhang, G.; Bivolarova, M.P. Human response to the bed thermal environment generated by a ventilated mattress combined with local heating. Build. Environ. 2023, 241, 110461. [Google Scholar] [CrossRef]
- Song, G.; Ai, Z.; Liu, Z.; Zhang, G. A systematic literature review on smart and personalized ventilation using CO2 concentration monitoring and control. Energy Rep. 2022, 8, 7523–7536. [Google Scholar] [CrossRef]
- Song, G.; Ai, Z.; Zhang, G.; Peng, Y.; Wang, W.; Yan, Y. Using machine learning algorithms to multidimensional analysis of subjective thermal comfort in a library. Build. Environ. 2022, 212, 108790. [Google Scholar] [CrossRef]
- Turner, W.; Walker, I.; Roux, J. Peak load reductions: Electric load shifting with mechanical pre-cooling of residential buildings with low thermal mass. Energy 2015, 82, 1057–1067. [Google Scholar] [CrossRef]
- Vakiloroaya, V.; Samali, B.; Fakhar, A.; Pishghadam, K. A review of different strategies for HVAC energy saving. Energy Convers. Manag. 2014, 77, 738–754. [Google Scholar] [CrossRef]
- Salakij, S.; Yu, N.; Paolucci, S.; Antsaklis, P. Model-Based Predictive Control for building energy management. I: Energy modeling and optimal control. Energy Build. 2016, 133, 345–358. [Google Scholar] [CrossRef]
- Salame, A.A.H.; Peralez, J.; Nadri, M.; Dufour, P.; Lemort, V. Model Predictive Control-Based Optimization of a Transcritical CO2 Thermal Compressor Heat Pump Cycle Using a RNN-based Reduced Model. J. Process Control, 2025; in press. [Google Scholar]
- Liu, F.; Deng, J.; Pan, W. Model-based dynamic optimal control of an ejector expansion CO2 heat pump coupled with thermal storages. Energy Procedia 2018, 152, 156–161. [Google Scholar] [CrossRef]
- Liu, F.; Zhu, W.; Zhao, J. Model-based dynamic optimal control of a CO2 heat pump coupled with hot and cold thermal storages. Appl. Therm. Eng. 2018, 128, 1116–1125. [Google Scholar] [CrossRef]
- Wang, W.; Zhao, Z.; Zhou, Q.; Qiao, Y.; Cao, F. Model predictive control for the operation of a transcritical CO2 air source heat pump water heater. Appl. Energy 2021, 300, 117339. [Google Scholar] [CrossRef]
- Kudela, L.; Špiláček, M.; Pospíšil, J. Multicomponent numerical model for heat pump control with low-temperature heat storage: A benchmark in the conditions of Central Europe. J. Build. Eng. 2023, 66, 105829. [Google Scholar] [CrossRef]
- Kumar, D.M.; Catrini, P.; Piacentino, A.; Cirrincione, M. Integrated thermodynamic and control modeling of an air-to-water heat pump for estimating energy-saving potential and flexibility in the building sector. Sustainability 2023, 15, 8664. [Google Scholar] [CrossRef]
- Staudt, S.; Unterberger, V.; Gölles, M.; Wernhart, M.; Rieberer, R.; Horn, M. Control-oriented modeling of a LiBr/H2O absorption heat pumping device and experimental validation. J. Process Control 2023, 128, 103024. [Google Scholar] [CrossRef]
- Wang, W.; Hu, B.; Wang, R.; Luo, M.; Zhang, G.; Xiang, B. Model predictive control for the performance improvement of air source heat pump heating system via variable water temperature difference. Int. J. Refrig. 2022, 138, 169–179. [Google Scholar] [CrossRef]
- Kuboth, S.; Heberle, F.; Weith, T.; Welzl, M.; König-Haagen, A.; Brüggemann, D. Experimental short-term investigation of model predictive heat pump control in residential buildings. Energy Build. 2019, 204, 109444. [Google Scholar] [CrossRef]
- Xu, X.X.; Chen, G.M.; Tang, L.M.; Zhu, Z.J. Experimental investigation on performance of transcritical CO2 heat pump system with ejector under optimum high-side pressure. Energy 2012, 44, 870–877. [Google Scholar] [CrossRef]
- Xu, Y.; Mao, C.; Huang, Y.; Shen, X.; Xu, X.; Chen, G. Performance evaluation and multi-objective optimization of a low-temperature CO2 heat pump water heater based on artificial neural network and new economic analysis. Energy 2021, 216, 119232. [Google Scholar] [CrossRef]
- Gudjonsdottir, V.; Ferreira, C.I.; Rexwinkel, G.; Kiss, A.A. Enhanced performance of wet compression-resorption heat pumps by using NH3-CO2-H2O as working fluid. Energy 2017, 124, 531–542. [Google Scholar] [CrossRef]
- Baek, C.; Heo, J.; Jung, J.; Cho, H.; Kim, Y. Performance characteristics of a two-stage CO2 heat pump water heater adopting a sub-cooler vapor injection cycle at various operating conditions. Energy 2014, 77, 570–578. [Google Scholar] [CrossRef]
- Song, G.; Zhang, Q.; Nord, N. Integrating Deep Learning with Modelica for a CO2 Heat Pump System: A Hybrid Modeling Case Study in Oslo. In Proceedings of the Resilient2025, Västerås, Sweden, 23–25 September 2025. [Google Scholar]
- Song, G.; Filonenko, K.; Wen, X.; Ebrahimy, R.; Nord, N. Modelica-based model predictive control for a CO2 heat pump system: Case study in Oslo. J. Build. Eng. 2025, 115, 114501. [Google Scholar] [CrossRef]
- CEN EN 14511-2:2022; Air Conditioners, Liquid Chilling Packages and Heat Pumps for Space Heating and Cooling and Process Chillers, with Electrically Driven Compressors—Part 2: Test Conditions. European Committee for Standardization: Brussels, Belgium, 2022.








| Category | Hyperparameter | Final Value |
|---|---|---|
| Data split | Validation fraction | 0.30 |
| Random seed | 42 | |
| Model type | Model family | Feed-forward ANN |
| Optimization | Optimizer | Adam |
| Learning rate | 0.001 | |
| Objective | Loss function | MSE |
| Monitoring | Metrics | MAE |
| Training schedule | Max epochs | 200 |
| Batch size | 32 | |
| Early stopping | Patience | 5 |
| Restore best weights | True |
| Layer Index | Layer Type | Units | Activation | Input/Output Shape | Notes |
|---|---|---|---|---|---|
| 0 | Input | – | – | Input: (6,) | 6 input features |
| 1 | Dense | 128 | ReLU | (6,) → (128,) | Hidden layer 1 |
| 2 | Dense | 128 | ReLU | (128,) → (128,) | Hidden layer 2 |
| 3 | Dense | 64 | ReLU | (128,) → (64,) | Hidden layer 3 |
| 4 (output) | Dense | 4 | ReLU | (64,) → (4,) | 4 outputs |
| Control Conditions | 20–50 °C, 1.5 kg/s | 20–70 °C, 1.5 kg/s | 20–55 °C, 1.5 kg/s | 20–50 °C, 1.3 kg/s |
|---|---|---|---|---|
| Power electricity use (kWh) | 7762.5 | 10,286 | 8807.5 | 9498.3 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Song, G.; Zhang, Q.; Nord, N. Hybrid White-Box/Black-Box Modeling and Control of a CO2 Heat Pump System Using Modelica and Deep Learning: A Case Study on Return-Water Temperature Control. Energies 2026, 19, 908. https://doi.org/10.3390/en19040908
Song G, Zhang Q, Nord N. Hybrid White-Box/Black-Box Modeling and Control of a CO2 Heat Pump System Using Modelica and Deep Learning: A Case Study on Return-Water Temperature Control. Energies. 2026; 19(4):908. https://doi.org/10.3390/en19040908
Chicago/Turabian StyleSong, Ge, Qian Zhang, and Natasa Nord. 2026. "Hybrid White-Box/Black-Box Modeling and Control of a CO2 Heat Pump System Using Modelica and Deep Learning: A Case Study on Return-Water Temperature Control" Energies 19, no. 4: 908. https://doi.org/10.3390/en19040908
APA StyleSong, G., Zhang, Q., & Nord, N. (2026). Hybrid White-Box/Black-Box Modeling and Control of a CO2 Heat Pump System Using Modelica and Deep Learning: A Case Study on Return-Water Temperature Control. Energies, 19(4), 908. https://doi.org/10.3390/en19040908

