A Multi ‐ Timescale Bilinear Model for Optimization and Control of HVAC Systems with Consistency

: Reducing the energy consumption of the heating, ventilation, and air conditioning (HVAC) systems while ensuring users’ comfort is of both academic and practical significance. How ‐ ever, the ‐ state ‐ of ‐ the ‐ art of the optimization model of the HVAC system is that either the thermal dynamic model is simplified as a linear model, or the optimization model of the HVAC system is single ‐ timescale, which leads to heavy computation burden. To balance the practicality and the overhead of computation, in this paper, a multi ‐ timescale bilinear model of HVAC systems is pro ‐ posed. To guarantee the consistency of models in different timescales, the fast timescale model is built first with a bilinear form, and then the slow timescale model is induced from the fast one, specifically, with a bilinear ‐ like form. After a simplified replacement made for the bilinear ‐ like part, this problem can be solved by a convexification method. Extensive numerical experiments have been conducted to validate the effectiveness of this model.


Introduction
It has been well known that heating, ventilation, and air conditioning (HVAC) systems, which are widely applied to various buildings, directly affect the user's comfort and are responsible for a large proportion of the building's energy consumption. Over the last several years, the problem of optimizing the energy consumption of HVAC systems while ensuring user's comfort has been extensively investigated [1][2][3][4].
In an HVAC system, the thermal dynamics of a residential house may be modeled at a minute level, while the load profile for the maximum power consumption is usually specified at an hourly level. If the optimization problem of the HVAC system is modeled in single-timescale, the time should be slotted with the length of the smallest timescale (e.g., minute). Clearly, in this case, the number of decision variables increases dramatically, which leads to the curse of dimensionality [5][6][7]. In addition, the thermal dynamic model of the HVAC systems in a building is complex, which may further increase the dimension of optimization problem and the computational complexity [8][9][10][11][12]. References [13,14] proposed a two-timescale stochastic optimization model for control and scheduling the appliances to satisfy user's thermal comfort requirement under the peak power and cost constraints. The two-timescale model could efficiently reduce both the dimension of the problem and its computational complexity. Despite the two-timescale models in [13] and [14] can appropriately characterize the optimization problem of HVAC systems, the consistency of the models in two timescales was not guaranteed. To solve this problem, article [15] improved these two-timescale models and developed a two-timescale induced model to ensure the consistency. The consistency mentioned above refers to the consistent mod-timescale model or the slow timescale model induced reversely from the fast timescale model.
In the above-mentioned research, the thermal dynamic model is simplified as a linear model. Although the linear models are easy to solve, the bilinear models are more practical to describe the thermal dynamics of buildings [16][17][18][19][20]. In [16], a Swiss office building was formulated as a bilinear model to analyze its implementation, results, and cost-benefit under model predictive climate control. In [17], a problem of HVAC control in a typical commercial building was studied, which was formulated as a bilinear model. At present, there already exist some mature algorithms for bilinear system optimization, e.g., dynamic planning and maximum principle. In [18], a sequential quadratic programming method was proposed to solve bilinear HVAC control problems, which is computationally expensive for nonconvex problems and needs a good initialization to achieve local convergence. In [19,20], a convex relaxation method is developed to reduce the computation burden efficiently. The bilinear models in the above articles are modeled in singletimescale.
To make a trade-off between the practicality and the overhead of computation, this paper formulates the optimization problem of HVAC system as a multi-timescale bilinear model. In [15], a multi-timescale linear model is built. The current paper extends the results in [15] to a multi-timescale bilinear model, which is more practical to describe the thermal dynamics of HVAC systems. However, the coupling of multi-timescale and bilinearity makes the induced slow timescale model not be the standard bilinear form. The relationship between the slow timescale model and fast timescale model is clarified, and then the multi-timescale bilinear model can be solved by the convexification method after simplified replacement. In addition, a multi-timescale deterministic model is adopted in this paper against the mixture of the inconsistency deviation and the random error.
The contribution of this paper is formulating the multi-timescale bilinear optimization model of HVAC systems to balance the practicality and the overhead of computation. Based on the induction method for multi-timescale model in [15], the fast timescale bilinear model is built first, and then the slow timescale model is induced from the fast one, in which the consistency of models in different timescales is guaranteed. Compared with single-timescale bilinear models, the proposed model can decrease the computational complexity; while compared with multi-timescale linear models (e.g., [15]), the proposed model can describe the thermal dynamic of HVAC systems more practically and get better optimization results in some cases, and the accuracy and the computational cost are acceptable.
The remainder of this paper is outlined as follows. In Section 2, the multi-timescale HVAC bilinear induced model is formulated. In Section 3, the solution algorithm is introduced. In Section 4, the performance of the proposed strategy is illustrated through case studies. In Section 5, we conclude this paper. Due to space limitation, proofs of theorems are omitted and can be found in [21].

Single-Timescale Bilinear Optimization Model
An HVAC system draws power and drives the indoor temperature by following a thermal dynamic model, and the HVAC control directly affects the user's comfort. The user's comfort in this paper reflects that the deviation from the indoor temperature and the desired temperature of the user is minimized. This paper regulates the indoor temperature by control and decision for HVAC.
Based on a practical building, the HVAC optimization model is built as follows, in which the objective is to improve user's comfort with limited energy. The details can be seen in our previous work [15] and are not repeated here. For simplicity, some random factors are not considered in this paper.
where xk is the indoor temperature at time k. dk is the user's desired temperature at time k. uk is the control variable of HVAC at time k. umax denotes the maximum limit of control variable of HVAC. Umax denotes the maximum total limit of control variable of HVAC. a, b, c are coefficients. Constraint (2) is a bilinear state transfer equation. Bilinear system is a kind of system derived by introducing the product term of state variable and control variable in linear state equation. It is relatively linear to state variable and control variable, respectively, but not linear to state variable and control variable simultaneously. In fact, bilinear system is a special nonlinear system with simple form. Bilinear system model is a promotion from linear system model, which can more practically describe the indoor temperature state transfer process.
In the system, the time domain is divided into two timescales, as shown in Figure 1, where K is the number of time slot in slow timescale, and n is the number of time slot in fast timescale of slow timescale. According to [15], states transfer in fast timescale, that is, the model in (P1) is the fast timescale model, and the slow timescale model should be induced by it. n … ……

Two-Timescale Bilinear induced Model
For simplicity, we select one interval of slow timescale, including four slots of fast timescale, as shown in Figure 2. The standard bilinear state transfer equation of fast timescale is known as (2). The relationship between state variables of slow timescale and fast timescale is assumed as follows.
When the slow timescale state transfers from X[0] to X [1], the fast timescale state transfers from x0 to x4, both of them transfer n times fast timescales.
According to the fast timescale state transfer equations, this transfer process can be described as x ax bu cx u bu abu a bu a x a bu a cx u a cx u a bcu u a c x u u abcuu a cx u a bcu u a c x u u a c x uu abc u uu ac x u uu bcu u abcuu a cx u a bcu u a c x u u Combine (5) with (6) we can obtain the slow timescale state transfers from X[0] to X[1] as follows.
u a cuu a cu u ac u u u ac u u u ac u u u ac u u u The slow timescale bilinear state transfer equation should have been the same form as fast timescale, however, unless in the particular condition that a = 1, there does not exist a uniform control variable U[k] in (7). In other words, the control variables in control term and bilinear term are different, so we describe the two as UB [k] and UC[k], respectively. UB[k] is the second term at the right-hand side of(7), and x0UC[k] is the third term. Comparing UB[k] with UC[k], we find that the former still carries the quality of weighted sum with coefficient a, while the latter reflects such quality similar to simple sum 15.
Therefore, unlike the linear system in our previous work, the slow timescale state transfer equation of bilinear system cannot be described as the standard bilinear state transfer equation, but a bilinear-like form as follows.
where X[k] is the indoor temperature at kth slow timescale. A, B, C are coefficients in slow timescale.
To extend n = 4 to general cases, we formulate the following theorems. (2). The relationship between state variables of slow timescale and fast timescale is X[k] = xnk. Thus, the slow timescale system state equation can be induced as (8), where the coefficients are , ,

Theorem 1. The fast timescale system state equation is
The slow timescale control variable is     (2).

Two-Timescale Bilinear Optimization Model
Based on the proposed theorems in last section, the two-timescale bilinear optimization model is built as follows.
Slow timescale: where D[k] is the desired temperature at kth slow timescale. U c [k] denotes the total of fast timescale control variables of HVAC at kth slow timescale, which is an actual physical quantity. Constraint (12) expresses the energy conversation law. Constraint (13) restricts the maximum limit of the actual consumption of HVAC in the slow timescale.
Fast timescale: Constraint (15) ensures that fast timescale state/control variables satisfy the bilinear state transfer equations. Constraint (10) ensures the consistency of decomposition from the slow timescale to the fast timescale. Constraint (17) ensures that the total consumption of control variables in this period shall not exceed that in the scheduling plan of slow timescale.

Convexification Solution Method
The aforementioned optimization problem is nonconvex due to the bilinear term. To solve this issue, a convex relaxation method is used in this section.

Simplified Constraint
Before convexification, constraint (10) is so complicated that should be simplified to solve. We find that both UB[k] and UC[k] consist of first-order term to n-order term of u. The terms are divided into n = 6 parts in Table 1.  According to the physical meaning of the system, the state variable denotes indoor temperature, the control variable u is related to air flow rate of HVAC, a is a self-loss coefficient, b denotes air temperature from HVAC, K is the number of time slot in slow timescale, so values of u of HVAC are always small rated with other variables. The value of the fourth-order term tends to 0, so the fifth-order to nth-order terms can be ignored. Although the values of second-order term to fourth-order term are small, with numbers of these terms not small, they cannot be ignored simply. For example, the number of u's secondorder terms is C 2 n , the number of u's third-order terms is C 3 n , etc. However, also because these terms have little influence on the whole formula, they can be replaced by two constant terms, CB [

UB[k]
We will make a preliminary estimate roughly whether user can accept the error from the above replacement. Firstly, S2/S1 ≈ C 2 n u 2 /nu = (n − 1)u/2. For example, u ranges [0.05, 0.15], n = 6, S2/S1 ≈ 0.125~0.375. With the value of u small, S2/S1 is small, i.e., the changes of S2 have little influence on S1+S2. The absolute value of relative error of S2 changed before and after is estimated as follows.
where δ denotes the deviation between ue and u, and is generally an order magnitude smaller than u. |δ| is from 0 to [0.005, 0.015], so δ 2 can be ignored. Equation (21) is transformed as follows.
Considering the ranges of u and δ, |εS2| is estimated as 0~[0.02, 0.05]. Thus, the influence of S2 replaced before and after is little for the formula. For the same reason, the influences of S3 and S4 decrease progressively. It will be further illustrated through numerical examples in Chapter IV.
Then, in order to further simplify Equation (10)

Convex Relaxation Method
Another computational issue is the bilinear model always results in nonconvex optimization problem. To solve this issue, some convex relaxation method will be developed.
McCormick Envelopes is a common method of convex relaxation used in bilinear nonlinear programming problem [19,20,[22][23][24][25]. According to the method, the bilinear term can be bounded by its convex and concave envelopes. We need to confirm the upper and lower bound of the bilinear term first.
The optimization objective is to minimize the deviation from indoor temperature and the user's desired temperature, so state variable is constrained within the scope above and below near the user's desired temperature.
The upper and lower bound of control variable is (16). Therefore, the bilinear term xkuk is bounded by The nonconvex problem can be relaxed by replacing the bilinear term xkuk with an additional variable yk. The relaxed state transfer equation is Additional constraints are needed as follows.
It is worth noting that the above convex relaxation method is applied to fast timescale under the default condition, yk = xkuk. However, for slow timescale, there is not The bilinear term in slow timescale is X[k]UC [k], which can also be bounded by its convex and concave envelopes. We confirm its upper and lower bound first.
Similarly, state variable of slow timescale is constrained within the scope above and below near the user's desired temperature.
According to (12) , the relaxed slow timescale state transfer equation is Additional constraint is needed as follows.
To guarantee the consistency of the two-timescale model, additional constraint is needed as follows.

Relaxed Two-Timescale Bilinear Optimization Model
With the aforementioned additional constraints, a modification of (P2)(P3) is proposed below.
Slow timescale: s.t., (12), (13), (18), (35), (36) The solution methodology for the two-timescale optimization problem has been described in our work [15] in details. In brief, after removing the absolute value sign of the objective functions, the slow timescale optimization problem is solved first, and then the fast timescale optimization problem is solved with the results of slow timescale. Based on the linear constraints, we formulate the relaxed model as a linear programming (LP) problem, which can be efficiently solved using Cplex.

Numeric Results
In this chapter, we demonstrate the performance of the two-timescale bilinear optimization model on an HVAC system. For simplicity, we choose one of rooms to illustrate, where a = 0.95, b = 38, c = −1, n = 6, K = 16.

Error Analysis
The error analysis in this section is aimed at the simplified replacement mentioned in III-A. To highlight the problem, we select the kth slow timescale, where X[k] = xnk = 24, D[k + 1] = 25, Δ = 0. According to (10) Solving the kth slow timescale optimization, we can obtain a set of u = [u0, …, u5], and then the numerical values of S1-S6 are shown in Table 2.
The numerical results are shown in Table 3. Moreover, we compare the situation1 that simply deletes S2-S6 with the aforementioned situation2 during the whole optimization process. The indoor temperature of the original formula is regarded as the standard compared with those in the two situations, and the mean absolute percentage error (MAPE) is calculated as follows [26].
The MAPE of state variable are contrasted in Table 4. In summary, the error from the way we make the simplification is acceptable.

Accuracy
The accuracy of the proposed optimization solution will be discussed in this section.
Through simulation, it is found that the value of Δ can directly affect the accuracy of optimization result from the proposed model. The less Δ values, the more accuracy will be. With the decrease of Δ, the range of state variable becomes less, and the bound by convex and concave envelopes is more practical.
The actual indoor temperature from simulation is compared with user's desired temperature and MAPE is calculated for each Δ. The MAPE formula is shown as follows, which sums up all the absolute percentage error for one value and then finds the average. 2 1 100 When Δ = 0,1,2,3, respectively, the MAPEs are shown in Table 5, where Δ = 0 for reference only.
Under different values of Δ, the accuracy of the proposed model are contrasted in Figure 3.  Figure 3 shows the states and the desired temperature under different values in the slow timescale and fast timescale. We see that the deviation from desired temperature become more with the increase of Δ. When Δ < 3, deviations are acceptable.

Comparison with The Linear Model
The results obtained from the proposed bilinear model are compared with those obtained from the linear model in [15]. It should be pointed out that the linear model in [15] is a Jacobian linearization [27] of the bilinear model in the current paper, i.e., the dynamics at every time step are linearized around the equilibrium points of the system. Next, the performances of linear model and bilinear model are compared through numerical results.
If the indoor temperatures at all time could satisfy the desired temperatures, as shown in Figure 4, there does not exist linearization error in the linear model, so whose performance is good in our previous work. Generally speaking, the indoor temperature in slow timescale can meet the desired temperature with sufficient energy budget. However, when the decision result of slow timescale is decomposed in fast timescale, only the states of endpoint in fast timescale can be guaranteed, and the other states would transfer to the endpoint through arbitrary paths, i.e., except the states of endpoint, not all of the other states can meet the desired temperature [15]. At this time, deviation occurs in fast timescale linear model. In the cases mentioned above, the optimization results of the bilinear model and linear model are shown in Figure 5. In slow timescale, we see that all states of linear model satisfy the desired temperatures, and the states of bilinear model also behave well with just acceptable little error. However, in fast timescale, if user set the desired temperatures with fluctuation at the first two periods (k = 1-2) of slow timescale (i.e., kf = 1-12 of fast timescale), and the desired temperatures at the endpoints (kf = 6,12) coincide with that in slow timescale (k = 1,2), there will be great deviation in linear model. Once state cannot meet the desired temperature, linear model will make the following optimization process based on a biased model after that. Since bilinear model is built in practice, following the practical situation well, it can satisfy the desired temperatures within acceptable scope. Under some special circumstances with not sufficient energy budget, where the main aim is not for user comfort, the optimization results are shown in Figure 6.
Because of insufficient energy, states cannot satisfy the desired temperatures both in bilinear model and linear model. As shown in Figure 6, it is obvious that the optimization result of bilinear model is better than linear model. Extensive simulation experiments have been carried out. The results show that the mean computational time of the linear model solution is 2.14 s and of the bilinear model solution is 11.47 s. Although the bilinear model gives better results at the price of more computations, the overhead of computation is acceptable.

Conclusions
A method to build a two-timescale bilinear optimization model for HVAC system is proposed in this paper. The bilinear term generated by bilinear system will couple with two-timescale. Based on a single-timescale convex relaxation method, this paper proposes the two-timescale convex relaxation method after reasonable simplified replacement, which can solve the optimization problem easily and guarantee the consistency. The twotimescale bilinear optimization model is to minimize the deviation from indoor temperature and the user's desired temperature. Case studies demonstrate the performance of the proposed model, which is better than the linear model.

Conflicts of Interest:
The authors declare no conflict of interest.