Model predictive control applied to a heating system with PV panels and thermal energy storage