A predictive control approach for thermal energy management in buildings. (November 2022)