Energy Management-Based Predictive Controller for a Smart Building Powered by Renewable Energy

This paper presents a smart building energy management system (BEMS), which is in charge of optimally controlling the sustainable operation of a building-integrated-microgrid (BIM). The main objective is to develop an advanced high-level centralized control approach-based model predictive control (MPC) considering variations of renewable sources and loads. A finite-horizon planning optimization problem is developed to control the operation of the BIM. The model can be implemented as a BEMS for the BIM to manipulate the indoor temperature and optimize the operation of the system’s units. A centralized MPC-based algorithm is implemented for the power management scheduling of all sub-systems as well as power exchanges with the electrical grid. The MPC algorithm is verified over case studies applied to two floors residential building considering the climate condition of a typical day of March, where the effects of both loads and thermal resistance of building shell on the operation of the BIM are analyzed via numerical simulations. The analysis shows that 96% of the total electrical load has been fulfilled by the local production where 23% represents the total electric output of the micro-CHP and 73% is the renewable energy production. The deficit, which represents only 4%, is purchased from the electrical distribution network (EDN).


Introduction
The integrated smart grids on a building's energy production and management is, so far, a promising research field that will establish a strong platform from experimental and computational to a real, large utilization in buildings. Smart grids concept can be considered a revolutionary way on managing energy production sources in term of flexibility, efficiency, and being environmentally friendly [1], and responding to an energy demand instantly on active systems [2] by communication tools and procedures; especially in areas where renewable energies have a considerable and substantial potential and when the cost of the connection to the general power network may have technical and financial inconveniences. The implementation of the microgrid in a building may have numerous goals, especially reducing the energy cost and power consumption for less dependence to a general network. This paper aims to present the building-integrated-microgrid (BIM) as a new concept that may support the transition to intelligent buildings, which can be considered as energy efficient buildings. The BIM may play a vital task in the shift and upgrading of electric networks by enhancing the grid efficiency and allowing consumers to participate in managing their own consumption.
Considerable efforts have been dedicated to investigating the smart buildings operation. Wang et al. [3] proposed a control approach to manage the comfort in smart buildings. In [4], an optimization problem focusing on application to a BIM. These methodologies could enhance shifting from passive buildings to active ones playing a key role in an electrical grid. The challenging task is the formulation of a predictive constrained planning problem enabling an efficient energy management, precise control of the thermal power loads, and optimizing the operation of the energy storage device (ESD) and the micro-CHP unit. The challenge is the definition of the global problem, where diverse systems will be modeled and tested considering many conditions. The presented control strategy might be taken as a practical solution to mitigate and address the smart energy management challenges in buildings. Besides, it can be considered as a complete approach that can be effectively considered in real scenarios. The main advantage of the developed approach lies in its ability to mitigate the uncertainties and intermittent behavior of inputs.
The rest of the paper is organized as follows. In Section 2, the smart building-integrated-microgrid is modeled. The tracking control problem is formalized in Section 3, while the results and discussion are presented in Section 4. Finally, some concluding remarks are presented in Section 5.

The Smart Building-Integrated-Microgrid Modeling
Smart BIM is a novel concept integrating loads, distributed energy sources, storage systems and advanced metering infrastructure. The special feature of these buildings is their ability to perform demand response strategies as a set of programs, which allow the building manager or/and consumers to plan and manage activities connected to the energy usage. Specificallyit helps them to play a crucial task in shifting their own loads in peak intervals to reduce their consumption or/and shift to off-peak hours to smooth the power load curve. In the proposed paper, we suppose that the BIM integrates renewable distributed generations, micro-CHP, ESD, electric and thermal loads, BEMS and an advanced metering infrastructure.
The BEMS aims to optimally control the operation of the BIM in autonomous mode, otherwise, linking and connecting the BIM sub-systems and the global central controller (GCC). The BEMS is in charge of collecting data and implementing forecasts of energy production and power loads. Furthermore, it makes an interface of communication for sending/receiving control signals to the BIM components. The high level BIM central controller is managing energy exchanges by accurately consenting the optimal operation of the BIM. The main objective of the GCC is to provide a high-level control to generate optimal set points for all components as well as for the energy exchanges. The GCC is in charge of the smart energy management in the BIM. It decides about the state of the ESD (storing/discharging), the energy exchanges with the EDN (selling/purchasing) as well as the state of the micro-CHP.

The Solar PV Generators Modeling
The PV module is modeled according to the following Equations: where, ∆T(t) = T amb + 0.02G in (t) (6) where I sc,re f and I mp,re f are respectively the module short circuit and the maximum power currents. V mp,re f and V oc,re f are respectively the maximum power and open circuit voltages of the module. G in and G st are respectively the solar irradiation and the standard light intensity. The total power and voltage output of the PV modules are given by: where β pv, s and β pv, p are respectively the serial and parallel number of modules.

Wind Turbine Generator
The power output of the wind turbine is given by: where v(t) is the expected wind speed at the hub height of the wind turbine and P r is the rated power.

Energy Storage System Dynamics
It is worthwhile to mention that the energy storage system can be charged directly from the renewable generators or/and from the main grid. However, the energy storage system is discharged mainly to satisfy the needs of the BIM. The charging from the main grid is allowed only at periods of energy shortage. The charging state of the storage system in given as follows: (11) where u Char (t) and u dis (t) are respectively the charged and discharged powers at the instant t, β Char is the charging efficiency, β dis is the discharging efficiency.

Loads
The total load of the building is supposed to comprise controllable and non-controllable loads [30,31]. The controllable load is assumed to be delimited to the thermal load that is defined as the desired hot water and preferred building temperature. This will allow assessing the effects of the thermal loads on the operation of the BIM. It is assumed that the required thermal power is ensured by the micro-CHP. More details about users' controllable appliances can be found in [32]. The main objectives can be summarized in controlling the consumption patterns while maximizing the use of the local available renewable energy production, smoothing the load profile and minimizing the cost of the energy purchased from the main grid. The temperature state of the water storage is given as follows [33]: (12) where q T is the water storage volume, C water is the specific heat of water, and T cold (t) is the temperature of cold water. The building temperature is defined by the following Equation: (13) where C air is the inside air's heat capacity, R BIM is the thermal resistance, T out (t) is the outside temperature.
The predictions of load are implemented by BEMS that supports the GCC in delivering control signals defining the optimal energy management strategy for the BIM. Advanced metering infrastructure is in charge of collecting weather and historical data of energy consumption in order to perform predictions for the MPC algorithm.

Energy Exchanged on the Building's Envelope
The building construction shell material can be considered as a homogeneous one with special material characteristics. In our case, the material is concrete for structures and masonry of alveolar cement bricks. The outside window glasses represents 3% of the total envelope area, so the total energy exchanged on the building's shell can be considered of the masonry ones. The energy exchanged on the building's envelope is also a function of material density, inertia, exterior climate data such as solar rays, wind, air pressure, hygrometric data, etc. The global exchanged energy through building's envelope can be written as: where A w is the total walls' area, λ m is the material conductivity, and e w is the thickness wall metering.

Building Energy Management Algorithm: The Tracking Control Problem
Many authors in the literature suggested the use of model predictive control for demand side management and scheduling of the operation of microgrids and buildings. Authors in [34] presented a robust model predictive control for real-time demand side management in residential smart grids. Furthermore, authors validated and demonstrated the effectiveness of their method. In this paper, the proposed scheduling framework works following a receding horizon approach. The optimal control state is determined for the energy storage system, micro-CHP, and all power flows at the microgrid level, while, just the first control state is considered. The procedure is then repeated under the receding horizon principle, i.e., at the next time step, new data are available, allowing computing the new control sequences. The optimization framework defined in Equation (15), subject to operational constraints, expressed as state, inequality and equality in Equations (16)-(30) is formulated as a mixed integer nonlinear programming problem, where the decision variables are the power flows exchange at the BIM level. The main advantage of this approach is its ability to anticipate future events while providing a clear constraints management.

Objective Function
The main objective is to track, as possible, the reference signals representing the optimal desired BIM temperature and the optimal non-controllable load as well as to maximize the stored energy in the ESD with a minimum interaction with the EDN. The reference signals define the ideal operations of the BIM that maximize this energy efficiency. The optimization problem is formulated as a multi-objective optimization problem subject to quadratic cost function where the objective function is defined as follows:  (15) where T in (t) is dynamic reference state representing respectively the desired temperature of the BIM and l nc (t) are dynamic reference states representing the non-controllable load.

State Equations and Constraints
The predicted power balance ∆ u bal (t) of the BIM is given by the following Equation: where u g,p (t), and u g,s (t) are respectively the power purchased and sold from/to the EDN, and u elc chp (t) is the electric power output of the micro-CHP. The energy storage system is constrained by capacity limits: The renewable power generation is limited between an upper and lower bound: The electric power consumed in the BIM is constrained by upper and lower bounds: The preferred hot water and buildings' temperature are constrained by preference limits: The electrical and thermal power outputs of the micro-CHP are limited: The micro-CHP power output ramp rates are given by:

Case Study Description
The proposed control framework is applied to a case study to assess its performance and effectiveness. The considered BIM includes two floors of a residential building of 120 [m 2 ] situated in Marrakech, Morocco. The total power load of the building represents the consumption of five occupants. Furthermore, the BIM comprises a wind generator of 5 [kW] and a PV system of 1 [kW] composed by 4 × 250 [W] high efficiency polycrystalline solar PV modules. The maximal capacity of the energy storage system is ranged between 1 and 24 [kWh]. The electric power output of the micro-CHP unit is ranged between 0.3 and 3 [kW], while thermal power output varies from 0.5 to 5 [kW]. In addition, the thermal and electrical efficiencies are respectively equal to 50% and 30%. The total volume of the water storage is equal to 150 L. The estimated total controllable electrical load is reported in Figure 1, whereas Figure 2 displays the projected hot water load in the BIM. The cold water temperature T cold (t), is set to be equal to 10 [ • C] from 9:00 to 21:00 and set to be 7 [ • C] for the rest of the day. Furthermore, the outside temperature of the BIM T out (t) is equal to 10 [ • C] from 1:00 to 6:00, and takes a value of 15 [ • C] from 7:00 to 17:00. Whereas, it equals to 6 [ • C] for the rest of the day. Furthermore, the water storage temperature is supposed to be comprised between 50 and 70 [ • C] with a primary state equal to 60 [ • C] (Tst(0) = 60), while, the building's temperature is set to follow the reference desired temperature signal reported in Figure 3, with an initial state equal to 18

Results and Discussion
The high-level centralized control algorithm-based MPC defined in the prior sections is simulated and verified over a case study to prove its real application as well as to validate its performances considering several conditions. In this paper, it is supposed that the BIM includes renewable distributed generations, micro-CHP, ESD, electric and thermal loads, BEMS and an advanced metering infrastructure.
In this case study, the prediction and control horizons are both set equal to 24 h. Furthermore, the scheduling optimization problem has been resolved considering the receding horizon approach to take into account the intermittent character and dynamics of renewable resources and load. In addition, providing a route of the upcoming state and control variables satisfying the optimal functioning of the BIM is considered. The predictive model is applied over the prediction horizon considering new data. The expected renewable power output is modeled as the sum of deterministic part and a noise represented by the standard normal distribution to reflect the uncertain behavior of the resources. In general, the weighting factors are used to reflect and follow the strategy and

Results and Discussion
The high-level centralized control algorithm-based MPC defined in the prior sections is simulated and verified over a case study to prove its real application as well as to validate its performances considering several conditions. In this paper, it is supposed that the BIM includes renewable distributed generations, micro-CHP, ESD, electric and thermal loads, BEMS and an advanced metering infrastructure.
In this case study, the prediction and control horizons are both set equal to 24 h. Furthermore, the scheduling optimization problem has been resolved considering the receding horizon approach to take into account the intermittent character and dynamics of renewable resources and load. In addition, providing a route of the upcoming state and control variables satisfying the optimal functioning of the BIM is considered. The predictive model is applied over the prediction horizon considering new data. The expected renewable power output is modeled as the sum of deterministic part and a noise represented by the standard normal distribution to reflect the uncertain behavior of the resources. In general, the weighting factors are used to reflect and follow the strategy and objectives of the decision maker or users. In other word, the weighting factors define priorities in satisfying the different objectives (some time-conflicting). In this paper, we assumed the same priority, which means that the objectives should be satisfied considering the same priority.
The smart BIM includes a wind generator of 5 [kW] and a PV system of 1 [kW] including 4 × 250 [W] high efficiency polycrystalline solar PV modules. The deterministic renewable power generation is reported in Figure 4.  In this paper, it is assumed that the micro-CHP unit is devoted to maintaining the water storage heated through its thermal power output. The latter is set to feed the hot water demand and keep the building's desired temperature. Although, the electric power output that is defined as a fraction of the thermal power is considered to support the BIM in covering its electric load. We note that the thermal resistance of the building's shell affects strongly the operation of the micro-CHP unit. In this context, we considered six different building envelop materials with the aim to select optimal material minimizing the thermal power losses. The considered materials are: reinforced concrete, concrete, fire brick, clay, rock and wood; each one is characterized by its thermal conductivity. The thermal power losses of the building considering the six materials are shown in Figure 5. It can be seen that wood presents the best performance in term of minimizing the thermal power loss followed by clay and fire brick that showed similar behaviors. For the rest of the paper, the fire brick is chosen due to its good thermal proprieties as well as its large use in the north of Africa. In this paper, it is assumed that the micro-CHP unit is devoted to maintaining the water storage heated through its thermal power output. The latter is set to feed the hot water demand and keep the building's desired temperature. Although, the electric power output that is defined as a fraction of the thermal power is considered to support the BIM in covering its electric load. We note that the thermal resistance of the building's shell affects strongly the operation of the micro-CHP unit. In this context, we considered six different building envelop materials with the aim to select optimal material minimizing the thermal power losses. The considered materials are: reinforced concrete, concrete, fire brick, clay, rock and wood; each one is characterized by its thermal conductivity. The thermal power losses of the building considering the six materials are shown in Figure 5. It can be seen that wood presents the best performance in term of minimizing the thermal power loss followed by clay and fire brick that showed similar behaviors. For the rest of the paper, the fire brick is chosen due to its good thermal proprieties as well as its large use in the north of Africa. material minimizing the thermal power losses. The considered materials are: reinforced concrete, concrete, fire brick, clay, rock and wood; each one is characterized by its thermal conductivity. The thermal power losses of the building considering the six materials are shown in Figure 5. It can be seen that wood presents the best performance in term of minimizing the thermal power loss followed by clay and fire brick that showed similar behaviors. For the rest of the paper, the fire brick is chosen due to its good thermal proprieties as well as its large use in the north of Africa.  The time-varying power scheduling for the thermal power output of the micro-CHP unit as determined by the MPC algorithm is shown in Figure 6. It can be observed that the micro-CHP reached its maximum capacity only from 19:00 to 23:00; this is mostly for the reason that the operation of the unit tracks the temperature reference signal as well as the hot water demand defining the standard comfort of the residents. The proposed MPC model replies to the variation of the thermal loads and regulates the operation of the unit to track as the reference signal. The time-varying power scheduling for the thermal power output of the micro-CHP unit as determined by the MPC algorithm is shown in Figure 6. It can be observed that the micro-CHP reached its maximum capacity only from 19:00 to 23:00; this is mostly for the reason that the operation of the unit tracks the temperature reference signal as well as the hot water demand defining the standard comfort of the residents. The proposed MPC model replies to the variation of the thermal loads and regulates the operation of the unit to track as the reference signal. The dynamic state of the water storage temperature is described in Figure 7. It can be seen that the water temperature varies between 50 and 70 [°C], which define the comfort limits imposed by the occupants. This trend depends on the cold water temperature, outdoor temperature, as well as the comfort constraints imposed by the occupants. The dynamic state of the water storage temperature is described in Figure 7. It can be seen that the water temperature varies between 50 and 70 [ • C], which define the comfort limits imposed by the occupants. This trend depends on the cold water temperature, outdoor temperature, as well as the comfort constraints imposed by the occupants. The dynamic state of the water storage temperature is described in Figure 7. It can be seen that the water temperature varies between 50 and 70 [°C], which define the comfort limits imposed by the occupants. This trend depends on the cold water temperature, outdoor temperature, as well as the comfort constraints imposed by the occupants.  The time-varying state of the predictive scheduling of the building's temperature is shown in Figure 8. It can be seen that the desired temperature describing the comfort of the occupants is met except the intervals of [5 h, 8 h] and [19 h, 20 h]. We mention that initial temperature state of the building is 18 [ • C], which justify the progressive evolution of the temperature at the beginning. Concerning the two other intervals, they coincide with peaks defining high demand in hot water. Consequently, the micro-CHP unit must satisfy both constraints related to building temperature and hot water. However, the MPC-based temperature validates the efficiency of the developed control strategy to follow the reference signal. The time-varying state of the predictive scheduling of the building's temperature is shown in Figure 8. It can be seen that the desired temperature describing the comfort of the occupants is met except the intervals of [5 h, 8 h] and [19 h, 20 h]. We mention that initial temperature state of the building is 18 [°C], which justify the progressive evolution of the temperature at the beginning. Concerning the two other intervals, they coincide with peaks defining high demand in hot water. Consequently, the micro-CHP unit must satisfy both constraints related to building temperature and hot water. However, the MPC-based temperature validates the efficiency of the developed control strategy to follow the reference signal. The MPC-based optimal state of the ESD as determined by resolving the optimization model considering the receding horizon scheme is presented in Figure 9. It can be observed that the ESD compensate the intermittent character of the wind and solar energy productions, fulfilling the total or a fraction of the electric load. Besides, the figure reports a comparison between the optimal states of the ESD as determined by the receding algorithm and as calculated considering perfect predictions. The MPC-based optimal state of the ESD as determined by resolving the optimization model considering the receding horizon scheme is presented in Figure 9. It can be observed that the ESD compensate the intermittent character of the wind and solar energy productions, fulfilling the total or a fraction of the electric load. Besides, the figure reports a comparison between the optimal states of the ESD as determined by the receding algorithm and as calculated considering perfect predictions. The purpose is to measure the impacts of the prediction errors on the optimal scheduling of the BIM operation. The investigation of the figure shows that the precision of the predictions considerably affect the optimal results. The optimal scheduling of time-varying daily load satisfaction of the BIM is reported in Figure  10. The total electrical load has been satisfied mainly by the local energy production. The analysis of the results shows that 96% of the total electrical load has been fulfilled by the local production where 23% represents the total electric output of the micro-CHP and 73% is the renewable energy production coming directly from the renewable generators and/or discharged from the ESD. The optimal scheduling of time-varying daily load satisfaction of the BIM is reported in Figure 10. The total electrical load has been satisfied mainly by the local energy production. The analysis of the results shows that 96% of the total electrical load has been fulfilled by the local production where 23% represents the total electric output of the micro-CHP and 73% is the renewable energy production coming directly from the renewable generators and/or discharged from the ESD.
The deficit that represents only 4% is purchased from the EDN. We have clearly demonstrated that coupling microgrid with residential buildings could be potentially beneficial from both building decision makers and the main electric grid. In fact, adopting such approach by commercial and institutional buildings could decrease significantly their energy bill and reduce the pressure on the grid. We note that the results obtained are mainly affected by the climate conditions, availability of renewable resources, accuracy of predictions, comfort constraints imposed by the occupants, as well as operational constraints.
The dynamic variation of the optimal state of the energy storage system for five days is reported in Figure 11. The storage system shows similar trends with different rates compensating the variabilities and fluctuations of the renewable resources. The storage system tends to track the power load of the building ensuring the comfort preferences of the occupants. Furthermore, the energy storage system regulates its operation to ensure the power balance between production and demand. The operation of the energy storage system depends mainly on the power balance at the BIM level. The charging/discharging states during five days are expressed in Figure 12. It can be seen that the storage system is mostly set in charging mode during the day and set in discharging mode at night due to the high power demand. In general, the operation strategy is affected by variabilities of the power load and the renewable energy production of the microgrid. The optimal scheduling of time-varying daily load satisfaction of the BIM is reported in Figure  10. The total electrical load has been satisfied mainly by the local energy production. The analysis of the results shows that 96% of the total electrical load has been fulfilled by the local production where 23% represents the total electric output of the micro-CHP and 73% is the renewable energy production coming directly from the renewable generators and/or discharged from the ESD.  The deficit that represents only 4% is purchased from the EDN. We have clearly demonstrated that coupling microgrid with residential buildings could be potentially beneficial from both building decision makers and the main electric grid. In fact, adopting such approach by commercial and institutional buildings could decrease significantly their energy bill and reduce the pressure on the grid. We note that the results obtained are mainly affected by the climate conditions, availability of renewable resources, accuracy of predictions, comfort constraints imposed by the occupants, as well as operational constraints.
The dynamic variation of the optimal state of the energy storage system for five days is reported in Figure 11. The storage system shows similar trends with different rates compensating the variabilities and fluctuations of the renewable resources. The storage system tends to track the power load of the building ensuring the comfort preferences of the occupants. Furthermore, the energy storage system regulates its operation to ensure the power balance between production and demand. The operation of the energy storage system depends mainly on the power balance at the BIM level. The charging/discharging states during five days are expressed in Figure 12. It can be seen that the storage system is mostly set in charging mode during the day and set in discharging mode at night due to the high power demand. In general, the operation strategy is affected by variabilities of the power load and the renewable energy production of the microgrid. Figure 11. State of the energy storage system during five days of operation. Figure 11. State of the energy storage system during five days of operation. The operation of the micro-CHP is highly affected by the outdoor temperature. The time-varying thermal power output of the micro-CHP according to variation of the outside temperature is reported in Figure 13 for five days of operation. It can be seen that the micro-CHP responds actively to the variabilities of the outdoor temperature by regulating and adjusting the thermal power accordingly. As an example, during the first day, the micro-CHP is set to operate with the minimum power until 16:00, and then starts responding to the drop in outdoor temperature. We note that the operation of the micro-CHP is also affected by the occupants' preferences represented by the set-points.  The operation of the micro-CHP is highly affected by the outdoor temperature. The time-varying thermal power output of the micro-CHP according to variation of the outside temperature is reported in Figure 13 for five days of operation. It can be seen that the micro-CHP responds actively to the variabilities of the outdoor temperature by regulating and adjusting the thermal power accordingly. As an example, during the first day, the micro-CHP is set to operate with the minimum power until 16:00, and then starts responding to the drop in outdoor temperature. We note that the operation of the micro-CHP is also affected by the occupants' preferences represented by the set-points. The operation of the micro-CHP is highly affected by the outdoor temperature. The time-varying thermal power output of the micro-CHP according to variation of the outside temperature is reported in Figure 13 for five days of operation. It can be seen that the micro-CHP responds actively to the variabilities of the outdoor temperature by regulating and adjusting the thermal power accordingly. As an example, during the first day, the micro-CHP is set to operate with the minimum power until 16:00, and then starts responding to the drop in outdoor temperature. We note that the operation of the micro-CHP is also affected by the occupants' preferences represented by the set-points. Figure 13. Thermal power dynamics during five days. Figure 13. Thermal power dynamics during five days.
A comparison between the optimal temperature and the reference defining the comfort preferences of the occupants during five days is shown in Figure 14. We note that the initial starting indoor temperature is set to be 18 [ • C]. It can be seen that the thermal comfort of the occupants is completely satisfied during all the days. This result demonstrates the efficiency and performance of the proposed control algorithm in the optimization and the real-time management of the whole BIM.
Sustainability 2020, 12, x FOR PEER REVIEW 15 of 18 A comparison between the optimal temperature and the reference defining the comfort preferences of the occupants during five days is shown in Figure 14. We note that the initial starting indoor temperature is set to be 18 [°C]. It can be seen that the thermal comfort of the occupants is completely satisfied during all the days. This result demonstrates the efficiency and performance of the proposed control algorithm in the optimization and the real-time management of the whole BIM. Figure 14. Thermal comfort satisfaction during five days.

Conclusions
In this paper, the implementation of a multi-objective model predictive control MPC for a BIM has reached its objectives for optimizing both comfort of occupants in term of desired reference temperature, hot water and the electric load. Various methodologies in the literature presented complex frameworks, challenging to implement in practical cases, time-consuming, and computationally intensive or not appropriate for real-time implementations, or may generate suboptimal solutions. The strength of the proposed study can be summarized in providing a reduced and efficient predictive control strategy embedded in model predictive control to account for uncertainties of weather conditions and loads to optimally control a BIM. This paper aims to assess the value and utility of integrating the MPC multi-objective into a residential building through an electric and thermal optimization. A centralized control tool based on managing and controlling the renewable energies, energy storage, building material envelope, micro-CHP unit and the exchanged power with the main grid is tested. The main goal is to reduce significantly the energy bill, integrating the microgrid concept to building. The MPC resolved the optimization problem following the receding scheme, filled the electric need totally or in parts in renewable energies with less purchased power from the main grid. The total electrical load has been satisfied mainly by the local energy production in 96% including the CHP production and the renewable energies. The power purchased from the main grid was only 4% in peak load. The simulation results demonstrated clearly the efficiency of the MPC integrated to the building, taking advantages of the renewable energy sources by reducing the electric bill while ensuring the occupants' comfort in desired temperature and hot water. The results of simulating the BIM operation over five days show that the thermal comfort of the occupants is completely satisfied during the whole time horizon. The BIM covered, as an average,

Conclusions
In this paper, the implementation of a multi-objective model predictive control MPC for a BIM has reached its objectives for optimizing both comfort of occupants in term of desired reference temperature, hot water and the electric load. Various methodologies in the literature presented complex frameworks, challenging to implement in practical cases, time-consuming, and computationally intensive or not appropriate for real-time implementations, or may generate suboptimal solutions. The strength of the proposed study can be summarized in providing a reduced and efficient predictive control strategy embedded in model predictive control to account for uncertainties of weather conditions and loads to optimally control a BIM. This paper aims to assess the value and utility of integrating the MPC multi-objective into a residential building through an electric and thermal optimization. A centralized control tool based on managing and controlling the renewable energies, energy storage, building material envelope, micro-CHP unit and the exchanged power with the main grid is tested. The main goal is to reduce significantly the energy bill, integrating the microgrid concept to building. The MPC resolved the optimization problem following the receding scheme, filled the electric need totally or in parts in renewable energies with less purchased power from the main grid. The total electrical load has been satisfied mainly by the local energy production in 96% including the CHP production and the renewable energies. The power purchased from the main grid was only 4% in peak load. The simulation results demonstrated clearly the efficiency of the MPC integrated to the building, taking advantages of the renewable energy sources by reducing the electric bill while ensuring the occupants' comfort in desired temperature and hot water. The results of simulating the BIM operation over five days show that the thermal comfort of the occupants is completely satisfied during the whole time horizon. The BIM covered, as an average, about 87% of its power load, while, 13% is purchased from the utility. The results prove the ability of the proposed predictive model to cope with uncertainties and fluctuations of the renewable energy sources as well as the loads. Furthermore, the findings demonstrate the efficiency and performance of the proposed control algorithm in the optimization and the real-time management of the whole BIM. This real case can be generalized in a large-scale district to reduce the pressure on the electric grid and to enhance the penetration of renewable energy. In this case, the current problem formulation can be extended by adopting other control schemes and approaches like decentralized, team theory, multi-agent, and distributed control.  Acknowledgments: The publication of this article was funded by the Qatar National Library.

Conflicts of Interest:
The authors declare no conflict of interest.