Development of thermal models for predictive control of energy in buildings