scieee AI-readable full text Open interactive document viewer

Model predictive control for managing indoor air quality levels in buildings

Tarragona Roig, Joan,Gangolells Solanellas, Marta,Casals Casanova, Miquel

Abstract

In recent years, stricter regulations aimed at improving indoor air quality have led to increased energy consumption in ventilation systems. This is particularly noticeable in the service sector, where high occupancy requires frequent air renewal. Therefore, it is crucial to apply control methods in these buildings to ensure proper indoor air quality and comfortable temperatures at minimal energy consumption and cost. However, addressing these operational requirements demands the utilization of advanced control methods and the integration of renewable energy sources. In this context, this article aims to design a model predictive control capable of managing indoor air quality levels to ensure occupants’ comfort while minimizing operational costs. The novelty of this work lies in the development, for the first time, of a model predictive control that incorporates solar electricity production, changes in grid electricity prices, occupancy levels, and weather profiles. Additionally, several indoor CO2 concentration limits based on current regulations and building users’ activities were employed to evaluate the model performance. Results demonstrated that model predictive control could achieve economic savings of up to 15¿% when indoor CO2 concentration must be below 750¿ppm compared to binary control modulation with photovoltaic panels. Moreover, the model effectively shifted ventilation necessities to off-peak electricity hours and fully harnessed energy generated by photovoltaic panels. Consequently, the presented model predictive control exhibited promising performance for potential applications in service sector buildings.

Full text

Energy Reports 12 (2024) 787–797 2352-4847/© 2024 The Author(s). Published by Elsevier Ltd. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/bync-nd/4.0/). Research paper Model predictive control for managing indoor air quality levels in buildings Joan Tarragona * , Marta Gangolells, Miquel Casals Group of Construction Research and Innovation (GRIC), Universitat Polit` ecnica de Catalunya (UPC), C/ Colom 11, Ed. TR5, Terrassa, Barcelona 08222, Spain ARTICLE INFO Keywords: Indoor air quality Model predictive control HVAC systems Energy efficiency ABSTRACT In recent years, stricter regulations aimed at improving indoor air quality have led to increased energy consumption in ventilation systems. This is particularly noticeable in the service sector, where high occupancy requires frequent air renewal. Therefore, it is crucial to apply control methods in these buildings to ensure proper indoor air quality and comfortable temperatures at minimal energy consumption and cost. However, addressing these operational requirements demands the utilization of advanced control methods and the integration of renewable energy sources. In this context, this article aims to design a model predictive control capable of managing indoor air quality levels to ensure occupants’ comfort while minimizing operational costs. The novelty of this work lies in the development, for the first time, of a model predictive control that incorporates solar electricity production, changes in grid electricity prices, occupancy levels, and weather profiles. Additionally, several indoor CO 2 concentration limits based on current regulations and building users’ activities were employed to evaluate the model performance. Results demonstrated that model predictive control could achieve economic savings of up to 15 % when indoor CO 2 concentration must be below 750 ppm compared to binary control modulation with photovoltaic panels. Moreover, the model effectively shifted ventilation necessities to off-peak electricity hours and fully harnessed energy generated by photovoltaic panels. Consequently, the presented model predictive control exhibited promising performance for potential applications in service sector buildings. 1. Introduction The building sector is a major global energy consumer, accounting for roughly 30 % of global energy use and contributing 27 % of CO 2 emissions (International Energy Agency (IEA), 2022a). This significant energy demand has increased due to both population and number of constructions growth (International Energy Agency (IAE) (IAE), 2022). To address this, the European Union introduced the Energy Performance of Buildings Directive (The European Parliament and the Council of the European Union, 2021), regularly updated to reduce energy consumption while ensuring occupant comfort, quality of life, and indoor air quality (IAQ). The heating, ventilation, and air conditioning (HVAC) systems play a crucial role in maintaining healthy indoor conditions but are among the highest energy consumers in buildings, being in Europe, the responsible for about 60 % of final energy use in the sector (Gonz´ alez-Torres et al., 2022). Therefore, it is crucial to underscore the importance of analysing HVAC equipment operation, especially in tertiary sector buildings with recurrent occupancy patterns aligning with peak renewable energy hours (International Energy Agency (IEA) (IEA), 2022b). In tertiary sector buildings, space heating emerges as the primary energy consumer. This energy consumption is sensitive to air infiltrations in the building (J. Hu et al., 2023), particularly losses through ventilation, which account for approximately 30 % of this space heating energy (Liddament and Air Infiltration and Ventilation Centre., 1996) and contribute to amplify energy use of the sector (International Energy Agency (IEA), 2019). Additionally, since 2019, COVID-19 has intensified the focus on ventilation in tertiary buildings, due to increased risk of airborne transmission (Pollozhani et al., 2024; World Health Organisation (WHO), 2021). When analysing the energy usage of ventilation systems, it is important to note the impact of occupancy variability, as it directly affects the amount of air renewal required in the building. Using a constant air renewal mass flow without consider the occupancy variation can result in unnecessary higher energy costs (International Energy Agency (IEA), 2021). Therefore, it is clear that one of the crucial steps to reduce the cost of the ventilation systems operation lies in controlling the ventilation mass flowrates, according to the real building requirements (Song et al., 2022). So far, different conventional control strategies were implemented in mechanical ventilation systems to * Corresponding author. E-mail address: [email protected] (J. Tarragona). Contents lists available at ScienceDirect Energy Reports journal homepage: www.elsevier.com/locate/egyr https://doi.org/10.1016/j.egyr.2024.06.053 Received 28 February 2024; Received in revised form 12 May 2024; Accepted 21 June 2024 Energy Reports 12 (2024) 787–797 788 guarantee the IAQ of a building, while the energy efficiency of the HVAC system was improved (Y. Hu et al., 2023). In that sense, several researchers pointed out the crucial role of the occupancy profile when implementing control strategies to perform an optimum management of the HVAC equipment without compromising the number of air renovations per hour (Goyal et al., 2015, 2013; Kim et al., 2017; Kong et al., 2022; Piselli and Pisello, 2019). Following this idea, Kim et al. (Kim et al., 2018) reviewed different advanced control options, remarking the importance to focus the control on the occupants’ comfort and the IAQ during the HVAC operation. Ren and Cao (Ren and Cao, 2019) took a comparable approach, devising an artificial neural network control strategy grounded in a low-dimensional linear model. Their goal was to foster a healthy, energy-efficient indoor environment by employing a gradual HVAC control that prioritizes IAQ and thermal comfort. Also, Ren and Cao (Ren and Cao, 2020) went a step further and proposed an online control system that balanced the relationship between IAQ and energy efficiency in buildings with a real-time prediction model to predict indoor pollutant concentration and evaluate the building ventilation necessities. In that case, the system was tested in an experimental chamber and the results demonstrated that the proposed ventilation control system based on an artificial neural network algorithm, could effectively balance IAQ and energy efficiency in buildings. In general, the studied artificial neural network strategies performed good results, but it should be highlighted that the modelling and the resolution procedures required important computational effort, being a drawback for the strategy scalability to other buildings. To solve this computational barrier, studies such as Valladares et al. (Valladares et al., 2019) optimized the energy consumption of an HVAC system through a reinforcement learning algorithm. The aim of the study was also to ensure the proper comfort requirements and IAQ for occupants, but in this case the study was focused in another type of spaces such as a classroom and a laboratory. The results of the study encouraged more authors to continue applying reinforcement learning techniques to control HVAC systems. This step further was carried out by Yang et al. (Yang et al., 2020), who coupled an adaptive reinforcement learning algorithm to control an HVAC system of two testbeds. However, in order to gain speed in the computation, in this study the authors decided to join the designed reinforcement learning algorithm with a model predictive control (MPC). This contribution was crucial to discover the fast-solving capacity of MPC when controlling HVAC systems with the goal to maintain the proper IAQ and occupants’ comfort. The potential of MPC to reduce the energy cost while maintaining the IAQ and the thermal comfort in buildings was also highlighted by Yao and Shekhar (Yao and Shekhar, 2021), who analysed the application and modelling of MPC control schemes for efficient energy operations inside buildings and their HVAC systems. A variant of the MPC was assessed by Mei et al. (Mei et al., 2018), who programmed an MPC based on a hierarchical structure, trying to reduce even more the computational effort of the algorithm. A similar approach was used by Elnour et al. (Elnour et al., 2022), who analysed the effect of an MPC applied to the HVAC system of a sport facility. In terms of the building characteristics, this study was distinctive, since it explored the behaviour of MPC in a huge building, with a big amount of air to renovate, due to its high volume. However, the results confirmed that the control method was very effective on managing the HVAC equipment, reducing the energy consumption and maintaining the IAQ along all building activity time. This ability on regulating the IAQ through an MPC in big service buildings was also evaluated by Li et al. (Li et al., 2022), who focused their study on applying an MPC upon a multi-zone ventilation system to minimize the energy use while maintaining good comfort and IAQ. In light of the existing literature review, it can be concluded that MPC has the capacity and versatility to manage the IAQ in different spaces with varying CO 2 concentration limits, without increasing the computational requirements of the resolution process. Furthermore, beyond its application to buildings, MPC was also applied to control ventilation systems within other complex spaces. For instance, Vaccarini et al. (Vaccarini et al., 2016) used an MPC approach to control the IAQ of a subway station in Barcelona, achieving energy savings of 30 % compared to the case with a standard control. Thus, it is evident that over the past few years, the research community has devoted considerable effort to exploring the applicability of MPC in managing HVAC equipment. The main conclusions drawn from the presented state-of-the-art research are, first, that the MPC holds potential for substantial economic savings while ensuring optimal IAQ and thermal comfort. Secondly, it has exhibited excellent computational performance in various building types. Nevertheless, despite existing research in HVAC control systems, there is a lack of comprehensive models that integrate multiple factors such as solar electricity production, fluctuation in grid electricity prices, variable occupancy levels, and weather forecasts. The novelty of the investigation lies in bridging this gap by introducing an MPC tailored specifically to manage IAQ levels in tertiary-sector buildings under such multifaceted conditions, aiming to minimize the HVAC equipment operational cost. By incorporating these diverse variables into the control framework, the study aims to provide a Nomenclature E electrical energy, kWh V volume, m 3 T temperature, ºC cost electricity cost from the grid, € N number of time steps grid electricity grid CO 2 CO 2 concentration, ppm occupancy number of occupants inside the building ˙ m mass flow rate, kg/s A D body surface area, m 2 M metabolic activity, met RQ breathing ratio H height, m W weight, kg k number of the time step C e specific heat, J/kg⋅◦C A area, m 2 ON/OFF Boolean variable to activate and deactivate Greek Symbols Δt duration of each time step, s δ delta time, s ΔP pressure drop, Pa ε efficiency Abbreviations IEA International Energy Agency IAQ indoor air quality HVAC heating, ventilation, and air conditioning WHO World Health Organisation MPC model predictive control PV photovoltaic COP coefficient of performance SCIP Solving Constraint Integer Program HDD heating degree day IDA indoor air ASHRAE American Society of Heating, Refrigerating and Air- Conditioning Engineers J. Tarragona et al. Energy Reports 12 (2024) 787–797 789 more holistic and adaptive approach to HVAC management, which has not been previously explored. Moreover, the evaluation of the model’s performance across various indoor CO 2 concentration limits adds another dimension to the investigation, considering both regulatory requirements and the comfort and well-being of building occupants. Within this context, a sensitivity analysis regarding the optimum prediction horizon was conducted in response to potential fluctuations in the CO 2 generation and maximum indoor CO 2 concentrations. The effectiveness of this approach was assessed in terms of economic savings, by comparing the grid electricity consumption under the MPC with that under a conventional binary control modulation with photovoltaic (PV) panels. 2. Methodology In this section, an overview of the building systems, the proposed control algorithms, and the analysed case studies are described in detail. In Section 2.1, the HVAC equipment as well as its electrical sources are outlined. After that, in Section 2.2, the different developed control algorithms and their implementation for controlling the HVAC operation are presented. Finally, the case studies of this work are showcased in Section 2.3. 2.1. Description of the system The HVAC equipment was based on a central equipment, which transformed electricity into thermal energy to meet the heating demand of the building (Eheating), and it also operated the fan to renew the indoor space air when necessary (Efans). These energy fluxes depended on the building necessities. On one hand, concerning Efans, its value depended on the volume of CO 2 generated inside the building (VCO2). On the other hand, focusing on Eheating, the demand changed based on the heating requirements due to the building envelope (Eenvelope) and the thermal charges due to fan operation (Eventilation load). Finally, it is worth noting that the electricity used by the HVAC equipment was provided by two elements: connection to the grid (Egrid) and PV panels (EPV). The system was composed and connected as shown in Fig. 1. 2.1.1. Electricity grid The energy consumption coming from the connection to the electricity grid was the only input of the system that represented a cost. However, the price of the electricity was variable since it was considered a time-of-use tariff structure. The chosen billing was the two-period 2.0 DHA, in which the off-peak time was from 10 pm to 12 am and peak for the rest of the day. The hourly energy cost of the grid was exported directly from Red El´ ectrica de Espa˜ na, considering data of year 2023 (Red El´ ectrica Espa˜ nola, n.d.). 2.1.2. PV panels The PV panels were the other elements that provided electricity to the system, transforming the solar radiation in free electricity to operate the HVAC equipment. The investigation considered two monocrystalline PV panels, each with an area of 2.17 m 2 (JA Solar, n.d.). 2.1.3. HVAC equipment The HVAC equipment was responsible for maintaining indoor comfort conditions regarding both temperature and IAQ. To achieve that, the equipment was composed by two elements: an air handling unit that renewed the exhausted air with fresh air and an air-to-air heat pump unit (Daikin, 2023) to heat up the indoor air, depending on the energy requirements of the building. The heat pump possessed a coefficient of performance (COP) that was contingent upon the outdoor temperature, which its expression is outlined in Eq. (1). It is important to note that this calculation assumes average working conditions for the heat pump at 80 %: COP(k)=0.0003⋅T2 outdoor (k)+0.0817⋅Toutdoor (k)+3.7887 (1) where the variables that define the equation are the following: −Toutdoor is the outdoor air temperature at each time step. −k is the number of the time step. 2.2. Control algorithms description As previously stated, this paper aims to develop an MPC algorithm to manage HVAC equipment based on forecast weather data, grid electricity prices, and occupancy profiles. It also aims to compare the MPC performance against another control policy without data prediction. In both control policies, the system operation aims to minimize operational costs while maintaining comfort conditions. This section describes the development and implementation of each control policy. 2.2.1. Binary control modulation with PV The first approach for operating the HVAC equipment was a binary control modulation with PV, which was based on an ON/OFF rule with the possibility to take advantage of the energy produced by the PV panels. This control algorithm was used as a reference case for comparison with the MPC. The expression that determined the cost of the consumed energy can be seen in Eq. (2): fcost =∑ n k=0 Egrid (k)⋅costgrid (k)⋅Δt (2) where the variables that define the equation are the following: −fcost is the total cost of the electricity purchased from the grid. Fig. 1. Schematic layout of the system. J. Tarragona et al. Energy Reports 12 (2024) 787–797 790 −Egrid is the electricity needed from the grid at each time step. −costgrid is the electricity price from the grid at each time step. −Δt is the duration of each time step. −k is the number of the time step. Additionally, along the operation of this control method, the total electricity consumption coming from the grid was assessed by the expression stated in Eq. (3), which summed the operational consumption of the whole HVAC equipment at each time step, deducting the energy generated by the PV panels: Egrid =∑ n k=0 Eheating (k) COP(k) +Efans (k)−EPV (k)(3) where the variables that define the equation are the following: −Egrid is the electricity needed from the grid at each time step. −Eheating is the heating consumption required from the HVAC equipment at each time step. −COP is the coefficient of performance of the HVAC equipment when providing heating at each time step. −Efans is the energy required from the ventilation fans of the HVAC equipment at each time step. −EPV is the electricity supplied from the PV panels at each time step. −k is the number of the time step. 2.2.2. Model predictive control The second control algorithm developed to operate the HVAC equipment was based on MPC with system prediction at different horizons. MPC is essentially a control mechanism that optimizes the forecasted behaviour of the system based on its model knowledge. To do that, the MPC optimizes the decision-making process by formulating an optimization problem based on an objective function. This function incorporates system variables and constraints for a given prediction horizon. At each decision time step, this optimization problem is solved, resulting in a new system status. The new system status includes optimal control actions to be executed, and the prediction horizon is shifted forward by one step. When the system model is linear, the MPC problem can be solved as a quadratic problem or a linear problem with constraints. However, in many cases, the models involve more complex relationships, making such formulations impossible (Kirk, 2004; Rawlings and Mayne, 2009). The present paper proposes a model that falls into this category, due to the important variability of the building systems operation conditions. Therefore, in this context, MPC plays a crucial role in predicting and optimizing energy utilization and operating costs, since the control method has to consider various disturbances, such as changes in energy prices, occupancy levels, and weather profiles (Touretzky and Baldea, 2014). In this work, the goal of the MPC was to manage the HVAC equipment of the building, controlling both heating and ventilation. Fig. 2 depicts the operational scheme of the designed MPC algorithm, specifying all parameters, input variables, and optimized system responses. As it can be seen, at each time step, the MPC analysed the following input parameters: (i) the indoor and outdoor CO 2 level, (ii) the solar electricity production, (iii) the heating demand due to envelope infiltrations, (iv) the COP of the HVAC unit when producing heating, (v) the air renewal requirements due to the occupancy of the space, and (vi) the electricity price of the grid. Subsequently, the MPC controller examined the collected data and calculated future predictions to improve its response, based on the defined prediction horizon. The objective of the MPC, as outlined in Eq. (4), was to minimize electricity costs during the HVAC equipment operation: f=min∑ N k=0 Egrid(k)⋅costgrid(k)⋅δ (4) where the variables that define the equation are the following: −N is the total number of time steps analysed by the algorithm. −Egrid is the electricity needed from the grid at each time step. −costgrid is the electricity price from the grid at each time step. −δ is the value of time step of the input data. −k is the number of the time step. Moreover, the objective function was governed by specific system constraints (Eqs. (5)-(13)) that ensured the fulfilment of the building energy demand, the proper air renewal inside, and the stability of the control system: CO2(k=0)=CO2initial (5) Fig. 2. Input and output scheme of the MPC. J. Tarragona et al. Energy Reports 12 (2024) 787–797 791 VCO2(k)=0.00276⋅AD⋅M⋅RQ 0.23⋅RQ +0.77 (7) AD=0.202⋅H0.725⋅W0.425 (8) Efans (k)= ˙ mventilation (k)⋅ΔP ε fans ⋅δ (9) Eventilation load (k)=˙ mventilation (k)⋅Ce⋅(Tindoor (k)−Toutdoor (k))⋅(1− ε heat recovery)⋅δ (10) Eheating (k)=Eenvelope (k)+Eventilation load (k)(11) EPV (k)=Solarirradiance (k)⋅APV panels⋅ ε PV panels⋅δ (12) Egrid (k)+EPV (k)⋅ON/OFFPV(k)=Eheating (k) COP(k) +Efans (k)(13) where the variables that define the equations are the following: −CO2initial is the initial indoor CO 2 concentration. −CO2 is the indoor CO 2 concentration at each time step. −VCO2 is the individual CO 2 emissions per occupant at each time step. −occupancy is the number of occupants at each time step. −˙ mventilation is the mass flow rate for air ventilation at each time step. −CO2outdoor is the outdoor CO 2 concentration at each time step. −Volume indoor is the indoor volume of the studied space. −AD is the body surface area of the occupants. −M is the metabolic activity of the occupants. −RQ is the breathing ratio of the occupants. −H is the height of the occupants. −W is the weight of the occupants. −Efans is the energy needed from the ventilation fans at each time step. −ΔP is the pressure drop in the ventilation circuit. − ε fans is the efficiency of the fan. −Eventilation load is the thermal load due to ventilation use at each time step. −Ce is the specific heat of the air. −Tindoor is the indoor air temperature at each time step. −Toutdoor is the outdoor air temperature at each time step. − ε heat recovery is the efficiency of the heat recovery unit of the ventilation equipment. −Eheating is the energy needed from the heating system at each time step. −Eenvelope is the thermal load through the building envelope at each time step. −EPV is the electricity supplied from the PV panels. −Solarirradiance is the solar irradiance of the location at each time step. −APV panels is the area of the PV panels. − ε PV panels is the efficiency of the PV panels. −Egrid is the electricity needed from the grid at each time step. −ON/OFFPV is the Boolean control for activating the PV panels at each time step. −COP is the COP of the HVAC equipment when providing heating at each time step. −δ is the value of time step of the input data. −k is the number of the time step. It is worth noting that the use of a Boolean variable to activate the PV panels (ON/OFFPV), introduced a non-linear aspect to the problemsolving process. Therefore, the chosen approach to solve the problem was to convert each decision time step (k) into a mixed-integer nonlinear problem (MINLP). To accomplish this, the decision time step problems were formulated as MINLP instances using the ZIMPL language (Zuse Institut Mathematical Programming Language) (Koch, 2004) and solved with the SCIP solver (Solving Constraint Integer Program) (Achterberg, 2009; Vigerske and Gleixner, 2018). SCIP was selected for its fast-solving capability and adaptability in handling MINLP problems, as it is one of the top non-commercial solvers available (Kronqvist et al., 2019). The global MPC was implemented in Python (Python Software Foundation, n.d.), an open-source programming language, which involved incorporating the aforementioned steps as system calls. 2.3. Case studies In this subsection, a full description of the analysed case studies is given. First, a description of analysed indoor air quality levels, occupancy profiles, and outdoor climatic conditions is provided in point 2.3.1. Furthermore, the operational control settings implemented into the system operation are described in point 2.3.2. 2.3.1. Description of analysed indoor air quality, occupancy, and climatic conditions The building used in this study was based on an IFC model with a single zone and a flat roof type, aiming to run simulations on a prototype building similar to an experimental hut with this physical construction. In Fig. 3, a sketch of the building can be seen, showing the location of the windows (south oriented). Additionally, it is worth noting that the total area of the building is 130.1 m 2 . To obtain the HVAC demand, this building model was simulated with the EnergyPlus v22.1 software (Crawley et al., 2001) and the data obtained from this simulation was used to feed the analysis of the control strategies presented in Section 2.2. The internal gains contemplated were divided in three categories: lighting, other equipment such as computers, projectors, and printers and, finally, the occupancy, which varied depending on the hour. For the lightning, the considered internal gain ratio was 25 W/m 2 (Ministerio de Vivienda y Agenda Urbana, 2022), for the other equipment was 56 W/m 2 (Hendron and Engebrecht, 2010), and in the case of the occupancy, it was established a correlation of 2 m 2 /person (Ministerio de Fomento, 2019). The daily occupancy profile of the whole building can Fig. 3. Sketch of the simulated building. CO2(k)=CO2(k−1)+((VCO2(k−1)⋅occupancy(k−1))+(˙ mventilation (k−1)⋅(CO2outdoor (k)−CO2(k−1))))⋅δ Volume indoor (6) J. Tarragona et al. Energy Reports 12 (2024) 787–797 792 be seen in Fig. 4. Furthermore, the building was designed to be airtight, allowing for a comprehensive evaluation of the control strategies performance. This was achieved by ensuring that all air exchange occurred exclusively through the HVAC system, thereby eliminating any infiltration interruptions. During the occupied hours the indoor air temperature setpoint is set to 21 ◦C and in the unoccupied ones was decreased till 15 ºC. This thermostat configuration generated a heating demand in the building, since it was located in Terrassa (Spain), a temperate city with remarkable heating requirements. More detail about the weather conditions of Terrassa is provided in Table 1, where it can be seen the latitude, longitude, and elevation of the city, the annual heating degree days, the annual average temperature, and the annual average solar radiation (European Comission, n.d.; Huld et al., 2012). Moreover, it should be highlighted that an outdoor CO 2 concentration of 400 ppm was considered for that location (Gallego S´ anchez-Torija et al., 2022). Regarding the ventilation, in the air handling unit was considered a fan efficiency ( ε fans) of 75 % and the use of a heat recovery unit with an efficiency ( ε heat recovery) of 82 % (Daikin, 2018). Moreover, it was considered a pressure drop (Δp) of 124 Pa along the ventilation air ducts. With these operational conditions, the air mass flow rate of the system oscillated, depending on the ventilation requirements of the indoor spaces, which varied throughout the day according to the occupancy and, consequently, the CO 2 concentration inside. Specifically, in Spain, the regulation that determines the ventilation intensity is the Regulation for Thermal Installations of Buildings (RITE) (Ministerio de la Presidencia, 2007), which ensures that the welfare and hygiene needs of all building occupants are complied. In terms of ventilation, the RITE specifies four different indoor air (IDA) quality levels, depending on the activity of each building (Table 2). Additionally, in the last right column it is shown the maximum level of CO 2 that the regulation (Ministerio de la Presidencia, 2007) admits inside each occupied space. Therefore, the assessment of the IAQ of a determined space can be done through the monitoring of the indoor level of CO 2 , ensuring that its concentration is always below the stablished limit for each building activity. However, to follow this method it is needed to evaluate the CO 2 generation inside the building. To do that, it was considered the methodology provided by the American Society of Heating, Refrigerating and Air-Conditioning Engineers (ASHRAE), which established Eq. (7) in its Fundamentals Handbook (American Society of Heating, 2021), where a constant metabolic activity of the occupants of 1.2 was defined, meaning that their profiles correspond to a sedentary people (Persily and de Jonge, 2017). Furthermore, the value for RQ was set at a constant of 0.85, and the AD was determined using Eq. (8), obtaining a constant body surface area of 1.8 m 2 (International Organization for Standardization, 2021). Therefore, bearing in mind the evaluation process of the CO 2 production of the occupants (VCO2), along with the aforementioned assumptions, the calculated value used in the simulations conducted in this study was constant at 18.72 l/h per occupant. 2.3.2. Operational control settings To evaluate the impact of the MPC designed to control both the air handling unit and heat pump, various control scenarios were created. The aim of the assessment was to analyse the flexibility of the MPC to adapt its control decisions in different operational conditions, which depended on both the length of the prediction horizon and the limit of CO 2 allowed inside the building. The combination of these key parameters to run the simulations of this study was based on the values shown in Table 3. It should be mentioned the importance of assessing different prediction horizons, since it allowed to understand the impact and effectiveness of the MPC upon the cost reduction potential that can be achieved through its integration with the proposed HVAC system. On one hand, using short-term prediction horizons was evaluated the ability of the control method to adapt its decisions to fast fluctuations in the occupancy and comfort temperature behaviours that impact the ventilation and heating requirements. On the other hand, assessing long-term prediction horizons allowed to explore the potential of the MPC to operate with extend data periods such as daily both occupancy patterns and weather forecasts. Consequently, it is crucial to figure out which is the prediction horizon with the best trade-off between energy savings and occupant comfort when controlling the HVAC system of the building. Moreover, the other variable considered as an essential operational Fig. 4. Occupancy profile of the building. Table 1 Location and weather data of Terrassa (Spain). Latitude [decimal degrees] Longitude [decimal degrees] Elevation [m] Annual HDD [ºC⋅day/ year] Annual average temperature [ºC] Annual average solar radiation [W/m 2 ] 41.563 2.010 288 949 15.37 289 Table 2 Ventilation requirements in function of the building activity (Ministerio de la Presidencia, 2007). Air quality level Space type Ventilation ratio [l/s ⋅ person] Maximum level of CO 2 [ppm] IDA 1. Optimal Hospitals, laboratories, and nurseries 20 750 IDA 2. Good Offices, residences, museums, and classrooms 12.5 900 IDA 3. Medium Commercial buildings, cinemas, theatres, restaurants, bars, and gyms 8 1200 IDA 4. Low Others 5 1600 Table 3 Combination of the simulated scenarios. Variable Units Values Prediction horizon hours 2, 4, 8, 12, and 24 Limit of CO 2 ppm 750, 900, and 1200 J. Tarragona et al. Energy Reports 12 (2024) 787–797 793 control setting of the proposed MPC was the maximum concentration of CO 2 established inside the building. As it was detailed in Table 2, currently, the Spanish regulation (Reglamento de Instalaciones T´ ermicas en los Edificios (Real Decreto 1027/2007, de 20 de julio), 2007) specifies four different IAQ levels. Regarding these values, the present study focused the attention on the service buildings, which were within categories IDA 1, 2, and 3. Therefore, the limits of CO 2 settled for the analysis of the MPC operation were 750, 900, and 1200 ppm, since the IDA 4 category is not allowed in any building type by the regulation. The combination of different prediction horizons and maximum CO 2 levels provided another insight to evaluate both the flexibility and the robustness of the MPC. Finally, it is worth noting that the simulations of this study were conducted for the period from January 1st to March 31st, 2023, since the primary objective was to analyse the performance of the MPC during the winter season. 3. Results and discussion In this section the simulation results are presented and discussed. Firstly, the operational settings of the created MPC are discussed in Section 3.1. Afterwards, in Section 3.2, the results of the MPC using different CO 2 concentration limits are presented. Lastly, the impact of the building occupancy profile upon the performance of the MPC is explained in Section 3.3. 3.1. Model predictive control operation assessment To evaluate the impact of the MPC on the capacity to reduce operation system costs, all combinations described in Table 3 were simulated. This was done in order to assess the trade-off between the efficacy of the MPC with varying prediction horizons and the impact of the three concentration limits of CO 2 allowed by Spanish regulation (Reglamento de Instalaciones T´ ermicas en los Edificios (Real Decreto 1027/2007, de 20 de julio), 2007). The results of this analysis are shown in Fig. 5, which illustrates the cost reduction achieved using MPC compared to the binary control modulation with PV method. As it can be seen, the longer the prediction horizon, the greater the cost reduction achieved by the MPC. Additionally, the results also showed an important sensitivity to the IAQ level, since the cost reduction obtained with the IDA 1 concentration rate was more than 2.5 times the one obtained with IDA 2 limit. Similarly, the same tendency was observed between the IAQ levels IDA 2 and IDA 3, where the cost reduction obtained through IDA 2 was around 1.5 times higher in almost all the prediction horizon cases. This important fluctuation in the cost reduction among the three IAQ levels was based on the ventilation intensity used in each case. The stricter IAQ requirements of IDA 1 forced the ventilation system to operate more hours than in the other two scenarios, increasing the possibilities of the MPC to optimize a higher amount of operation hours. However, although this high ventilation demand increased the cost reduction, it decreased the importance of using long prediction horizon. The biggest cost reduction with the IDA 1 was obtained with a prediction horizon of 4 h, with a cost reduction of 15 % in comparison with the binary control modulation with PV case. Therefore, for that IDA 1 scenario the prediction horizons of 8, 12, and 24 h did not provide any additional benefit, since they achieved the same cost reduction percentage. This happened due to the lack of flexibility given by an IAQ level that required less than 750 ppm inside the studied building. Conversely, an increase in flexibility was observed with the utilization of IDA 2 and IDA 3 concentration levels, where the significance of the horizon length became more pronounced. Referring to Fig. 5, it is evident that for both IAQ levels, the optimal prediction horizon for achieving cost reduction was 12 h, with the MPC yielding approximately a 5 % reduction in costs. This highlights that a 24-h prediction horizon was unnecessary as it yielded the same cost reduction but required higher computational effort. Thus, the impact of the prediction horizon should be emphasized, particularly when IAQ restrictions are less stringent, enabling the MPC to leverage flexibility to capitalize on both PV panel energy and off-peak electricity prices. Based on the results obtained in this analysis, a prediction horizon of 12 h was selected as the MPC operation setting for the present study. While it wasn’t necessary to run simulations with this length in the IDA 1 scenario, this choice was made for two reasons: the requirement of this prediction horizon to leverage the system flexibility for IDA 2 and IDA 3 scenarios, and the high speed of the system during each iteration calculation, resulting in insignificant computational penalties for IDA 1. 3.2. Impact of the CO 2 concentration limit To delve deeper and analyse the effectiveness of coupling the MPC with an HVAC system aimed at ensuring proper IAQ at minimal cost, simulations were conducted for various IAQ levels, employing a prediction horizon of 12 h. The first approach was carried out with the IDA 1 category, meaning that the CO 2 level inside the building was limited at 750 ppm. To analyse the performance of the MPC, four representative winter days of January were selected, since it was the coldest month in the studied location and, hence, the scenario with the highest expenditure in heating and ventilation. The results of this simulation are depicted in Fig. 6, where the time resolution is 1 h. As it can be seen, in the upper part of the graph it is illustrated in blue the CO 2 evolution and in red the ventilation mass flow rate to control the IAQ. In this case, due to the low flexibility allowed by the high ventilation requirements, the pattern followed by the ventilation flow rate was very similar with the building occupancy profile, which is shown in the second plot. Furthermore, in the third plot, data regarding the electricity supplied to the HVAC equipment can be observed. The energy provided by the grid is depicted in blue, while the energy provided by the PV panels is depicted in orange. Additionally, the evolution of the grid electricity price, which follows a time-of-use tariff structure, is illustrated in red in this plot. These electricity supply profiles are related to the data given in the fourth plot, which shows the thermal demand of the building. As it can be seen, this thermal demand depended either on the heating load due to the building envelope (red regions) or on the heating load generated by the operation of the ventilation system (blue regions). Therefore, by paying attention to the relation between the third and fourth plots, it can be observed that the MPC utilized only the essential amount of energy during the on-peak electricity period, leveraging the energy provided by the PV panels. However, the high occupancy ratio, coupled with the aforementioned requirement for a low level of CO 2 indoors, diminished the effectiveness of the MPC in terms of proactive action. Fig. 5. Cost reduction obtained with the MPC depending on the prediction horizon and the IAQ. J. Tarragona et al. Energy Reports 12 (2024) 787–797 794 Regarding the flexibility of MPC operation with different CO 2 levels inside the building, Fig. 7 depicts the same four representative days with a CO 2 limit of 900 ppm. The first notable difference is evident in the relationship between CO 2 evolution, building occupancy profile, and electricity supply plots. In contrast to the behaviour shown in Fig. 6, in this case, the ventilation flow rate did not precisely mirror the building occupancy profile, exhibiting specific peaks at certain hours. Focusing on these peaks, in January 23th can be noticed that the ventilation system was switched on before the arrival of the people in the building, since the electricity price was in the off-peak period. Similarly, during Fig. 6. Representative four days with a CO 2 concentration limit of 750 ppm. Fig. 7. Representative four days with a CO 2 concentration limit of 900 ppm. J. Tarragona et al. Energy Reports 12 (2024) 787–797 795 the period without occupancy before arriving in January 24th, the MPC effectively ventilated the space beforehand, taking advantage of the low electricity price and maintaining this clean air till the building was occupied. Paying attention to the electricity supply plot it can be observed that almost all the electricity supply was carried out through the PV panels or with electricity during the off-peak period. Regarding the thermal demand of the building, in the fourth plot, it can be seen that the impact of the ventilation system on the heating requirements of the building was smaller than that shown in Fig. 6, due to the higher concentration of CO 2 allowed inside. Finally, a last scenario was considered in the assessment of the impact of the CO 2 concentration limit. In this case, the same four representative winter days were simulated with a concentration limit of 1200 ppm of CO 2 , and the results are shown in Fig. 8. As it can be observed in the first plot, the CO 2 concentration range was wider than in the other two scenarios. These operating conditions provided MPC with the opportunity to manage the ventilation system with greater versatility. This is evident in the disparity between the ventilation flow rate and the building occupancy profiles. While in scenarios with 750 ppm (Fig. 6) and 900 ppm (Fig. 7), the ventilation flow rate exhibited a very similar trend to the building occupancy, in this scenario, the difference between them altered, owing to the ability to increase the CO 2 concentration to higher levels. Thus, it is clear that in this case, the flexibility of the system was higher, and the MPC controller took advantage of that during the management of the ventilation system. Moreover, analysing the third plot, it can be observed that during the on-peak period, the system used only energy from PV panels, avoiding the most expensive electricity hours each day and demonstrating its ability to found out the best consumption decision at every time step. Furthermore, in the fourth plot, it is evident that the ventilation costs for the building’s thermal requirements were significantly lower compared to other scenarios, enhancing the system’s capacity to optimize energy consumption during both off-peak periods and PV production times. 3.3. Impact of the occupancy profile To explore in-depth and evaluate the benefits of utilizing an MPC to manage a ventilation system, the effect of varying building occupancy profiles on MPC operation was studied. The selection of the occupancy profile for this assessment was determined as it is a key variable affecting ventilation system activity. Since people are the source of indoor CO 2 , their occupancy directly impacts the system’s operation. In the scenarios presented in Section 3.2, the occupancy profile followed the same pattern every day. Hence, to analyse the robustness of the designed MPC, it was considered crucial to explore the sensitivity of the MPC operation towards a heterogeneous occupancy schedule with constant inputs and outputs of people in the building. The simulations conducted to carry out the study were executed with a prediction horizon of 12 h and a CO 2 concentration limit of 1200 ppm. The results obtained are depicted in Fig. 9, highlighting January 26th and 27th as the days exhibiting occupancy variation. As evident, these two days experienced fluctuating occupancy activity with numerous spikes throughout the day, contrasting with January 25th and 28th, which maintained the homogeneous pattern observed throughout the study period. Considering the response of the MPC, it can be observed that the ventilation flow rate profile shown in the first plot followed a similar shape to that of the building’s occupancy, as depicted in the second plot. This behaviour happened in both heterogeneous and homogeneous occupancy days, meaning that the controller acted with the same robustness in both situations. Furthermore, another demonstration of the MPC’s stability was its capability to capitalize on certain time intervals to lower energy costs on both types of days. For example, if we examine January 25th, it becomes evident that prior to entering the peak period, the MPC decreased the CO 2 concentration from 1200 ppm to 700 ppm, despite a decrease in building occupancy from 66 to 33 people within the subsequent hour. Consequently, the control method exhibited the ability to anticipate and optimize energy costs associated with ventilation system operation. Likewise, this capacity was demonstrated in January 27th. Despite the day exhibiting a variable occupancy profile, the MPC Fig. 8. Representative four days with a CO 2 concentration limit of 1200 ppm. J. Tarragona et al.