## 2 Materials and Methods
### Case Study
Color groups 1 and 2 indicate two clearly separated “belts” following slightly different flow rate and specific power correlations. Color group 3 contains the rest of the data points. Figure 3: Relations between measured flow rate and power consumption (**left**), and flow rate and specific power consumption (**right**) for the supply fan in “ventilation system 1”. The measurements span all of 2022 with a 1 min resolution (525,600 data points) so a low opacity is used for each point in the graphs. around this time, which resulted in slightly lower measured fan power consumption for comparable flow rates. Since the simulated periods in this study are more recent than 2022, the data from \"Group 1\" is not used for parameter estimation. \"Group 3\" contains a large cluster of data points in the low flow rate region 0.25 to 0.6 m\({}^{3}\)/h, which mostly corresponds to morning and evening operation with low ventilation demands. These data show no clear correlation between fan flow rate and specific energy consumption. Instead, it seems that the specific energy consumption for the supply fan fluctuates between \(\sim\)1150 and \(\sim\)2500 J/m\({}^{3}\) independently of flow rate. Since the mechanics of this low flow rate region are unknown and fit poorly with a fixed power-to-flow rate relation, data points from \"Group 3\" are not used for parameter estimation. The supply fan constants are thus chosen to minimize the sum of the squared residuals from the data points in \"Group 2\" resulting in the function illustrated in Figure 5 (left). The exhaust fan constants are determined in a similar manner resulting in the function shown in Figure 5 (right). The CO\({}_{2}\) concentration in ventilated air is assumed to be a constant \(C_{\text{open}}\) = 400 ppm (typical outdoor concentration). All building spaces are assumed to have a constant natural ventilation rate of 0.05 h\({}^{-1}\) (room volumes per hour). This estimate is based on findings in the literature including [24; 25]. The teaching and office building is connected to the Danish electricity grid in the pricing area \"DK1\", so the simulations use historical electricity prices (DKK/MWh) [26] and CO\({}_{2}\) emission factors (g/kWh) [27] for this area. The MPC optimization is formulated in the \"GEKKO\" Python library [28] and set to use the \"IPOPT\" solver which applies an interior-point method for the convex nonlinear optimization. Due to computational limitations, some concessions were made for the simulations using MPC. Firstly, the prediction horizon was limited to 12 steps, and three combinations of time resolution and time horizon were benchmarked: 10 min/2 h, 20 min/4 h and 30 min/6 h. Of these, the 4 h optimization horizon with 20 min steps performed best and is used. The MPC still creates a new prediction every simulation time step (10 min) and applies the predicted optimal current position to the damper. Secondly, the MPC simulations will only include two building spaces. Thirdly, the MPC simulations will only cover a one-week period from the 6 March 00:00:00 (Wednesday) to the 12 March 23:50:00 (Tuesday) with 10 min time steps. Additionally the simulations have a 24 h warm-up period (5 March 00:00:00-23:50:00) to ensure realistic initial conditions. With rule-based control, a simulation is performed for the same one-week period, but also for a one-year period from 1 July 2023 to 30 June 2024, again with 10 min time steps and initial warm-up. To compare performance of MPC and rule-based control, the MPC  
Figure 5: Selected data points of measured flow rate against measured power consumption alongside fitted fan power function for the supply fan in “ventilation system 1” (**left**) and the exhaust fan in “ventilation system 1” (**right**). scenarios are \"scaled up\" through some assumptions. For the two rooms simulated with MPC, the ratio between combined total flow with a particular MPC controller and with rule-based control is calculated.