## 2 Materials and Methods  
### Ventilation System Model  
The developed modeling framework is component-based and intended for flexible use in modeling and simulation of building HVAC systems. For this study, the framework is used to create a ventilation system model which is used for the comparison of different control strategies in a case study building. The model incorporates both physics-based and data-driven modeling techniques and is therefore a gray box (hybrid) approach. The focus of this study is exclusively ventilation for air quality, so the developed model is reduced to only include ventilation system components. Figure 1 illustrates a typical component structure in HVAC systems and the components included in the reduced model used for this study. The ventilation system is modeled as a quasi-steady-state system, where only the concentration of CO\({}_{2}\) in building spaces is treated as a continuous development during simulation steps. Other system attributes are considered constant within each time step, but variable between steps. For each time step, the model simulates the process for every system component in a logical order determined by component connections. For example, the component connections and resulting simulation order for a single ventilation system servicing two building spaces is illustrated by Figure 2.  
The component model used for each component type is based on well-established component models presented in the literature and validated in previous studies. The applied fan model for both supply and exhaust fans replicates the \"Variable Speed Fan Model\" from EnergyPlus [15] except flow rates are used in place of mass flow rates. It describes the correlation between flow rate and power consumption through three equations:  
\[F_{flow}=\frac{Q_{fan}}{Q_{fan,max}} \tag{1}\]  
\[F_{pl}=c_{1}+c_{2}F_{flow}+c_{3}F_{flow}^{2}+c_{4}F_{flow}^{3}+c_{5}F_{flow}^{4} \tag{2}\]  
Figure 1: Component overview for typical HVAC system (**left**) and the considered ventilation system (**right**). \[\dot{W}_{fan}=F_{pl}\dot{W}_{fan,max} \tag{3}\]  
Using the current flow rate \(Q_{fan}\) and nominal flow rate \(Q_{fan,max}\) a flow fraction \(F_{flow}\) is determined in Equation (1). A part load factor \(F_{pl}\) is calculated using power coefficients \(c_{1}-c_{5}\) in Equation (2), where \(c_{1}+c_{2}+c_{3}+c_{4}+c_{5}=1\). The fan's power consumption \(\dot{W}_{fan}\) is then calculated in Equation (3) using the fan's nominal power consumption \(\dot{W}_{fan,max}\). A simple linear model is used for both supply and exhaust dampers to describe the relation between opening degree and flow rate. It is based on the pressure-independent damper component from Modelica Buildings Library [16]. The flow rate \(Q_{d}\) through the damper is calculated as the product of the nominal flow rate \(Q_{d,max}\) and the opening fraction \(y\in[0,1]\) as described by Equation (4). \[Q_{d}=yQ_{d,max} \tag{4}\]  
In this study, the air quality evaluation and ventilation control is purely based on indoor concentration of CO\({}_{2}\). The purpose of the building space component is therefore to simulate the development of CO\({}_{2}\) in a designated volume \(V_{s}\). The applied model is based on the principal of mass balance in a similar manner to the approach presented by [PERSON] et al. [17]. The time-dependent change in building space CO\({}_{2}\) concentration \(C_{s}\) is described by the ordinary differential equation (ODE):  
\[\frac{dC_{s}}{dt}=\frac{Q_{ven}(C_{ven}-C_{s})+G_{s}}{V_{s}} \tag{5}\]  
where \(Q_{ven}\) is the ventilation flow rate, \(C_{ven}\) is the CO\({}_{2}\) concentration in air delivered from ventilation and \(G_{s}\) is CO\({}_{2}\) generation within the space. The ventilation flow rate includes both forced and natural ventilation. Equation (5) relies on the assumptions that exhaust ventilation flow from a building space matches the supply ventilation flow to the space, and that CO\({}_{2}\) concentration in the exhausted air is equal to the average CO\({}_{2}\) concentration in the space.