Microsoft Word - PRES22_0064.docx DOI: 10.3303/CET2294083 Paper Received: 21 May 2022; Revised: 23 July 2022; Accepted: 28 July 2022 Please cite this article as: Chen W.-H., You F., 2022, Building Climate Control with Hybrid Renewable Energy Systems Using Data-Driven Robust Model Predictive Control, Chemical Engineering Transactions, 94, 499-504 DOI:10.3303/CET2294083 A publication of CHEMICAL ENGINEERING TRANSACTIONS VOL. 94, 2022 The Italian Association of Chemical Engineering Online at www.cetjournal.it Guest Editors: Petar S. Varbanov, Yee Van Fan, Jiří J. Klemeš, Sandro Nižetić Copyright © 2022, AIDIC Servizi S.r.l. ISBN 978-88-95608-93-8; ISSN 2283-9216 Building Climate Control with Hybrid Renewable Energy Systems Using Data-Driven Robust Model Predictive Control Wei-Han Chen*, Fengqi You Cornell University, Ithaca, New York, 14853, USA wc593@cornell.edu While the implementation of renewable energy systems and model predictive control (MPC) could reduce non- renewable energy consumption, one challenge to building climate control using MPC is the weather forecast uncertainty. In this work, we propose a data-driven robust model predictive control (DDRMPC) framework to address building climate control with renewable hybrid energy systems under weather forecast uncertainty. The control and energy system configurations include heating, ventilation, air conditioning, geothermal heat pump, photovoltaic panel, and electricity storage battery. Historical weather forecast and measurement data are gathered from the weather station to identify the forecast errors and for the use of uncertainty set construction. The data-driven uncertainty sets are constructed with multiple machine learning techniques, including principal component analysis (PCA) with kernel density estimation (KDE), K-means clustering coupled with PCA and KDE, and Dirichlet process mixture model (DPMM). Lastly, a data-driven robust optimization problem is developed to obtain the optimal control inputs for a building with renewable energy systems. A case study on controlling a building with renewable energy systems located on the Cornell University campus is used to demonstrate the advantages of the proposed DDRMPC framework. 1. Introduction Building controls are becoming more complicated nowadays because in addition to traditional actuators such as lighting and heating, ventilation, and air conditioning (HVAC), building energy systems must take into account multiple modern technologies, including energy storage, photovoltaic (PV) technologies, geothermal heat pumps, and more (Li et al., 2014). In a hybrid energy system, renewable energy sources are utilized such as geothermal energy and solar energy (Tian et al., 2022). Since the soil temperature is nearly constant under sufficient depth, geothermal energy can heat the building in winter and cool down the building in summer (Self et al., 2013). Solar energy can be utilized through PV panels and can be stored in battery systems (Ogunjuyigbe et al., 2016). The electricity generated from solar energy can then be used for lighting and heating. In addition, the solar energy can heat water in the storage tank directly for daily hot water demand in the building. By adopting the hybrid energy system, energy costs can be significantly reduced. Model predictive control has been explored to improve building control performance (Morari and Lee, 1999). Because the building climate is a multi-input multi-output (MIMO) system, MPC has advantages over other classical control methods to gain the optimal control inputs for multiple control actuators. In addition, the information in the weather forecast can be easily incorporated into the MPC framework to help reduce the total energy cost (Chen et al., 2021). Although MPC has advantages over classical control methods, the uncertainty of weather forecast errors could lead to violations of system state constraints and would cause discomfort to occupants in the building. On the other hand, robust MPC (RMPC) can be employed to deal with the uncertainty of disturbances, which are weather forecast errors in the context of building climate control (Bemporad and Morari, 1999). RMPC could protect the system states from violating the constraints when uncertainty is bounded (Chen et al., 2018). Although RMPC could protect the indoor climate from becoming uncomfortable to occupants, it may lead to over-conservative results (Chen et al., 2022). To reduce the conservatism of RMPC, data-driven robust optimization that captures the high-density region of uncertainty data in decision-making is a popular approach for monitoring, control, and optimization of industrial processes (Shang et al., 2019). Data- 499 driven RMPC (DDRMPC) adopts machine learning techniques or statistical hypothesis tests to construct uncertainty sets that capture high-density regions of the uncertain forecast errors from historical weather data (Shang and You, 2019). Therefore, DDRMPC is an appropriate approach to ensure building climate by taking account of uncertainties within weather forecast errors. The objective of this work is to develop a DDRMPC framework for building climate control with renewable hybrid energy systems that can (a) predict the future building climate through a dynamic model; (b) simultaneously control multiple system states of building indoor climate (i.e., temperature, humidity, and predicted mean value (PMV) index) to minimize the total control cost and to ensure thermal comforts for occupants.; (c) integrate hybrid energy system to fully utilize renewable energy sources; (d) adopt machine learning techniques to address uncertainties of weather forecast errors and ensure building climates within comfortable range. 2. Data-driven robust model predictive control framework 2.1 Dynamic model formulations for temperature, humidity, and PMV index model The nonlinear dynamic models of the building climate and sustainable energy systems, including temperature, relative humidity, thermal comfort, earth heating sources, PV panels, are first constructed using first-principal equations. An indoor air temperature dynamic model is required in the framework to control the indoor temperature better. Building thermodynamic models are often developed as a resistance-capacitance model, where building components are viewed as resistances and capacitances. In this work, we employ the Building Resistance-Capacitance Modeling (BRCM) MATLAB Toolbox to develop the dynamic model for building indoor temperatures (Sturzenegger et al., 2016). The BRCM Toolbox generates the system dynamics tailored to the MPC framework through building geometry, structure, and materials. The system dynamics are given by: , 1 1 , ,( ) u k k u k k vu i k Tu i i i k n v kT AT B u B v B v B T u       (1) where Tk denotes the temperatures of rooms or wall/floor/ceiling, uk the inputs, and vk the predicted disturbances at time step k. A, Bu, Bv, Bvu,i, and Bxu,i are matrices of appropriate sizes. The humidity inside the building can be modeled by differential equations. The absolute humidity is first modeled by using the mass balance equation. The relative humidity is then calculated from absolute humidity and building indoor temperature. The mass balance equation of water, including the net flow from ventilation, respiration of occupants, and the humidifier, is shown as, d d m i ven res hutV h m m m t     (2) where ih is the absolute humidity, ventm is the water net flow from ventilation, resm is the water net flow from the respiration of the occupants, and humm is the water net flow from the humidifier system. The absolute humidity model can then be converted into relative humidity using the equation as follows, ) 100 0.611 ( i i sat i h P H p T  (3) where iH is the relative humidity, P is the atmospheric pressure, and satp is the saturated atmospheric pressure. Eq(3) shows the dependence of the temperature and humidity models. Although some climate control studies evaluate thermal comfort only by temperature, occupants’ actual thermal comfort condition can be better gauged using the PMV index. PMV index serves better by calculating occupants’ real feelings through the energy balance between the environment and occupants’ bodies. The factors considered in the PMV index include indoor temperature, indoor relative humidity, air velocity, mean radiant temperature, clothing insulation, and metabolic rate (Standard ASHRAE, 2010). The PMV index can be estimated by (Yang et al., 2018): ( )bM diffPMV ae c Q  (4) where M is the metabolic rate of a human being and Qdiff is the difference between the internal heat production and loss that occurs in a human body, and the value of coefficients a, b, and c, can be found in ISO 7730 by International Standards Organization (1994). DDRMPC is used to control the building climate using renewable energy sources in this work. The state-space model, constraints, and data-driven uncertainty sets are the most important components in DDRMPC framework and are discussed in the following subsections. 500 Due to its simplicity, the Euler method is adopted to discretize the building climate dynamic models shown in Section 2 (Butcher, 2016). The nonlinear system model can then be linearized and expressed as the following: 0 u v wx   x A B u B v B w (5) where system states x include building indoor air temperature, relative humidity, and thermal comfort. Control inputs u consist of HVAC, geothermal heat pump, and electricity storage battery. Forecasted disturbances v contain ambient temperature, ambient relative humidity, and solar radiation. w includes forecast errors of ambient temperature, solar radiation, and ambient humidity. x0 is the initial system states. The constraints are defined for control inputs and system states throughout the prediction horizon H. The compact form of the system states and control inputs can be shown as , x x u u G x g G u g (6) where Gx, Gu, gx, and gu help define the compact form of system states and control inputs constraints. 2.2 Clustering based uncertainty set construction Clustering the uncertainty data has been found useful when the data has disjoint-data structure (Zhao and You, 2022), which is the case of forecast errors (Fay and Ringwood, 2010). A classic yet powerful clustering method is K-means clustering (Hartigan and Wong, 1979). The forecast error data w are first scaled to zero-mean w0. The K-means algorithm clusters the data into groups by minimizing the sum of intra-cluster variances. Then principal component analysis (PCA) with kernel density estimation (KDE) is adopted to capture high-density regions of the uncertain forecast errors from historical weather data (Hu et al., 2022). Fist, the sample covariance matrix S is given by: 0 0 1 1 T N   S w w (7) We obtain TS PΛP by adopting eigenvalue decomposition. The square matrix 1[ ,..., ]mP p p contains all the m eigenvectors and 1diag{ ,..., }m Λ represents a diagonal matrix containing all the eigenvalues. By adopting the KDE method to the matrix (1) ( )1[ ,..., ]k N kT t t where Tk is the matrix that consists of the projection of uncertainty data sample onto the k-th principal component, distributional information along the k-th principal component can be extracted. Let kξ denotes the latent uncertainty along the k-th principal component.  ( )ˆ kKDE kf ξ be the estimated probability density function for kξ , which is shown as    ( )( ) 1 1ˆ ,h N k KDE k i i k kf KN t   ξ ξ (8) where  ( )ˆ kKDE kf ξ is the estimated probability density function for kξ and Kh denotes a Gaussian kernel with a bandwidth h (Shang et al., 2017).  ( )ˆ kKDE kF ξ the cumulative density function of latent uncertainty kξ . The quantile function is ,     ( ) 1 ( )ˆ ˆm n |i ki kKDE K E kDF FR   ξ ξ (9) where  ( )ˆ kKDE kF ξ is the cumulative density function of latent uncertainty kξ , and  is the determined quantile (Ning et al., 2018). The quantile function facilitates acquiring the confidence interval of latent uncertainty for a specific confidence level. Based on the correlations and distributional information learned from uncertainty data, the data-driven uncertainty set by using PCA and KDE is shown as:           (1) 1 ( ) 1 (1) 1 0 ( ) 1 , , , ˆ ˆ,..., ˆ ˆ,...1 , , 1 T KM PK T m KDE KDE T m KDE KDE D z F F z z z z z F F z z                                                     μ ξw P 0 1 1 ξ ξ 1 w ξ ξ ξ  (10) 501 where DKM-PK is the data-driven uncertainty set constructed by PCA and KDE approach for the weather forecast errors. The data-driven uncertainty set is now ready to be implemented in the proposed PKDDRMPC framework. 2.3 Dirichlet process mixture models uncertainty set construction Besides the PCA with KDE approach, another effective machine learning technique is Dirichlet process mixture model (DPMM) (Ning et al., 2019). Unlike other machine learning methods, such as Gaussian mixture model and K-means, the DPMM can determine the number of clusters systematically and automatically rather than specifying this number a priori (Ning et al., 2017). The Dirichlet process is a distribution on distributions. A random draw from a Dirichlet process, that is, DP(α, F0), is a distribution F. The uncertainty set can then be constructed using variational inference algorithm and can be expressed as the following equation:  1/ 2 11,, DPMMD s     μ ψw w z z z  (11) where μ, s and ψ are the inference results, Λ is the scaling factor, z denotes the primitive uncertainties, and  is the uncertainty budget. 2.4 Data-driven robust optimization in DDRMPC framework In order to ensure the tractability of the DDRMPC problem, affine disturbance feedback (ADF) policy is adopted, and control input uk is parameterized according to the past disturbances as follows (Goulart et al., 2006),  u h Mw (12) where M and h become decision variables should be solved to determine the control inputs. The original intractable optimization problem can now be solved by an off-the-shelf optimization solver to obtain the approximate solution, after parameterizing control input (Goulart et al., 2006). The corresponding soft-constrained MPC is formulated as, , , 0 0 min s.t. ( ) , , T x u v u w x u u T x D D                   M h ε g ε Sεcc h G A B h B v B M B w w G Mw h g ε ε w (13) where cc represents a vector that specifies the cost coefficients of different control actuators, S is the constraint violation penalty weight matrix, and ε is a slack variable vector for system state constraints (Lu et al., 2020). The receding horizon approach is adopted in this sustainable building climate control framework using PCA and KDE based DDRMPC (PKDDRMPC), K-means clustering coupled with PCA and KDE based DDRMPC (KM- PKDDRMPC) and Dirichlet process mixture model DDRMPC (DPMMRMPC). At the beginning of each time step, the data of current system states and the forecasted weather disturbances are gathered. The data-driven robust optimization problem in Eq(14) can be solved based on the information of current system states and weather disturbances, given by x0 and v, to obtain the optimal control inputs (Zhao et al., 2018). The first control input of the horizon is then implemented for the current time step, while the rest control inputs are discarded (Zhao and You, 2021). In the next time step, the same process is repeated, starting from collecting the data of current system states and the forecasted weather disturbances. 3. Case study In this work, a building on the Cornell University campus in Ithaca, New York, is simulated for closed-loop thermal comfort control under the PKDDRMPC, KM-PKDDRMPC and DPMMRMPC control framework using renewable energy sources. The building has three floors in total with two floors above the ground. The dimension of this building is 43.28 m × 20.38 m (Tian et al., 2019). The system states controlled in this work is thermal comfort, a combination of temperature and humidity. Ambient temperature, relative humidity, and solar radiation are considered disturbances. The simulation is performed for one week during January 1-7, 2020. The weather forecast data from January 1-7, 2020 are collected for the simulations. Figure 1 shows the profiles during January 1-7, 2020 under PKDDRMPC, KM-DDRMPC, and DPMMRMPC frameworks. Figure 1(a) shows the temperature profiles. Due to the cold weather in winter, heat pumps operate most of the time to heat the building’s indoor environment. Since PMV index is the actual controlled variable instead of temperature, there are no maximum and minimum constraints on temperatures. The temperature profiles throughout the three uncertainty sets are still maintained within a small region. Figure 1(b) shows the 502 relative humidity. As the contribution of humidity to PMV index is not as large as temperature, the fluctuations of humidity are larger than temperature. However, the PMV index can still be controlled as shown in Table 1. Table 1 presents the control performances in terms of PMV index, electricity cost, and violation percentage under PKDDRMPC, KM-PKDDRMPC, and DPMMRMPC frameworks. The lower and upper bounds are set as -0.5 and 0.5, respectively. When the PMV index is less than -0.5, the climate is too cold for the occupants. The PMV indices are mainly maintained at the lower bound for both frameworks. Constraint violations occur occasionally due to the slight chances of forecast errors not within the constructed uncertainty sets. While both approaches avoid the constraint violation during most of the time, the proposed KM-PKDDRMPC still performs better than PKDDRMPC with fewer constraint violations. In addition, KM-PKDDRMPC results in 2.2% less electricity cost than PKDDRMPC. Less electricity cost and fewer constraint violations are due to the K-means clustering, which better captures the shape of uncertainty data. DPMMRMPC has similar result to KM- PKDDRMPC with slightly higher electricity cost and the same violation percentage. The advantage of the proposed KM-PKDDRMPC is demonstrated. Figure 1: The indoor climate profiles of the sustainable building on the Cornell University campus with renewable energy systems during January 1-7, 2020 comparing PKDDRMPC, KM-PKDDRMPC, and DPMMRMPC (left) for temperature; (right) for relative humidity Table 1: Control performances under PKDDRMPC, KM-PKDDRMPC, and DPMMRMPC on January 1-7, 2020 Control Strategies PKDDRMPC KM-PKDDRMPC DPMMRMPC PMV Index [min, mean, max] [-0.527, -0.413, -0.298] [-0.541, -0.421, -0.300] [-0.513, -0.412, -0.297] Electricity cost ($) 268.5 262.7 263.0 Violation percentage (%) 0.60 0.30 0.30 4. Conclusions We proposed a DDRMPC framework for building climate control with renewable hybrid energy systems to minimize the total control cost and to maintain thermal for occupants. The adoption of K-means clustering coupled with PCA and KDE and DPMM approaches can better capture the shape of the high-density region of the forecast error data. PV panels and earth source heating are utilized to reduce the electricity cost. A case study of controlling the PMV index of a building on the Cornell campus is presented. The results showed that the proposed framework could minimize total control cost and constraint violation for PMV index. The advantage of the KM-PKDDRMPC framework is shown with minor constraint violation and 2% less energy use. References Bemporad A., Morari M., 1999, Robust model predictive control: A survey, Robustness in Identification and Control, Springer, London, 207-226. Butcher J.C., 2016, Numerical Methods for Ordinary Differential Equations, John Wiley & Sons, Chichester, UK. Chen L., Du S., He Y., Liang M., 2018, Robust model predictive control for greenhouse temperature based on particle swarm optimization, Information Processing in Agriculture, 5(3), 329-338. Chen W.-H., Shang C., Zhu S., et al., 2021, Data-driven robust model predictive control framework for stem water potential regulation and irrigation in water management, Control Engineering Practice, 113, 104841. Chen W., You F., 2021, Smart greenhouse control under harsh climate conditions based on data-driven robust model predictive control with principal component analysis and kernel density estimation, Journal of Process Control, 107, 103-113. 503 Chen W., 2022, Semiclosed Greenhouse Climate Control Under Uncertainty via Machine Learning and Data- Driven Robust Model Predictive Control, IEEE Transactions on Control Systems Technology, 30, 1186-1197. Chen W., Mattson N.S., et al., 2022, Intelligent control and energy optimization in controlled environment agriculture via nonlinear model predictive control of semi-closed greenhouse, Applied Energy, 320, 119334. Blei, D., Jordan M.I., 2006, Variational inference for Dirichlet process mixtures, Bayesian Analysis, 1, 121. Fay D., Ringwood J.V., 2010, On the influence of weather forecast errors in short-term load forecasting models, IEEE Transactions on Power Systems, 25(3), 1751-1758. Goulart P.J., Kerrigan E.C., Maciejowski J.M., 2006, Optimization over state feedback policies for robust control with constraints, Automatica, 42(4), 523-533. Hartigan J.A., Wong M.A., 1979, Algorithm AS 136: A k-means clustering algorithm, Journal of the Royal Statistical Society, Series C (Applied Statistics), 28(1), 100-108. Hu G., You F., 2022, Renewable energy-powered semi-closed greenhouse for sustainable crop production using model predictive control and machine learning for energy management, Renewable & Sustainable Energy Reviews, DOI: 10.1016/j.rser.2022.112790 Li X., Wen J., 2014, Review of building energy modeling for control and operation. Renewable and Sustainable Energy Reviews, 37, 517-537. Lu S., Lee J.H., 2020, Soft-constrained model predictive control based on data-driven distributionally robust optimization, AIChE Journal, 66, e16546. Morari M., Lee J.H., 1999, Model predictive control: past, present and future, Computers & Chemical Engineering, 23(4), 667-682. Ning C., You F., 2017, Data-Driven Adaptive Nested Robust Optimization: General Modeling Framework and Efficient Computational Algorithm for Decision Making Under Uncertainty, AIChE Journal, 63, 3790-3817. Ning C., 2018, Data-driven decision making under uncertainty integrating robust optimization with principal component analysis and kernel smoothing methods, Computers & Chemical Engineering, 112, 190-210. Ning C., You F., 2019, Optimization under uncertainty in the era of big data and deep learning: When machine learning meets mathematical programming, Computers & Chemical Engineering, 125, 434-448. Ogunjuyigbe A.S.O., Ayodele T.R., Akinola O.A., 2016, Optimal allocation and sizing of PV/Wind/Split- diesel/Battery hybrid energy system for minimizing life cycle cost, carbon emission and dump energy of remote residential building, Applied Energy, 171, 153-171. Self S.J., Reddy B.V., Rosen M.A., 2013, Geothermal heat pump systems: Status review and comparison with other heating options, Applied Energy, 101, 341-348. Shang C., Huang X., 2017, Data-driven robust optimization based on kernel learning, Computers & Chemical Engineering, 106, 464-479. Shang C., You F., 2019, A data-driven robust optimization approach to scenario-based stochastic model predictive control, Journal of Process Control, 75, 24-39. Shang C., 2019, Data analytics and machine learning for smart process manufacturing: Recent advances and perspectives in the big data era, Engineering, 5(6), 1010-1016. Shang C., Stroock A.D., et al., 2020, Robust Model Predictive Control of Irrigation Systems With Active Uncertainty Learning and Data Analytics, IEEE Transactions on Control Systems Technology, 28, 1493-1504. Standard ASHRAE, 2010, Standard 55-2010: Thermal environmental conditions for human occupancy. American Society of Heating, Refrigerating and Air Conditioning Engineers, Atlanta. Sturzenegger D., Gyalistras D., Morari M., Smith R.S., 2016, Model predictive climate control of a Swiss office building: Implementation, results, and cost–benefit analysis, IEEE Transactions on Control Systems Technology, 24(1), 1-12. Sun L., Kaufman M.F., Sirk E.A., et al., 2022, COVID-19 impact on an academic Institution's greenhouse gas inventory: The case of Cornell University, Journal of Cleaner Production, 363, 132440. Tian X., You F., 2019, Carbon-neutral hybrid energy systems with deep water source cooling, biomass heating, and geothermal heat and power, Applied Energy, 250, 413-432. Tian X., Zhou Y., Morris B., et al., 2022, Sustainable design of Cornell University campus energy systems toward climate neutrality and 100% renewables, Renewable & Sustainable Energy Reviews, 161, 112383. Yang S., Wan M.P., Ng B.F., Zhang T., Babu S., Zhang Z., Chen W., Dubey S., 2018, A state-space thermal model incorporating humidity and thermal comfort for model predictive control in buildings, Energy and Buildings, 170, 25-39. Zhao N., You F., 2021, New York State's 100% renewable electricity transition planning under uncertainty using a data-driven multistage adaptive robust optimization approach with machine-learning, Advances in Applied Energy, 2, 100019. Zhao N., You F., 2022, Sustainable power systems operations under renewable energy induced disjunctive uncertainties via machine learning-based robust optimization, Renewable and Sustainable Energy Reviews, 161, 112428. 504