Evaluation of model predictive control (MPC) of solar thermal heating system with thermal energy storage for buildings with highly variable occupancy levels

The presence or absence of occupants in a building has a direct effect on its energy use, as it influences the operation of various building energy systems. Buildings with high occupancy variability, such as universities, where fluctuations occur throughout the day and across the year, can pose challenges in developing control strategies that aim to balance comfort and energy efficiency. This situation becomes even more complex when such buildings are integrated with renewable energy technologies, due to the inherently intermittent nature of these energy source. To promote widespread integration of renewable energy sources in such buildings, the adoption of advanced control strategies such as model predictive control (MPC) is imperative. However, the variable nature of occupancy patterns must be considered in its design. In response to this, the present study evaluates a price responsive MPC strategy for a solar thermal heating system integrated with thermal energy storage (TES) for buildings with high occupancy variability. The coupled system supplies the building heating through a low temperature underfloor heating system. A case study University building in Nottingham, UK was employed for evaluating the feasibility of the proposed heating system controlled by MPC strategy. The MPC controller aims to optimize the solar heating system’s operation by dynamically adjusting to forecasted weather, occupancy, and solar availability, balancing indoor comfort with energy efficiency. By effectively integrating with thermal energy storage, it maximizes solar energy utilization, reducing reliance on non-renewable sources and ultimately lowering energy costs. The developed model has undergone verification and validation process, utilizing both numerical simulations and experimental data. The result shows that the solar hot water system provided 63% heating energy in total for the case study classroom and saved more than half of the electricity cost compared with that of the original building heating system. The electricity cost saving has been confirmed resulting from the energy shifting from high price periods to medium to low price periods through both active and passive heating energy storages.


Introduction and literature review
Model predictive control (MPC) represents an advanc ed and adaptive approach to optimize the operation of heating, ventilation, and air-conditioning (HVAC) and lighting systems (Yang et al. 2019) within buildings.Unlike traditional control strategies, which react to current conditions, MPC uses predictive models to anticipate future requirements and make proactive adjustments.Incorporating a range of parameters such as weather forecasts, occupancy levels, energy prices, and system constraints (Zhang and Kumert 2021;Xia et al. 2023), it dynamically modulates HVAC operations to balance energy efficiency, cost-effectiveness, and occupant comfort.The robustness and accu racy of MPC have led to extensive research on its application for managing building power demand and implementing demand response controls (Tang et al. 2022).
Studies by Široký et a l. (2011) showed the ability of predictive control to reduce e nergy consumption by up to 28% in buildings using weather predictions.Khanmirza et al. (2017) found that predictive control, when compared to the proportional integral derivative (PID) control strategy, lowered energy consumption by 2 kWh over a month in a residential building.On a larger scale, Rawlings et al. (2017) proved that a predictive o ptimizer could autonomously operate a central plant of HVAC systems for 25 buildings 90% of the time, decreasing operation costs by 10%-15%.MPC has found widespread application as a predictive control strategy for energy s hifting under dynamic pricing schemes in demand respons e (DR) programs (Cao et al. 2019;Wei and Calautit 2022).Hu et al. (2019) demonstrated that an economic MPC controller could reduce 1.82% -18.65% all day elect ricity costs by shifting energy use from high-price to low-price periods and improving thermal comfort, as co mpared to a conventional on/off controller.Similarly, Ma et al. (2012) evaluated an economic MPC which reduced the cost by up to 28.5% by automatically triggering pre-cooling effect during off-peak period and shifting the peak demand away from o n-peak period.
These studies underline the efficiency of MPC in realizing economic benefits and enhancing indoor comfort levels in DR programs.
Moreover, various studies have demonstrated the potential of MPC in enabling demand flexibility, reducing peak load deman ds, and maximizing the utilization of renewable energy sources (Tarragona et al. 2020).With the decreasing cost of renewable energy technologies such a s solar energy systems, the goal of achieving net-zero carbon buildings has become more feasible.However, due to the intermittent nature of solar power, there can be a mismatch between energy demand and solar generation.This mismatch can be further exacerbated during pe ak load periods, resulting in iss ues such as in termittency, fluctuation, and unpredictability, which present significant hurdles to the integration of solar energy (Guo et a l. 2018).The work (Tarragona et al. 2020) explored the use of MPC to optimize a hybrid h eating system comprising an air-to-water heat pump and photovoltaic (PV) panels.The study demonstrated that the MPC strategy can adapt to different weather conditions and achieve significant financial savings with the right horizon and modeling.The research undersco res the potential of MPC in maximiz ing solar energy use in buildings, contributing to the design and implementation of energy-efficient heating systems.
Various factors such as w eather, envelope, energy systems and occupancy behav iour/patterns have an impact on building energy demand (Yang et al. 2022).Among these factors, occupancy pattern is one of the major sources of uncertainty related to building energy use (Dong et al. 2018;Zhang et al. 2022).MPC manages uncertainties related to occupancy patterns by incorporating predictive models that use historical data, current measurements, and forecast information.The controller leverages occupancy predictions, which may be obtained from various sources such as occupancy schedules (Hu et al. 2019), sensor data (Zhou et al. 2016), or machine learning algorithms (Tien et al. 2022a), and occupancy detection (Tien et al. 2022b) to anticipate changes in the building's thermal load.
For instance, if the MPC anticipates a high occupancy in the building during a certain period of the day based on historical trends, it may preheat or precool the building to ensure the optimal indoor temperature at that specific time (Hu et al. 201 9).If th e occupancy is lower than ex pected, the system wil l adjust its operations accordingly to save energy while still maintaining comfort levels.This proactive management of HVAC systems allows for efficient energy use and co mfort level o ptimization, even in the face o f occupancy uncertainties.
In their stud y, Oldewurtel et al. (2013) conducted an investigation into the effect s of occ upancy information on the performances of MPC.Homog eneous occupancy simulations revealed up to 34% potential savings for average vacancy and occupancy intervals of 5 and 10 days.In simulations with alternat ing occupancy, savings range around 50% compared to homogeneous occupancy scenarios.Ma et al. (2015) addressed the uncertainties associated with occupancy forecasts by deve loping stochastic and robust MPC controllers.
To further har monize the int ermittent nature of solar energy and th e variable ener gy demand d ue to occupancy patterns, the integration of t hermal energy storage (TES ) becomes crucial.However, the harmonization of renewable energy intermittency with th e building's en ergy demands calls for an integrative solution.TES emerges as a complementary element to the predictive prowess of MPC, serving as a co unterbalance to the varia bility of renewable energy sources.Exploiting time-of-use tariff schemes, TES enhances demand-side flexibility and promotes the integration of a broader range of renewable technologies.
As advanced control strategies and localized storage mechanisms gain traction in buildings, these entities transition into responsive components within the larger grid system, capable of heeding its incentives.This systemic int egration fosters energy shifting from periods of peak demand to off-peak intervals, thereby capitalizing on dynamic electricity pricing structures.The effective redistribution of ther mal energy loads to daily off-peak times presents a cohesive solution that aligns energy demand with supply, thereby paving the way for the succe ssful integration of renewable energy sources into the grid (Da et al. 2023).
Complementing this, various types of storage, such as the building envelope's thermal heat capacity, serve as cost-effective solutions for passive energy storage.These structural thermal energy sto rage (STES) s ystems provide an avenue to store building thermal energy in a dvance without incurring additional costs.STES, integrated with HVAC systems in demand response programs, leverages the temperature difference between indoor air and the building's envelope to automatically charge or discharge thermal energy.This process reduces energy system usage during peak demand periods.
Several studies exemplify the benefits of S TES across various building typologies and climates.For instance, Reynders et al. (2017) investigated the benefits of STES in the Belgian building stock a nd found that heating energ y storage capacity could reach up to 12 kW h and 66 kWh for peak-time energy shifting in a day.Si milarly, a Danish passive house demonstrated that nearly 90% of heating energy could be shifted to pe riods of low electricity prices by storing hea ting energy in the bu ilding's thermal mass over a year.A comparison of STES's energy flexibility for hot and cold climates (Hurtado et al. 2017) revealed that buildings across different climates could be o ptimally designed to implement energy control strategies for various seasons throughout the year.
Furthermore, STES can be fine-tuned to work in conjunction with advanced control strategies, accommodating heat transfer processes between building thermal mass and indoor air.For instance, Xue et al. (2014) devised a building energy storage strategy that optimized interactions with a smart grid.Their building thermal mass storage model predicted power alteration potential, achieving energy storage efficiency of up to 41.61%.Similarly, Hu et al. (2019) formulated an MPC strategy for STE S that factored in weather conditions, occupancy, and d ynamic electricity prices.This strategy, exhibiting superior energy shifting and maintenance of indoor thermal comfort, surpassed traditional on/off controllers in efficiency.
A floor heatin g (FH) system is a good candidate for integrating with STES.Specifically, the system preheats the thermal mass, i.e., the floor element, and then uses it to heat the indoor air, result ing in a larger energy storage capacity compared to other heating systems, such as radiators, within the same charging time.In Reynder et al. (2017 ) study, the FH system provided almost tw ice the storage capacity of the radiator and was 20% more energy-efficient.The FH system, which is a highly efficient heating system, utilizes heating pipes containing hot water to heat the floor element, which in turn transfers the energ y to the indoor air via convection (Li et al. 2 015;Weber and Jóhannesson 2005).Moreover, the floor heating system al lows for lower temperature water circulation in the pipes due to the larger surface area for heat transfer.This characteristic improves the energy efficiency of the heating systems and enables the use of low-te mperature energy sources, such as solar h ot water.This system can operate using low-temperature hea t sources with temperatures as low as 35 ºC (Hu et al. 2019), and it excels in maintaining uniform indoor temperatures.Zhou and He ( 2015)) conducted a study on the FH system's ability to control indoor te mperature and found that it varied by less than 0.2 ºC for most periods of a 2-hour test.
Nevertheless, the substantial thermal inertia inherent to a pipe-embedded floor ca n induce a no table time la g between the supply of heat a nd the subsequent increase in indoor air te mperature.This lag may exte nd over several hours, contingent on factors such as pipe th ickness, depth, and the thermal capacitance of the active floor.Conventional control mechanisms, such as the on-off controller and the proportional-integral (PI) controller, fall short of addressing this thermal lag and reacting promptly to abrupt load changes within the indoor space.As a solution, a predictive control strategy, capable of considering the delayed response of indoor temperature to environmental fluctuations, becomes pivotal in maintaining indoor comfort.
In the field of building energy management, the potential integration of MPC with both passive and active STES and rooftop solar thermal hea ting systems in buildings with highly variable occupancy, such as unive rsities, remains unexplored (Ma et al. 2012;Xue et al. 2019).Various works (Jafarinejad et al. 2019;Sa limi and Hammad 2019) have shown the importance of incorporating occupancy information to enhance th e effectiveness of MPC.This incorpo ration allows MPC to more accurately forecast the building's energy demand, consequently adjusting its charging and discharging schedules to ma ximize energy savings without sacrificing occupant comfort.However, prior studies s uch as those conducted by Torreglosa et al. (2015) and Bartolucci et al. (2018), while proposing MPC strategies for controlling the charge and discharge cycles of storage tanks couple d with renewable energy systems (RES), have not considered the building thermal mass storage and the i ndoor temperature's response.Therefore, the synergistic effect of co mbining active and passive storage with in such systems remains an open area for investigation.
This study aims to address the aforemen tioned gaps by developing and evaluati ng a price responsive MPC integrated with a solar thermal heating system, active and passive TES for buildings wit h high occu pancy variability (Figure 1).The coupled system supplies the building heating energy through a low temperature under floor heating system.A case study lecture room in the University building in Nottingham, UK, w ill be employed for evaluating t he Fig. 1 Proposed price responsive model predictive control for a building-integrated solar thermal heating and passive/active storage system for a highly variable occupancy building feasibility of t he proposed heating system controlled by MPC strategy during the heating season.The present study will develop a dynamic thermal representation of the building through grey-box identification of a state-space model.The developed coupled model will undergo verification and validation process utilizing both numerical simulations and experimental data.The developed MPC controller aims to improve the o peration of th e space heat ing system, lowe r the cost and maximise solar energy utilization.

Method
This section outlines the methodology employed to simulate the suggested building-integrated solar energy system using the MPC strategy.Initially, a numerical state-space model is proposed for the room, along with models for the storage tank and solar hot water system.Subseq uently, an MPC control strategy is designed based on the state-space models to maximize the utilization of solar thermal energy.Finally, the simulation platform is in troduced to provide real-time indoor temperature feedback and impleme nt the control strategy.

Building room model
The resistance-capacitance (RC) room model is a commonly used method for representing indoor heat transfer.This model consists of a netwo rk of first-order s ystems, where the temperature nodes for both the walls and indoor air serve as the system states (Široký et a l. 2011).To illustrate, consider an example of the RC representation for indoor air: This study employed gray-box identification, a technique that aims to identify system properties by capturing physical connections between states (Li et al. 2015), to id entify room model properties using the proposed RC model (see Figure 2).To estimate the model through machine learning methods using input/output data, a state s pace model was utilized.This model typically provides a f ast approach to identifying a discrete-time model of the continuo us-time system (Široký et al. 2011).In the present study, a linear, time-invariant state space model was formulated to predict the temperatures of nodes.
A, B, D and K are the system matrices, which have to be identified.x k Î R 5 are system states include temperatures of the external node of the external wall T w_ext , internal nod e of external wall T w_int , node of indoor air T in , node of floor T fl and node of floor heating pipe T pp .u k Î R 4 are input variables, including ambient temperature T a , global solar radiation I solar , internal heat gain Q inter and FH inlet temperature T inlet .y k Î R 2 are the out put variables, inc luding indoor temperature T in , pipe temperature T pp .σ k is an unknown noise, e.g.zero mean Gaussian white noise.In this study, σ k is assumed to be zero.S ystem identification aims t o minimise the error between measured data and out put of the simplified RC representation with a limited searching magnitude by giving the initial values of system matrices (based on construction properties).The i dentification process used a cost function for minimising errors (Li et al. 2015).One example is the MATLAB system identification toolbox (Ljung and Singh 2012).
We assumed a reasonable original state for each temperature node.Since not all states are measurable in reality, a Kalman filter was us ed to estimate unmeasurable states and filter the noises in each cycle.Leveraging a dualpronged approach, which involves updating measurements and error covariance simultaneously, the Kalman filter has the capacity to estimate the current state a t each starting point of the optimization process (Mirzaee and Salahshoor 2012;Maasoumy et al. 2014;Mantovani and Ferrarini 2015;Hu et al. 2019).

Storage tank and solar thermal collector model
A TRNSYS model (Figure 3 ) was developed to simulate a solar thermal system that suppli es heat to a domestic floor heating system with a storage tank.The model uses Type 15, which employs a TMY hourl y weather file of Nottingham, Fig. 2 Room RC model with FH system and storage tank (Li et al. 2015;Hu et al. 2019) Fig. 3 TRNSYS model for thermal storage tank integrated with the solar thermal system and FH UK, obtained from Meteonorm (Remund et al. 2020).Type 15 is responsible for reading data at regular time intervals from an external weather data file, interpolating the data (including solar radiation for ti lted surfaces) at time st eps of less than one hour, and making it a vailable to oth er TRNSYS components.The information on global radiation, solar radiation for the t ilted surface of the collector, and ambient temperature are then fed to Type 1, which represents the solar thermal collector.A pump (Type 114) circulates the water of the t hermal storage tank (T ype 158) to the solar thermal collector to collect the heat from the sun and heat the water in the hot water storage tank.There is another pump that circulates the water in the building FH system to the storage tank.Type 155 co nnects TRNSYS to MATLAB.MPC simulated in MATLA B would give signals for each pump and the amount of auxiliary heating required for the tank at each time step.
On the other side of the storage tank, hot water is supplied to the building's floor heating system (Type 56), and two streams exchange heat in the storage tank.The outlet 1 fluid of the storage tank is the return water to the solar thermal collector, while the outlet 2 fluid of the storage tank is the floor heating system inlet water.Additionally, auxiliary heat input is provided to the storage tank in case of insufficient heat supplied to the floor heating system when the temperature of outlet 2 of the storage tank does not meet the setpoint temperature of 45 °C.The design parameters of the system in TRNSYS are listed in Table 1.
In the event that solar radiation im pinges upon a solar thermal collector, the efficiency of solar heat transfer is contingent upon the temperature differential between the inlet water and the ambient temperature.The overall thermal efficiency of t he solar collector is det ermined through the utilization of the Hottel-Whi llier equation, which takes into account the difference between the amount of absorbed solar radiation and the corresponding thermal loss: In TRNSYS, the number of tank nodes is sp ecified for designating the level of strat ification for th e storage tank (Shrivastava et al. 2017).Each of the tank nodes is assumed to be isothermal, and the T RNSYS then calculate the heat transfer pass through each node by: tank, in,tank, out,tank, tank, d d To simplify, the storage tank is modeled with only one node, which denotes a fully mixed tank (Klein 2010) and the heat loss to the environment is assumed to be negligible.The rationale behind not consid ering thermal stratification during the modeling process of the storage tank stems from a desire to ma intain model s implicity and computational efficiency.For future wo rk or studies with an i ncreased emphasis on granular thermal dynamics, modeling the thermal stratification in th e hot water sto rage tank could provide additional insights into the system 's performance and potential optimizations.The model of the storage tank was expressed in the form of the equation governing the temperature of the tank node as follows: ), the temperature of the return water of the FH system ( T building_return ) and the amo unt of auxiliary heat (Q auxiliary ).The temperature variation of the node in the tank is de pendent on the hea t transfer occurring betwe en the two streams flowing inside, and the auxiliary heat is supplied.Then the state space model of the storage tank would be identified by the data output from TRNSYS.
The auxiliary heating energy serves as a standby heating source to supply the FH system.If the heating energy from the storage tank is insufficient to mee t the building's heating demand, an auxiliary heating pump equipped with a building with a constant coefficient of performance (COP) of 3 (Xue et al . 2014;Hu et al. 2019) is employed to raise the temperature of the water from the storage tank to 45 °C.The energy consumption of the auxiliary heating is: where Q est is the heating loa d of a syste m.COP sys is the overall COP of the heat pump.P sys is the power demand for the system.

MPC strategy
The aim of the proposed MPC control strategy is to minimize the usage of auxil iary heating energy sourced from the grid.Typically, an external hot water storage tank receives solar thermal energy from a solar thermal collector.In instances where there is insufficient hea t supply to the case study room, additional heating energy is provided by an auxiliary h eater to heat the inlet hot water of the FH system to reach 45 °C while considering real-time wholesale market electricity prices (Nord Pool 2022).The economic cost function is presented below: auxiliary heating is off or 45 auxiliary heating is on ∆t is the time interval and N is the prediction ho rizon, which means the number of the time ste p predicted in advance.q and r mean the weights of cost.A large weight means the cost is more important than other costs.k means the current time step and J denotes the total electricity cost of the thermal energy demand of the building.
In the development of MPC programming, the objective function was structured as quadratic forms.This approach stems from the study of Širo ký et al. ( 2011) indicates tha t minor deviations in comfort levels can lead to significant penalization in the total cost, thereby h ighlighting the importance of precision in comfort control.

Co-simulation of TR NSYS and M ATLAB with r oom model
The co-simulation of TRNSYS and MATLAB is commonly employed to s imulate the MPC applied in buildings ( Hu et al. 2019;Wei and Calautit 2023).The building's dynamics are computed using Type 56 of TRNSYS (McDowell et al. 2017), while MATLAB offers several tool boxes that co uld be utilized to simulate MPC strategies.In this study, the Yalmip toolbox (Lofberg 2004) was used for MPC construction, and the Gurobi solver (Rawlings et al. 2018) was utilized to determine the control signal.Additionally, a real-time adaptation algorithm, specifically the Kalman filter (Sena et al. 2021), was employed to correct the state-space model prediction during the co-simulation process.The building model was initially develo ped in S ketchUp and t hen integrated with TRNSYS through the TRNSYS3d plug-in (Calise et al. 2021).

Description of the case study building
The Marmont lecture room, situated on the first floor of the Marmont Centre at the University Park Campus, University of Nottingham, UK (as depicted in Figures 4 (b) and 4(c)), was utilized as the case study room.This building is primarily designed to facilitate the teaching of architecture and engineering students.This building includes a variety of spaces conducive to m ultifaceted academic activities.The teaching spaces comprise a lecture room and a seminar room, each can accommodate up to 38 students.The occupancy pattern of these spaces can fluctuate substantially throughout the course of a day, influenced by the students' varying schedules.Both the lecture and seminar rooms are equipped The lecture room is heated by a central heating system, which includes a boiler and radiators.Located strategically within the bu ilding, the boiler supplies a stable source of heat during the colder months.The heating is typically required from October to May.The heated water is distributed via a net work of pipes connected to a serie s of radiators positioned below the w indows across the lecture room.This positioning not only ensures optimal heat distribution but also effectively counteracts the cold downdraughts from the windows.Individual control valves on each radiator allow for adjustments in hea t output, offering a level of ro om-specific temperature con trol.However, the overall control strategy for the central heating system is an on/off mechanism, which, al though simple, can sometimes lead to less efficient heatin g performance compared to more advanced control strategies like proportional-integral-derivative (PID) control or MPC.In the modelling phase of this study, it's important to note that certain factors wer e not considered to maintain simplicity.For instance, the potential impact of the window opening on the indoor temperature and the effect of varying radiator heat outputs via in dividual control valves were disregarded.In the case of the latter, it wa s assumed that these valves were in a fully open state.
The 3D model of the room was developed using SketchUp, with dimensions of 12.75 meters in length, 7. 6 meters in width, and heights of 2.71 meters and 4.26 meters.The windows are located on the south-east and north-west facing walls, with a window-to-wall ratio of 0.22 and 0.08, respectively.
The construction was based on the real structure, and Table 2 presents the materials utilized, ordered from outside to inside.The properties and overall U-values of the wall, roof, and floor are listed in Table 2.The room was constructed using lightweight materials, and the window U-value was assumed to be 1.1 W/(m 2 •K).
The case stud y building has a solar thermal collector installed on the roof.Util isation factor ( UF), which is the ratio of collect or area to total area (i.e., 98. 89 m 2 ), sets to 0.5 based on the real installation (Figure 4(b)).

Occupancy and equipment profiles
The case study room is a lecture room that can accommodate up to 38 st udents, as illustrated in Figure 5.In this study, we defined typical occupancy profile and occupant-related heat gains for one week during the aut umn semester based on the timetabled classes/activities and our knowledge of the usage o f the space.For simplificatio n purposes, we assumed natural ventilation was not em ployed in o ur simulations.The indoor lighting consists of 8 luminaires and 1 side light, while the indoor equipm ent includes 1 5 laptops, 1 projector, 1 computer, and 1 monitor.Students attend the lecture room based on class schedules, and their arrival and de parture times are highly variable.The usage of equipment in the case study room depen ds on the type s of classes.The occu pancy profile during a typ ical autumn semester week is shown in Figure 5(b), and the lighting and equipment usage profile is presented in Figure 5(c).
On Day 1, a typical lecture day, the maximum number of students present was 32, and 18 ele ctric equipment (15 laptops, 1 projector, 1 monitor, and 1 computer) were occasionally used.On Day 2, there were two lectures with a break, and 25 students attended class wit h a maximum of 21 electr ic equipment being used.Day 3 was a group workshop with 20 students and 13 electric equipment.Day 4 was a seminar with 30 students and 23 elect ric equipment.Day 5 wa s another group workshop with 20 students and 14 electric eq uipment.On Tuesday, the re was a break during noon, and the number of occupants was significantly The internal heat gains due to occupants were estimated based on the guidelines provided by CIBSE Guide A (CIBSE 2006), which included convective (46 W) and radiative (69 W) gains for each occ upant.LED luminaires were assumed to be installed with a maximum power of 10 W per light, with 30% radiative gains (CIBSE 2006).Electric equipment was assumed to have a m aximum power of 10 W per piece of e quipment, with 20% radiative heat dissipation (Butcher 2006).

Setpoint and control strategy
The energy efficiency of the building in this case study was critically assessed by empl oying two distinct set-point strategies.The first strategy, referred to a s the reference case (Strategy 1), strictly maintains an indoor temperature of 22 °C during lecture periods, implementing an on/off controller to permit free-floating half an hour prior to and subsequent to class hours (Xue et al. 2 014).Figure 6 visualizes the set-point strategy for the ob servation week.In contrast, Strategy 2 leverages a structural thermal energy storage (STES) control strategy.This strategy optimizes the building's structural capability to store energy during periods of low-price, until the indoor temperature escalates to 25 °C, a value considered the upper limit of indoor comfort (Hu et al. 2019) as depicted in Figure 6.
The MPC control strategy maintains the lower temperature bound consistent with the reference strategy, but it introduces an early start-up.The weather prediction data used in the MPC strategy was sourced from Meteonorm (Remund et al. 2020), specifically for Nottingham, UK.Moreover, to enable the STES stor age effect, a day-ahead dynamic price of electricity was used, procured from the UK power market of Nord Pool (2022).
This research conducts a comparative analysis of three control strategies for the floor heating sys tem.The first scenario employs a conventional on/off controller to manage the floor heating system.In the second scenario, we leverage an MPC to control the flo or heating s ystem.The third scenario expands upon the second, wherein the floor heating system is integrated with a so lar hot water s ystem, with an MPC strategy orchestrating both systems.Our case study revolves around a room currently warmed by central heating radiators.An integral part of this analysis includes assessing the potential electricity cost savings realized by transitioning to the proposed solar hot water heating system, in comparison to the existing heating setup.

State-space model verification
The state-space model was identified and validated using different datasets.The comparison was made for results (indoor temperature T in and floor temperature T pp ) by input ting the same values of input variables . Each dataset contains 500 data points.Table 3 presents the results of system matrix identification and identification accuracy.The values of R inlet_mean and R mean_pp in this study were fo und to be 0.00040 K/W and 0.00056 K/W.

Room model verification
The state-space model identification was accomplished using the output data from a TRNSYS simulation.We generated 1500 data sets for model identification and 1000 for model verification, with a 30-m inute time interval starting fro m November 4th.This data was acquired with the indoor Fig. 6 Control strategies evaluated for the case study building temperature managed by an on/off controller.The identification accuracy was similar to t he verification accuracy, as sh own in Table 3, which showed a high Fit% value.This outcome substantiates that the numerical model was capable of accurately replicating simulated temperatures given known input parameters.Fi t% is the percentage of the model outputting temperatures matching the experimental outputting temperatures: best fit 1 100 ŷ y y y The TRNSYS model's validity was further confirmed by the case study room's measured indoor temperature, gathered every 5 minutes over two days (2nd December to 4th De cember), post the disconnection of heating on the preceding Friday night.The in door temperature was measured using a K-type thermocouple and data logger TC-08 thermocouple data logger with an accuracy of ±0.5 °C (PICO Technology 2019).The months of November and December were chosen for the simulation due to their representative climatic conditions.December typically experiences the lowest ambient temperature, leading to heating energy consumption throughout the year.Solar radiation also tends to be at lo wer levels during this period.Consequently, the performance of the proposed system under these conditions offers valuable insights for evaluating the feasibility of similar systems.
The results, as depicted in Figure 7, demonstrate that the simulated data offers satisfactory accuracy in predicting indoor temperature, with a cross-validation root mean square error (CVRMSE) of 0.0052.The T RNSYS model's time interval was then adjusted from 5 minutes to 30 minutes to form a model suitable for MPC usage.This is because the control strategy for a typical room usually takes between half an hour to an hour (Hu et al. 2019).Thus, the prediction interval should match the control interval.The floor heating system controlled by the MPC control strategy was further validated through comparisons with the st udy by Hu et al.  (2019).The simulated indoor temperature controlled by our proposed MPC strategy with the FH system showed a close match with the results presented by Hu et al. (2019), with a maximum difference of 13.47%, as shown in Figure 8.

Storage tank model verification
The state-space model for the storage tank was validate d utilizing MATLAB's system identification function, ssest.
To identify system parameters, we employed 1000 data points, while the verification of the ide ntified model necessitated 2000 data po ints, these points were collated starting from November 4th at 5-minute intervals.The tank model would further adjust the time interval from 5 minutes to 30 minutes to match the trigger of the control strategy.The model displayed good agree ment between the two meth ods as evidenced by a CV RMSE of 0.01 (illustrated in Figure 9).

Evaluation of the indoor temperature control
Two types of controllers, namely on/off and MPC, were utilized to achieve indoor temperature control, independent of any integrated solar hot water system.The results of these control strategies are de picted in Figur es 10(a) and 1 0(b), respectively.The simulation period ranges from November 7th to November 13th, covering both weekdays and weekends.The application of an on/off controller led to considerable indoor temperature fluctuations over the course of the day, attributable to drastic variations in both outdoor temperature and indoor occupancy patterns.This resulted in significant comfort violations, rendering the on/off co ntroller as less effective for ensuring indoor thermal comfort.On the ot her hand, the substitution of the on/off controller with an MPC controller facilitated th e adoption of a preheating strategy for the FH system, as demonstrated in Figur e 10(b) (where "1" signifies "on", and "0" denotes "off").
Subsequently, the indoor te mperature was successfully maintained within the desired bounds.This was made possible as the MPC controller took into account occupant-related internal heat gains and anticipated the distribution of heating energy to the indoor air, ther eby sustaining a comfortable indoor temperature.This was realized b y incorporating predefined occupancy profiles and occupa nt-related heat gains into the MPC controlle r to solve for t he prospective control strategy.For the purpose of this study, it is important to note that we have opted for a pre-specifie d occupancy pattern, simplifying the model f or clarity an d ease of understanding.This choice was made to allow for a more straightforward exploration of the pr imary variables under consideration, including energy consumption, cost effectiveness, and thermal comfort.
As discussed in the introduction, forecasting occupancy patterns typically employs on-site models that leverage statistical and machine learning methodologies.There have been previous studies that developed stochastic and robust MPCs designed to handle the uncertaint ies associated with occupancy forecasts (Yang et al. 201 9;Esrafilian-Najafabadi and Haghighat 2022).However, in this specific stud y, such complexities are not delved into.In pract ical application scenarios, information regarding occupancy can be either preset according to customary patterns or gathered through intelligent devices such as smartphones or Internet of Things devices.This data can then be fed into the MPC for more accurate and efficient climate control in the building.Nonetheless, for the sco pe of our current investigation, we have purposefully maintained a pre-determined occupancy pattern.
As depicted in Figure 11, the occupant-related internal heat gains vary accord ing to time, and the control strategy is carefully formulated b y the MPC.It was previously established that the MPC is capable of keeping the indoor temperature consistently within the stipulated bounds, as shown in Figure 10(c).Furth ermore, the MPC displays the capacity to accurately forecast daily oc cupancy patterns, subsequently selecting a t imely initiation of the h eating system prior to the arrival of students.The MPC also discerns instances of preheating prior to the day's peak times, thus orchestrating a consumption of electricity energy that pr imarily falls within the lower to medium price range.The study also provides an illustrative representation of how the MPC regulates indoor temperature in response to fluctuating occupant presence within the day.For instance, a break occurring at noon on Tuesday is associated with a sudden decrease in o ccupant numbers.The MPC, recognizing this abrupt drop in internal hea t gains, opts for a preemptive increase in indoor temperature before the break, effectively exploiting the low-price energy available at that time.The MPC demonstrates a preference for utilizing low-cost energ y during the nighttime and morning hours to preheat the room, whilst disconnecting the heating system in the afte rnoon when electricity prices tend to peak.

Energy performance and thermal comfort violations
The MPC-regulated under f loor heating system o perated for 13 hours more compared to the on/off controller, consuming 725 kWh of electricity co mpared to the on/off controller's 560 kWh.Howe ver, the ele ctricity costs for both remained comparable (Table 4), attributable to the MPC's capacity to capitalize on low-cost energy.This finding echoes the o utcomes of earl ier studies (Hu et al. 2019), which demonstrated the MP C's predilection for charging during periods of lower prices and init iating early startup before occupancy.The proposed MPC sought to lev erage the advantages of low-cost energy, storing the heat within the building's structure and discharging heat during periods of higher prices.
In the integration of the solar hot water system with the MPC, the primary objective is to favor the usage of solar thermal energy and minimize electricity costs.As depicted in Figure 10(c), the inlet water te mperature of the floor heating system aligns with the outlet temperature of the hot water storage tank when solar thermal energy is utilized.In the absence of solar thermal energy, the inlet temperature is adjusted to 45 °C, complemented by auxiliary heat sourced from the supply network.The proposed MPC control strategy guarantees that the indoor temperature remains completely within the stipulated temperature bounds.Moreover, the introduction of an active wat er storage tank contributes significantly to r educing the switch-on hour s to half of those in the refere nce case wher e no solar hot water system exists, as indicated in Table 4.As a result, the total electricity cost dur ing the simulation period decreases substantially to half of the reference case.This outcome is attributed to t he enhanced solar thermal storage capa city made possible by the integration of an active hot water tank.
Thermal comfort was evaluated based on t he integral of room temperature comfort range violations over time, quantified in t erms of kelvin hours (Kh) (F igure 12).The total Kh for the on/off, refere nce MPC, and MPC with the solar hot water system are 7 .78°C, 0.03 °C, and 0.17 °C, respectively.Overall, the reference MPC, despite consuming marginally more control energy, delivered considera bly enhanced thermal comfort.
The reference MPC, which only leve rages STES for energy storage and disregards the integration of the solar hot water system, necessitated greater energy use.This was offset by capitalizing on low-to-medium priced energy, reducing comfort violations compared to the conventional on/off control strategy.Despite the increase in total energy consumption with the reference MPC control, a net improvement in overall comfort was observed, a finding that aligns with the study conducted by Sturzenegger et al. (2016).

Energy cost based on electricity price
At present, the lecture room's heating needs are serviced by six continuously operational radiators.The indoor thermostat manages the ambient temperature, maintaining it between 20 °C and 24 °C.Figure 13 shows a comparison of energy consumption between the e xisting heating approach and the modified strategy incorporating both a floor heating system and a solar thermal system.Under th e conventional system, the accumulated electricity cost over the period amounts to 6956 GBP pence.However, this figure was 3035 GBP pence lo wer when im plementing the solar hot water and floor heating system under an MPC strategy.During the simulation period, electricity prices fluctuated b etween 4 GBP pence and 23 GBP pence.We have categorised these into three pricing tiers: low-price energy (4 GBP pence to 10 GBP pence), medium-price energy (10 GBP pence to 16 GBP pence), and high-price energy (16 GBP pence to 23 GBP pence).F igure 13 illustrates the energ y consumption of both systems.The system incorporating solar hot water exhibited increased usage ( 58%) of low-to-mediu m price energy as compared to th e conventional system (33%).Conversely, the conventional system largely relied (67%) on high-price energy.
The low usage during low-price periods for the MPC with solar energy heating a nd active/passive storage, in contrast to a conventional on/off system, can be primaril y Fig. 12 Cumulative comfort violation for each strategy Fig. 13 Electricity cost based on electricity price for original system and the proposed solar hot water system attributed to s everal reasons.The MPC integrated with a solar energy heating system se eks to maximize the usage of freely available solar energy.This naturally harvested energy source can often meet a subs tantial portion of the heating demand, reducing the need for additional electricit y even during periods of low-cost energy.Furthermore, the presence of active and passive storage mechanis ms within these advanced systems enables th e storage of e xcess harvested solar energy during periods of high solar yield.This store d energy can then be utilized during periods of high demand or when solar radiation is insufficient or non-exi stent, reducing the need for additional, low-cost electrical energy during these times.As t he MPC s ystem is ca pable of predicting demand, it can efficiently manage and distribute the stored ene rgy, minimizing the need for extra energ y during low-price periods.In contrast, the conventional on/off systems lack th ese capabilities.It cannot harvest, store, or efficiently manage solar energy.Moreover, it does not have demand forecasting capabilities, and its operation is not lin ked to energy price fluctuations.As a result, it consumes more energy overall and has higher usage during low-price periods.

Analysis of heating energy source
The heating source's composition for the building heating system is depicted in the sta cked bar graph in Figure 14 .Under conditions of low solar radiation, auxiliary heating usage increases.It is discernible that under the control of the MPC, the auxiliary heating drawn from the grid was predominantly used during the hours fro m midnight to early morning, coinciding with periods of relatively low Fig. 14 Heating energy source for the integrated solar hot water system electricity prices.However, with sufficient solar radiatio n, the heating energy harnessed directly from the storage tank adequately covers daily energy consumption, further aided by energy shifting through STES.Coupled with active and passive storage systems, the MPC successfully moved mos t of the heating demand to periods of ample solar radiation availability.The MPC's ability to maximize solar energy usage during daytime, when electricit y prices are at their peak, takes advantage of a peak lo ad shifting strategy.Subsequently, the MPC predicts demand for the following 12 hours, determining the solar energy to be stored via both passive and active storage techniques, further shifting demand away from night time peak hours (i.e., 18:00-22:00) to midnight.Overall, the solar hot water system s upplied 63% of the heating energy to the case study room, primarily during periods with h igh solar radiation availability.This result validates the effectiveness of the MPC in augmenting RES integration into resident ial micro-grids by predi cting both the building's load and system's response under varying weather conditions, in alignment with the studies of Torreglosa et al. (2015) and Bartolucci et al. (2018).

Limitations and application scope
The study conducted offers insightful pers pectives into the application of a price-res ponsive MPC strategy for solar thermal heating systems with thermal energy storage in buildings exhibiting high occupancy variability.However, the interpretation of these findings must acknowledg e certain limitations.The geographical focus of the study, Nottingham, UK, might pose a constraint on the broader generalizability of the findi ngs, particularly concerning areas with diff erent climates and solar energy cond itions.Furthermore, the university-specific context may restrict the broader application of th e proposed strategy to buildings with differing occupancy patterns.Also, conclusions about cost savings are inherently tied to the lo cality's specific energy price structures and solar energy availability, possibly affecting the economic viabil ity of the pro posed system in different settings.Despite these limitations, the posed MPC strategy maintains utility across d iverse contexts.Even in regions with static electricity prices, the multifaceted capability of MPC to regulate energy use based on anticipated occupancy, weather forecasts, and the expected performance of integrated renewable energy systems allows for the optimization of comfort and efficiency.As gri d structures evolve and renewable energy integration amplifies, MPC's benefits, such as mitigating grid stress thr ough peak demand reduction, could become more pertinent.
Furthermore, the effectiveness of MPC extends to regions with lower solar energy availability, thanks to its fundamental mechanism of leveraging fut ure condition predictions to optimize system control.Here, while solar energy utilization could diminish, integration of other renewable energy sources into the MPC framework can maintain consistent benefits such as improved comfort, adaptiveness to occupancy patterns, and potential energy demand reductions.
Lastly, although the developed model underwent a robust validation process using numerical simulations and experimental data, its broad applicability might encounter unanticipated operational complexities.Future research endeavors could concentrate on addressing these limitations, further enhancing the model's universal applicability across various buildings, climates, and energy scenarios.

Conclusion and recommendation for future works
This research investigated a price responsive MPC strategy for a solar th ermal heating system with thermal energy storage (TES) for buildings with high occupancy variability.The TES system, comprising a hot water st orage tank and the building's thermal mass was integrated with a roofto p solar hot water system.The primary objective of the M PC controller was to enhance the performance of the renewable energy-based space heating system, reduce costs, and optimize the utilization of solar energy res ources.This is achieved by forecasting the system's responses under varied weather conditions and integrating dynamic pricing.The developed grey-box state space model has undergone verification and validation process, utilizing both numerical simulations and experimental data.A case study un iversity building located in Nottingham, UK was employed to assess the viability of implementing the heating system controlled by the MPC strategy, leading to the following key conclusions:  The implementation of MPC in managing an integrated solar hot water and under floor heating system demonstrated a significant reduction in energy costs, with savings reaching up to 50% compared to a reference case. The MPC con trol strategy, paired with an active water storage system, managed to reduce th e switch-on hours by half of the reference case.This, coupled with the exploitation of solar thermal storage, reduced total electricity costs during the simulation period by half compared to the reference case. Utilizing the solar thermal energy, the integrated MPC system managed to maintain the indoor temperature within the desired temperature bounds, thereby minimizing electrical costs and optimizing the use of freely available energy. Despite periods of low solar radiation, the MPC' s prediction capabilities, including early pre-heating before room occupancy, ensured that the indoor temperature was maintained at a comf ortable level, achieving zero violations of the temperature bounds. The system controlled by MPC presented a 58% utilization of low to medium-priced energy, a significant improvement from the conventional system, which showed only a 33% utilization in the same price range. With an integral focus on leveraging low-price energy and active thermal storage, the MPC-controlled system resulted in substantial thermal comfort improvements, reducing the total time-integral of room temperature comfort range violations (measured in Kelvin hours) to a minimal 0.03 °C, compared to 7.78 °C for the on/off controller.
Overall, this study proves the viability of an integrated solar hot water system with an MPC contr ol strategy as a promising approach to enhancing the energy efficiency and thermal comfort of building heating systems, making it an attractive solution in the face of fluctuating energy pr ices and varying occupancy patterns..However, for comprehensive realization of this integrated system, additional research is necessitated.Future wor k should focus on empirical validation of this integrated storage model and consider the water stratification within the storage tank.
This study opens numerous avenues for future research in the realm of optimizing energy management systems and elevating building thermal comfort.One such opportunity lies in the ex ploration of integrating additio nal renewable energy sources.Working syn ergistically with the exist ing solar system, these could f urther diminish reliance on grid electricity and bolster the overall sustainability of the system.
Moving from the pre-defined occupancy patterns used in this study, an interestin g prospect is to enhance the realism and a ccuracy of sys tem control by incorporating predictive models of occupancy.Th ese models could be founded on real-time data ha rvested from smart devices or Internet of Things technologies.
The development of the existing MPC algorithm presents another promising area of research.The algorithm could be refin ed or expand ed to account for a broader spectrum of environmental conditions and building features.The implementation of machine learning or artificial the mass flow rates of the solar outlet water and FH system re turn water.Then, a state space model is created to i dentify the real-ti me tank node temperature by the tem perature of the outl et of the solar collector ( outlet solar T

Fig. 4
Fig. 4 (a) Outdoor temperature and global solar radiation of the simulation periods, (b) front view of the Marmont center building, (c) floor plan of the first floor with the lecture room

Fig. 5
Fig. 5 (a) Lecture room, (b) occupancy profile and (c) lighting and equipment usage reduced.Furthermore, few students would stay in the room for a while after class.The internal heat gains due to occupants were estimated based on the guidelines provided by CIBSE Guide A (CIBSE 2006), which included convective (46 W) and radiative (69 W) gains for each occ upant.LED luminaires were assumed to be installed with a maximum power of 10 W per light, with 30% radiative gains(CIBSE 2006).Electric equipment was assumed to have a m aximum

Fig. 8
Fig.8MPC control strategy was further validated through comparisons with the study byHu et al. (2019)

Fig. 10
Fig. 10 Indoor temperature controlled by (a) on/off controller, (b) reference MPC controller, (c) p roposed MPC by considering solar thermal energy

Fig. 11
Fig. 11 (a) Internal heat gains and (b) control strategy based on the prediction of internal heat gains

Table 2
Properties of materials in the case study room

Table 3
Fit percentage of identification and verification

Table 4
Energy performance of different control strategies