Abstract:
A heating, ventilation and air-conditioning (HVAC) system for a building is optimized while maximizing a comfort of occupants and minimizing energy consumption. The building is modeled as a network of nodes and edges, wherein the nodes represent rooms, and the edges represent walls. Dynamics of temperatures and humidity in the rooms and the temperature of the walls and the building are modeled using differential equations and the network. The comfort of the occupants is modeled by a predicted mean vote (PMV). The minimizing is formulated as an optimal control problem, which is discretized using an integration technique to obtain a finite dimensional optimization problem. Then, the finite dimensional optimization problem is solved using sparse linear algebra until convergence.

Description:
FIELD OF THE INVENTION 
       [0001]    The present invention relates generally to controlling heating, ventilation and air conditioning (HVAC) systems in buildings, and more particularly to maximizing comfort for building occupants. 
       BACKGROUND OF THE INVENTION 
       [0002]    The comfort of building occupants must be maximized while minimizing energy costs. Most conventional strategies for operating HVAC systems: 
         [0000]    (i) Do not consider the entire system. For instance, the control over multiple rooms in the building is usually decoupled to yield smaller loops over which the control actions are independently solved. This approach fails to consider the full coupling between the subsystems and can lead to poor performance.
 
(ii) Do not consider thermal and humidity dynamics of the building that predict the evolution of temperature humidity over time.
 
(iii) Do not consider occupant comfort metrics, such as a predicted mean vote (PMV), or thermal comfort zones during the determination of the operational strategies, and instead employ set-point based strategies. This can lead to increased energy consumption and discomfort for the occupants.
 
         [0003]    Most model based optimization approaches for determining the HVAC operational strategies: 
         [0000]    (i) Employ linear programming for the optimization, which can fail to fully model the complete dynamics of the system.
 
(ii) Do not include constraints on thermal comfort, such as the PMV, and instead rely on set-points for temperature. This can result in increased energy costs.
 
(iii) When the PMV is used, the model is simplified by linearizing the system equation, which leads to inaccuracies in estimating the true comfort of the occupants. This can result in increased discomfort for the occupants.
 
         [0004]    Thus, there is a need to optimize a building HVAC system, and to consider accurate models of occupant comfort and building thermal and humidity dynamics. 
       SUMMARY OF THE INVENTION 
       [0005]    The embodiments of the invention provide a method for determining an optimal operation of a HVAC system by minimizing energy consumption, while maximizing occupant comfort. The building dynamics are modeled using differential equations that control an evolution of temperatures and humidity in rooms. An energy consumption of the HVAC system is modeled using steady state equations, or differential equations. The occupant comfort is measured using comfort indices such as a predicted mean vote (PMV). 
         [0006]    The PMV determinations involve conditional statements, which result in nonsmooth behavior. Several embodiments for reformulating the conditional statements to computationally tractable forms that are suitable for optimization are provided. A nonlinear program incorporating sparse linear algebra is used to ensure computational efficiency of the method. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0007]      FIG. 1  is floor plan of a building with indoor air conditioners installed in each room and connected with an outdoor unit; 
           [0008]      FIG. 2A  is the floor plan with numbered rooms; 
           [0009]      FIG. 2B  is a graphical representation of the rooms with nodes representing rooms, and edges representing rooms that share a common wall; 
           [0010]      FIG. 3A  is a resistor-capacitor representation of the thermal dynamics of room air; 
           [0011]      FIG. 3B  is a resistor-capacitor representation of the thermal dynamics of the wall in the room; 
           [0012]      FIG. 3C  is a resistor-capacitor representation of the humidity dynamics of room air; 
           [0013]      FIG. 4  is a flowchart of a method for determining optimal operation of an HVAC system; and 
           [0014]      FIG. 5  is a block diagram of a procedure for minimizing electric power consumption of the outdoor unit according to embodiments of the invention. 
       
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
       [0015]    Building Representation 
         [0016]      FIG. 1  shows a floor plan for a building that can be used by embodiments of our invention. The building includes rooms  10  and doors  12 . Each room is equipped with an indoor air conditioning unit  20 . The indoor units are connected to an outdoor unit  26 . A refrigerant is used for cooling or heating room air flows  22  to the indoor units from the outdoor unit. The refrigerant flows (dashed lines)  24  from the indoor unit to the outdoor unit where the heat is dissipated and the refrigerant is recycled back to the indoor unit  22 . 
         [0017]      FIG. 2A  shows a numbering of nine rooms  30  in the building, i.e., 1 to 9. The graph network representation in  FIG. 2B  based on this numbering. Nodes  40  represent the rooms in the building, and edges  42  represent the rooms that share a wall. 
         [0018]      FIG. 3A  provides a resistive capacitive network representation of the building model for thermal and humidity dynamics. The variables used in this figure and other similar figures are described in detail below. 
         [0019]    Input 
         [0020]    As shown in  FIG. 4 , input to the optimization method  410  includes the following for a time period: 
         [0021]    Forecast  401  of hourly weather pattern. 
         [0022]    Equipment heat load forecast  402  for each room. 
         [0023]    Prediction  403  of the occupant heat loads. 
         [0024]    Comfort requirements  404  for the occupants. 
         [0025]    Objectives  405  of the optimization. 
         [0000]    The method uses objectives for the optimization  405  and a model  406 . 
         [0026]    The steps of the method as described herein can be performed in a processor connected to a memory, and input and output interfaces as known in the art. 
         [0027]    Output 
         [0028]    Output  420  of the method includes a time profile of control variables in the model which can include: compressor frequency, air flow rate from each room through the conditioner, and the evolution of the temperatures of the room, temperatures of the walls and humidity in the rooms as a result of choice of prescribed control actions. All temperatures are in degrees centigrade. 
         [0029]    Room Dynamics Model 
         [0030]    In the preferred embodiment, the dynamics of the room are modeled as a set of differential equations. A linear resistive capacity circuit modeling the room temperature dynamics is shown in  FIG. 3A . The thermal dynamics of the room is modeled as 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                          
                         
                           T 
                           z 
                         
                       
                       
                          
                         t 
                       
                     
                     = 
                     
                       
                         
                           
                             T 
                             w 
                           
                           - 
                           
                             T 
                             z 
                           
                         
                         
                           
                             C 
                             z 
                           
                            
                           
                             R 
                             zw 
                           
                         
                       
                       + 
                       
                         
                           
                             
                               m 
                               . 
                             
                             vent 
                           
                            
                           
                             
                               C 
                               p 
                             
                              
                             
                               ( 
                               
                                 
                                   T 
                                   oa 
                                 
                                 - 
                                 
                                   T 
                                   z 
                                 
                               
                               ) 
                             
                           
                         
                         
                           C 
                           z 
                         
                       
                       + 
                       
                         
                           
                             Q 
                             . 
                           
                           sen 
                         
                         
                           C 
                           z 
                         
                       
                       + 
                       
                         
                           
                             Q 
                             . 
                           
                           
                             sen 
                             , 
                             hvac 
                           
                         
                         
                           C 
                           z 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where T z  is the temperature of the room in degrees centigrade, T w  is the temperature of wall in the room, C z  is the heat capacity of the room air in Joules (J) per kilogram (kg), R zw  is the resistance for heat transfer between the zone air and the walls of the zone, T oo  is the ambient air temperature, C p  is the specific heat capacity of air in (J/kg/K), {dot over (m)} vent  is the flow rate of ventilation air in (kg/s), {dot over (Q)} sen  is a rate of sensible heat generated by equipment, occupants in the room and solar radiation through windows, {dot over (Q)} sen,hvac  is a rate of sensible heat transferred to the room air from the indoor air conditioning unit. The dot above the variables indicates the first derivative with respect to time. 
         [0031]    The linear resistive capacity circuit modeling the temperature dynamics of the room wall is shown in  FIG. 3B . The thermal dynamics of the wall in the room is modeled as 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                          
                         
                           T 
                           w 
                         
                       
                       
                          
                         t 
                       
                     
                     = 
                     
                       
                         
                           
                             T 
                             z 
                           
                           - 
                           
                             T 
                             w 
                           
                         
                         
                           
                             C 
                             w 
                           
                            
                           
                             R 
                             zw 
                           
                         
                       
                       + 
                       
                         
                           
                             T 
                             oa 
                           
                           - 
                           
                             T 
                             w 
                           
                         
                         
                           
                             C 
                             w 
                           
                            
                           
                             R 
                             woa 
                           
                         
                       
                       + 
                       
                         
                           
                             Q 
                             . 
                           
                           ins 
                         
                         
                           C 
                           w 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where C w  is the heat capacity of the wall in (J/k), R woa  is the resistance for heat transfer between the wall and ambient air and {dot over (Q)} inv  is the rate of heat transfer from solar radiation to the wall in (W). 
         [0032]    The linear resistive capacity circuit modeling the room humidity dynamics is shown in  FIG. 3C . The humidity dynamics of the room air is modeled as 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                          
                         
                           h 
                           z 
                         
                       
                       
                          
                         t 
                       
                     
                     = 
                     
                       
                         
                           
                             
                               m 
                               . 
                             
                             vent 
                           
                            
                           
                             ( 
                             
                               
                                 h 
                                 oa 
                               
                               - 
                               
                                 h 
                                 z 
                               
                             
                             ) 
                           
                         
                         
                           ρ 
                            
                           
                               
                           
                            
                           
                             V 
                             a 
                           
                         
                       
                       + 
                       
                         
                           
                             Q 
                             . 
                           
                           lat 
                         
                         
                           ρ 
                            
                           
                               
                           
                            
                           
                             V 
                             a 
                           
                            
                           
                             L 
                             v 
                           
                         
                       
                       + 
                       
                         
                           
                             Q 
                             . 
                           
                           
                             lat 
                             , 
                             hvac 
                           
                         
                         
                           ρ 
                            
                           
                               
                           
                            
                           
                             V 
                             a 
                           
                            
                           
                             L 
                             v 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where h z  is the specific humidity of zone air in (kg/kg), ρ is the density of air, V a  is the volume of air in the room, L is the latent heat of evaporation of water in (J/kg), {dot over (Q)} lat  is the rate of latent heat generated by equipment and occupants in the room in (W) and {dot over (Q)} lat,hvac  is the rate of latent heat added to the room air by the indoor air conditioning unit. 
         [0033]    Predicted Mean Vote 
         [0034]    In the preferred embodiment, a predicted mean vote (PMV) is used to measure the occupant comfort, see ANSI/ASHRAE Standard 55-2010, Thermal Environmental Conditions for Human Occupancy. The PMV includes parameters that influence comfort: temperature, relative humidity, air velocity, metabolic rate, mean radiant temperature, and clothing insulation. The PMV measures the thermal comfort of the occupants on a scale of −3 to +−3 with: −3: very cold, −2: cold, −1: slightly cool, 0: neutral, +1: slightly warm, +2: warm, +3: hot. The typical range for different building types is prescribed in the American Society of Heating, Refrigerating and Air-Conditioning Engineers (ASHRAE) standard ISO 7730:2005. 
         [0035]    The PMV is determined by the following equations: 
         [0000]    
       
         
           
             
               
                 
                   PMV 
                   = 
                   
                     
                       ( 
                       
                         
                           0.303 
                            
                           
                              
                             
                               
                                 - 
                                 0.036 
                               
                                
                               
                                   
                               
                                
                               M 
                             
                           
                         
                         + 
                         0.028 
                       
                       ) 
                     
                      
                     
                         
                       
                         
                           [ 
                           
                             
                               ( 
                               
                                 M 
                                 - 
                                 W 
                               
                               ) 
                             
                             - 
                             
                               3.05 
                               × 
                               
                                 10 
                                 
                                   - 
                                   3 
                                 
                               
                                
                               
                                 ( 
                                 
                                   5733 
                                   - 
                                   
                                     6.999 
                                      
                                     
                                       ( 
                                       
                                         M 
                                         - 
                                         W 
                                       
                                       ) 
                                     
                                   
                                   - 
                                   
                                     p 
                                     a 
                                   
                                 
                                 ) 
                               
                             
                             - 
                             
                               0.42 
                                
                               
                                 ( 
                                 
                                   
                                     ( 
                                     
                                       M 
                                       - 
                                       W 
                                     
                                     ) 
                                   
                                   - 
                                   58.15 
                                 
                                 ) 
                               
                             
                             - 
                             
                               1.7 
                               × 
                               
                                 10 
                                 
                                   - 
                                   5 
                                 
                               
                                
                               
                                   
                               
                                
                               
                                 M 
                                  
                                 
                                   ( 
                                   
                                     5867 
                                     - 
                                     
                                       p 
                                       a 
                                     
                                   
                                   ) 
                                 
                               
                             
                             - 
                             
                               0.0014 
                                
                               
                                   
                               
                                
                               
                                 M 
                                  
                                 
                                   ( 
                                   
                                     34 
                                     - 
                                     
                                       T 
                                       z 
                                     
                                   
                                   ) 
                                 
                               
                             
                             - 
                             
                               3.96 
                               × 
                               
                                 10 
                                 
                                   - 
                                   8 
                                 
                               
                                
                               
                                 
                                   f 
                                   cl 
                                 
                                  
                                 
                                   ( 
                                   
                                     
                                       
                                         ( 
                                         
                                           
                                             T 
                                             cl 
                                           
                                           + 
                                           273.15 
                                         
                                         ) 
                                       
                                       4 
                                     
                                     - 
                                     
                                       
                                         ( 
                                         
                                           
                                             
                                               T 
                                               _ 
                                             
                                             r 
                                           
                                           + 
                                           273.15 
                                         
                                         ) 
                                       
                                       4 
                                     
                                   
                                   ) 
                                 
                               
                             
                             - 
                             
                               
                                 f 
                                 cl 
                               
                                
                               
                                 
                                   h 
                                   c 
                                 
                                  
                                 
                                   ( 
                                   
                                     
                                       T 
                                       cl 
                                     
                                     - 
                                     
                                       T 
                                       z 
                                     
                                   
                                   ) 
                                 
                               
                             
                           
                           ] 
                         
                         , 
                       
                     
                   
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
             
               
                 
                   
                     
                       T 
                       cl 
                     
                     = 
                     
                       35.7 
                       - 
                       
                         0.028 
                          
                         
                           ( 
                           
                             M 
                             - 
                             W 
                           
                           ) 
                         
                       
                       - 
                       
                         3.96 
                         × 
                         
                           10 
                           
                             - 
                             8 
                           
                         
                          
                         
                           I 
                           cl 
                         
                          
                         
                           
                             f 
                             cl 
                           
                            
                           
                             ( 
                             
                               
                                 
                                   ( 
                                   
                                     
                                       T 
                                       cl 
                                     
                                     + 
                                     273.15 
                                   
                                   ) 
                                 
                                 4 
                               
                               - 
                               
                                 
                                   ( 
                                   
                                     
                                       
                                         T 
                                         _ 
                                       
                                       r 
                                     
                                     + 
                                     273.15 
                                   
                                   ) 
                                 
                                 4 
                               
                             
                             ) 
                           
                         
                       
                       + 
                       
                         
                           I 
                           cl 
                         
                          
                         
                           f 
                           cl 
                         
                          
                         
                           
                             h 
                             c 
                           
                            
                           
                             ( 
                             
                               
                                 T 
                                 cl 
                               
                               - 
                               
                                 T 
                                 z 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
             
               
                 
                   
                     h 
                     c 
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             
                               
                                 2.38 
                                  
                                 
                                   
                                      
                                     
                                       
                                         T 
                                         cl 
                                       
                                       - 
                                       
                                         T 
                                         z 
                                       
                                     
                                      
                                   
                                   0.25 
                                 
                               
                               , 
                             
                           
                           
                             
                               
                                 if 
                                  
                                 
                                     
                                 
                                  
                                 2.38 
                                  
                                 
                                   
                                      
                                     
                                       
                                         T 
                                         cl 
                                       
                                       - 
                                       
                                         T 
                                         z 
                                       
                                     
                                      
                                   
                                   0.25 
                                 
                               
                               &gt; 
                               
                                 12.1 
                                  
                                 
                                   
                                     v 
                                     ar 
                                   
                                 
                               
                             
                           
                         
                         
                           
                             
                               
                                 12.1 
                                  
                                 
                                   
                                     v 
                                     ar 
                                   
                                 
                               
                               , 
                             
                           
                           
                             
                               
                                 if 
                                  
                                 
                                     
                                 
                                  
                                 2.38 
                                  
                                 
                                   
                                      
                                     
                                       
                                         T 
                                         cl 
                                       
                                       - 
                                       
                                         T 
                                         z 
                                       
                                     
                                      
                                   
                                   0.25 
                                 
                               
                               &lt; 
                               
                                 12.1 
                                  
                                 
                                   
                                     v 
                                     ar 
                                   
                                 
                               
                             
                           
                         
                       
                       , 
                     
                   
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
             
               
                 
                   
                       
                   
                    
                   
                     
                       f 
                       cl 
                     
                     = 
                     
                       { 
                       
                         
                           
                             
                               
                                 
                                   1.00 
                                   + 
                                   
                                     1.29 
                                      
                                     
                                       I 
                                       cl 
                                     
                                   
                                 
                                 , 
                               
                             
                             
                               
                                 
                                   if 
                                    
                                   
                                       
                                   
                                    
                                   
                                     I 
                                     cl 
                                   
                                 
                                 ≤ 
                                 0.078 
                               
                             
                           
                           
                             
                               
                                 
                                   1.05 
                                   + 
                                   
                                     0.645 
                                      
                                     
                                         
                                     
                                      
                                     
                                       I 
                                       cl 
                                     
                                   
                                 
                                 , 
                               
                             
                             
                               
                                 
                                   if 
                                    
                                   
                                       
                                   
                                    
                                   
                                     I 
                                     cl 
                                   
                                 
                                 &gt; 
                                 0.078 
                               
                             
                           
                         
                         , 
                       
                     
                   
                 
               
               
                 
                   ( 
                   7 
                   ) 
                 
               
             
             
               
                 
                   
                       
                   
                    
                   
                     
                       
                         p 
                         a 
                       
                       = 
                       
                         
                           
                             h 
                             z 
                           
                           
                             0.622 
                             + 
                             
                               h 
                               z 
                             
                           
                         
                          
                         
                           p 
                           atm 
                         
                       
                     
                     , 
                   
                 
               
               
                 
                   ( 
                   8 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where T z  is the temperature of the room, h z  is the absolute specific humidity in the room, M is the metabolic rate in (W/m 2 ), W is the effective mechanical power in (W/m 2 ), I cl  is the clothing insulation in (m 2 k/W), f cl  is the clothing area factor,  T   r  is the mean radiant temperature, v ar  is the relative air velocity in the room in (m/s), h c  is the convective heat transfer coefficient in (W/m 2 /K), p a  is the water vapor partial pressure in atmospheres (atm), T cl  is the clothing surface temperature, and p atm  is the atmospheric pressure in (atm). 
         [0036]    In the PMV model equations, M, W, I cl , f cl  are parameters that are specified by the type of activity, e.g., sedentary office work, vigorous workout, that occurs in the room and clothing insulation material that is worn by the occupants in the room. These are not decision variables in the optimization problem. Although Eq. (7) has conditional statement, the value of f cl  can be determined a priori for the entire period over which the optimization is performed. 
         [0037]    However, Eq. (6) involves conditional statements involving the decision variables in the optimization problem T z , T cl . One approach to handle this is to add binary variables to the optimization problem and express the conditional statement as 
         [0000]        zε{ 0,1} 
         [0000]      2.38| T   cl   −T   z | 0.25 ≧(12.1√{square root over ( v   ar )}) z  
 
         [0000]        h   c =(2.38| T   cl   −T   z | 0.25 ) z+ 12.1√{square root over ( v   ar )}(1− z ).  (9)
 
         [0038]    If z=1 in Eq. (9), then the first condition in Eq. (6) is enforced and consequently, h c =2.38|T cl −T z | 0.25 . If z=0, then the second conditional in Eq. (6) is enforced and consequently, h c =12.1√{square root over (v ar )}. With this modification, the optimization problem using PMV indices and Eq. (9) will fall in the class of mixed integer nonlinear programs (MINLPs), which are typically computationally complex. 
         [0039]    To address the computational intractability of binary variable based modeling, while still retaining the original PMV formulation, we pose the conditional statement as 
         [0000]        h   c =max(2.38| T   cl   −T   z | 0.25 ,12.1√{square root over ( v   ar )}).  (10)
 
         [0040]    This expresses the conditional statement in Eq. (6) but does not allow continuous optimization because Eq. (10) is not smooth. To address this concern, we first consider the following exact reformulation: 
         [0000]    
       
         
           
             
               
                 
                   
                     h 
                     c 
                   
                   = 
                   
                     
                       1 
                       2 
                     
                      
                     
                       
                         ( 
                         
                           
                             
                               
                                 
                                   2.38 
                                    
                                   
                                     
                                        
                                       
                                         
                                           T 
                                           cl 
                                         
                                         - 
                                         
                                           T 
                                           z 
                                         
                                       
                                        
                                     
                                     0.25 
                                   
                                 
                                 + 
                                 
                                   12.1 
                                    
                                   
                                     
                                       v 
                                       ar 
                                     
                                   
                                 
                                 + 
                               
                             
                           
                           
                             
                               
                                 
                                   
                                     ( 
                                     
                                       
                                         2.38 
                                          
                                         
                                           
                                              
                                             
                                               
                                                 T 
                                                 cl 
                                               
                                               - 
                                               
                                                 T 
                                                 z 
                                               
                                             
                                              
                                           
                                           0.25 
                                         
                                       
                                       - 
                                       
                                         12.1 
                                          
                                         
                                           
                                             v 
                                             ar 
                                           
                                         
                                       
                                     
                                     ) 
                                   
                                   2 
                                 
                               
                             
                           
                         
                         ) 
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   11 
                   ) 
                 
               
             
           
         
       
     
         [0041]    It can be verified in Eq. (11) that if the first conditional in Eq. (6) holds, then h c =2.38|T cl −T z | 0.25 . On the other hand, if the second conditional in Eq. (6) holds, then h c =12.1√{square root over (v ar )}. Eq. (11) is differentiable everywhere except at 2.38|T cl −T z | 0.25 =12.1√{square root over (v ar )} because the square root function is not differentiable at 0. This point of non-differentiability is problematic for continuous optimization. To address this concern, the smoothing procedure is applied to Eq. (11) as 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       h 
                       c 
                     
                     = 
                     
                       
                         1 
                         2 
                       
                        
                       
                         ( 
                         
                           
                             
                               
                                 
                                   2.38 
                                    
                                   
                                     
                                        
                                       
                                         
                                           T 
                                           cl 
                                         
                                         - 
                                         
                                           T 
                                           z 
                                         
                                       
                                        
                                     
                                     0.25 
                                   
                                 
                                 + 
                                 
                                   12.1 
                                    
                                   
                                     
                                       v 
                                       ar 
                                     
                                   
                                 
                                 + 
                               
                             
                           
                           
                             
                               
                                 
                                   
                                     
                                       ( 
                                       
                                         
                                           2.38 
                                            
                                           
                                             
                                                
                                               
                                                 
                                                   T 
                                                   cl 
                                                 
                                                 - 
                                                 
                                                   T 
                                                   z 
                                                 
                                               
                                                
                                             
                                             0.25 
                                           
                                         
                                         - 
                                         
                                           12.1 
                                            
                                           
                                             
                                               v 
                                               ar 
                                             
                                           
                                         
                                       
                                       ) 
                                     
                                     2 
                                   
                                   + 
                                   
                                     τ 
                                     2 
                                   
                                 
                               
                             
                           
                         
                         ) 
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   12 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where τ&gt;0 is the smoothing parameter. For all τ&gt;0. Eq. (12) is differentiable everywhere and the continuous optimization algorithms can be readily applied. Because the smoothing parameter τ&gt;0 has to be driven to zero to recover Eq. (6), the method solves a sequence of optimization problem where the value of the smoothing parameter is monotonically decreased. This provides an accurate method for handling the nonsmooth conditional in Eq. (6) and uses continuous optimization algorithms, which are computationally efficient. 
         [0042]    A third approach handles the nonsmooth conditionals in Eq. (10) by writing the max operator as 
         [0000]    
       
         
           
             
               
                 
                   
                     z 
                     = 
                     
                       arg 
                        
                       
                           
                       
                        
                       
                         
                           min 
                           
                             0 
                             ≤ 
                             y 
                             ≤ 
                             1 
                           
                         
                          
                         
                             
                         
                          
                         
                           
                             ( 
                             
                               
                                 
                                   - 
                                   2.38 
                                 
                                  
                                 
                                   
                                      
                                     
                                       
                                         T 
                                         cl 
                                       
                                       - 
                                       
                                         T 
                                         z 
                                       
                                     
                                     ⌉ 
                                   
                                   0.25 
                                 
                               
                               + 
                               
                                 12.1 
                                  
                                 
                                   
                                     v 
                                     ar 
                                   
                                 
                               
                             
                             ) 
                           
                            
                           y 
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       h 
                       c 
                     
                     = 
                     
                       
                         
                           ( 
                           
                             2.38 
                              
                             
                               
                                  
                                 
                                   
                                     T 
                                     cl 
                                   
                                   - 
                                   
                                     T 
                                     z 
                                   
                                 
                                  
                               
                               0.25 
                             
                           
                           ) 
                         
                          
                         z 
                       
                       + 
                       
                         12.1 
                          
                         
                           
                             v 
                             ar 
                           
                         
                          
                         
                           
                             ( 
                             
                               1 
                               - 
                               z 
                             
                             ) 
                           
                           . 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   13 
                   ) 
                 
               
             
           
         
       
     
         [0043]    In Eq. (13), if the first conditional of Eq. (6) is satisfied, then 
         [0000]        z= 1 and  h   c =2.38| T   cl   −T   z | 0.25    
         [0000]    holds. If the second conditional in Eq. (6) is satisfied, then 
         [0000]        z= 0 and  h   c =12.1√{square root over ( v   ar )},
 
         [0044]    This formulation is still not convenient for optimization. Therefore, we replace the minimization in Eq. (13) with the first order stationary conditions as 
         [0000]      −2.38| T   cl   −T   z | 0.25 +12.1√{square root over ( v   ar )}−λ+ v= 0
 
         [0000]      λ≧0⊥ z≧ 0
 
         [0000]        v≧ 0⊥ z≦ 1
 
         [0000]        h   c =(2.38| T   cl   −T   z | 0.25 ) z+ 12.1√{square root over ( v   ar )}(1− z ).  (14)
 
         [0045]    In Eq. (14), λ≧0⊥z≧0 is a complementarity constraint equivalent to λ, z≧0, λz=0, In other words, λ=0 or z=0. Similarly, the other complementarity condition v≧0⊥z≦1 implies that v=0 or z=1. When these two conditions are taken together it can be seen that λ, v&gt;0 cannot occur since the complementarity conditions will imply that z=0 and z=1. If the first conditional in Eq. (6) holds, then v=12.1√{square root over (v ar )}−2.38|T cl −T z | 0.25  and λ=0, which implies that z=1 and h c =2.38|T cl −T z | 0.25  holds. The case of the second conditional in Eq. (6) holding can be similarly verified. 
         [0046]    Complementarity conditions are difficult to handle within optimization problems. A conventional approach relaxes the conditional statements 
         [0000]      −2.38| T   cl   −T   z | 0.25 +12.1√{square root over ( v   ar )}−λ+ v= 0
 
         [0000]      λ, z≧ 0,λ z≦τ 
 
         [0000]        v≧ 0, z≦ 1, v (1− z )≦τ
 
         [0000]        h   c =(2.38| T   cl   −T   z | 0.25 ) z+ 12.1√{square root over ( v   ar )}(1− z )  (15)
 
         [0000]    where τ&gt;0 is a relaxation parameter. For all τ&gt;0, Eq. (15) provides a strictly feasible interior to the optimization problems and continuous optimization can be readily applied. Because the smoothing parameter τ&gt;0 has to be driven to zero to recover Eq. (6), the method solves a sequence of optimization problem where the value of the smoothing parameter is monotonically decreased. This provides an accurate method for handling the nonsmooth conditional in Eq. (6) and uses continuous optimization, which is computationally efficient. 
         [0047]    A fourth approach to handle the conditionals in Eq. (6) is to simplify the equations. Typically, the temperature difference between the zone air and clothing in the room |T z −T cl | is less than 5 degrees C. Further, in air conditioned rooms, the relative velocity of the air v ar  is typically 0.1 m/s. For these conditions, it can be assumed that the second conditional is satisfied and consequently, we simplify the conditionals in Eq. (6) as 
         [0000]        h   c =12.1√{square root over ( v   ar )}.  (16)
 
         [0048]    Building Dynamics and Occupant Comfort Model 
         [0049]    In the preferred embodiment, the dynamical model for a building includes N: rooms and N, walls represented as 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                          
                         
                           T 
                           
                             z 
                             , 
                             i 
                           
                         
                       
                       
                          
                         t 
                       
                     
                     = 
                     
                       
                         
                           
                             ∑ 
                             
                               j 
                               : 
                               
                                 j 
                                 ~ 
                                 i 
                               
                             
                             
                                 
                             
                           
                            
                           
                               
                           
                            
                           
                             
                               
                                 T 
                                 
                                   w 
                                   , 
                                   j 
                                 
                               
                               - 
                               
                                 T 
                                 
                                   z 
                                   , 
                                   i 
                                 
                               
                             
                             
                               
                                 C 
                                 
                                   z 
                                   , 
                                   i 
                                 
                               
                                
                               
                                 R 
                                 
                                   zw 
                                   , 
                                   ij 
                                 
                               
                             
                           
                         
                         + 
                         
                           
                             
                               
                                 m 
                                 . 
                               
                               
                                 vent 
                                 , 
                                 i 
                               
                             
                              
                             
                               
                                 C 
                                 p 
                               
                                
                               
                                 ( 
                                 
                                   
                                     T 
                                     oa 
                                   
                                   - 
                                   
                                     T 
                                     
                                       z 
                                       , 
                                       i 
                                     
                                   
                                 
                                 ) 
                               
                             
                           
                           
                             C 
                             
                               z 
                               , 
                               i 
                             
                           
                         
                         + 
                         
                           
                             
                               Q 
                               . 
                             
                             
                               sen 
                               , 
                               i 
                             
                           
                           
                             C 
                             
                               z 
                               , 
                               i 
                             
                           
                         
                         + 
                         
                           
                             
                               
                                 Q 
                                 . 
                               
                               
                                 sen 
                                 , 
                                 hvac 
                                 , 
                                 i 
                               
                             
                             
                               C 
                               
                                 z 
                                 , 
                                 i 
                               
                             
                           
                            
                           
                             ∀ 
                             i 
                           
                         
                       
                       = 
                       1 
                     
                   
                   , 
                   
                       
                   
                    
                   … 
                    
                   
                       
                   
                   , 
                   
                     N 
                     z 
                   
                   , 
                 
               
               
                 
                   ( 
                   17 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where the differential variables the subscript i denotes a quantity associated with a room, subscript j denotes a quantity associated with a wall, subscript ij denotes a quantity associated with room i and wall j and notation j:i˜j denotes the set of (i,j) that such that room i has wall j. In the above, T z,i  represent the air temperature in room i, T w,j  represents the temperature of wall j, {dot over (Q)} sen,i  represents the rate of sensible heat generation from equipment, occupants and solar radiation through windows, {dot over (Q)} sen,hvac  represent the rate of sensible heating delivered by the air conditioner in room i, {dot over (m)} vent,i  is the ventilation air flow rate from room i, C z,i  is the heat capacity of air in room i and R zw,ij  is the resistance for heat transfer between air in room i and wall j. 
         [0050]    The thermal dynamics of the wall in the building are represented as 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                          
                         
                           T 
                           
                             w 
                             , 
                             j 
                           
                         
                       
                       
                          
                         t 
                       
                     
                     = 
                     
                       
                         
                           
                             ∑ 
                             
                               i 
                               : 
                               
                                 j 
                                 ~ 
                                 i 
                               
                             
                             
                                 
                             
                           
                            
                           
                             
                               
                                 T 
                                 
                                   z 
                                   , 
                                   i 
                                 
                               
                               - 
                               
                                 T 
                                 
                                   w 
                                   , 
                                   j 
                                 
                               
                             
                             
                               
                                 C 
                                 
                                   w 
                                   , 
                                   j 
                                 
                               
                                
                               
                                 R 
                                 
                                   zw 
                                   , 
                                   ij 
                                 
                               
                             
                           
                         
                         + 
                         
                           
                             
                               T 
                               oa 
                             
                             - 
                             
                               T 
                               
                                 w 
                                 , 
                                 j 
                               
                             
                           
                           
                             
                               C 
                               
                                 w 
                                 , 
                                 j 
                               
                             
                              
                             
                               R 
                               
                                 woa 
                                 , 
                                 j 
                               
                             
                           
                         
                         + 
                         
                           
                             
                               
                                 Q 
                                 . 
                               
                               
                                 ins 
                                 , 
                                 j 
                               
                             
                             
                               C 
                               
                                 w 
                                 , 
                                 j 
                               
                             
                           
                            
                           
                             ∀ 
                             j 
                           
                         
                       
                       = 
                       1 
                     
                   
                   , 
                   … 
                    
                   
                       
                   
                   , 
                   
                     N 
                     w 
                   
                   , 
                 
               
               
                 
                   ( 
                   18 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where C w,j  represents the heat capacity of wall j, R woa,j  represents the resistance for heat transfer between the wall j and the outside air, {dot over (Q)}inv,i is the rate of heat gain on wall j from solar radiation, and notation i:i˜j denotes the set of (i,j) that such that room i has wall j. 
         [0051]    The humidity dynamics of the rooms in the building are represented as 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                          
                         
                           T 
                           
                             z 
                             , 
                             i 
                           
                         
                       
                       
                          
                         t 
                       
                     
                     = 
                     
                       
                         
                           
                             
                               
                                 m 
                                 . 
                               
                               
                                 vent 
                                 , 
                                 i 
                               
                             
                              
                             
                               ( 
                               
                                 
                                   h 
                                   oa 
                                 
                                 - 
                                 
                                   h 
                                   
                                     z 
                                     , 
                                     i 
                                   
                                 
                               
                               ) 
                             
                           
                           
                             ρ 
                              
                             
                                 
                             
                              
                             
                               V 
                               
                                 a 
                                 , 
                                 i 
                               
                             
                           
                         
                         + 
                         
                           
                             
                               Q 
                               . 
                             
                             
                               lat 
                               , 
                               i 
                             
                           
                           
                             ρ 
                              
                             
                                 
                             
                              
                             
                               V 
                               
                                 a 
                                 , 
                                 i 
                               
                             
                              
                             
                               L 
                               v 
                             
                           
                         
                         + 
                         
                           
                             
                               
                                 Q 
                                 . 
                               
                               
                                 lat 
                                 , 
                                 hvac 
                                 , 
                                 i 
                               
                             
                             
                               ρ 
                                
                               
                                   
                               
                                
                               
                                 V 
                                 
                                   a 
                                   , 
                                   i 
                                 
                               
                                
                               
                                 L 
                                 v 
                               
                             
                           
                            
                           
                             ∀ 
                             i 
                           
                         
                       
                       = 
                       1 
                     
                   
                   , 
                   … 
                    
                   
                       
                   
                   , 
                   
                     N 
                     z 
                   
                   , 
                 
               
               
                 
                   ( 
                   19 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where h z,i  is the humidity of the air in room i, V a,i  is the volume of air in room i, {dot over (Q)} lat,i  is the rate of heat generated by equipment, occupants in room i, and {dot over (Q)} lat,hvac,i  is the rate of latent heat delivered by the air conditioner in room i. 
         [0052]    The occupant comfort model for all rooms in the building is represented as 
         [0000]    
       
         
           
             
               
                 
                   
                     PMV 
                     i 
                   
                   = 
                   
                     
                       ( 
                       
                         
                           0.303 
                            
                           
                               
                           
                            
                           
                              
                             
                               
                                 - 
                                 0.036 
                               
                                
                               
                                   
                               
                                
                               
                                 M 
                                 i 
                               
                             
                           
                         
                         + 
                         0.028 
                       
                       ) 
                     
                     [ 
                     
                         
                     
                      
                     
                       
                         ( 
                         
                           
                             M 
                             i 
                           
                           - 
                           
                             W 
                             i 
                           
                         
                         ) 
                       
                       - 
                       
                         3.05 
                         × 
                         
                           10 
                           
                             - 
                             3 
                           
                         
                          
                         
                           ( 
                           
                             5733 
                             - 
                             
                               6.999 
                                
                               
                                 ( 
                                 
                                   
                                     M 
                                     i 
                                   
                                   - 
                                   
                                     W 
                                     i 
                                   
                                 
                                 ) 
                               
                             
                             - 
                             
                               p 
                               
                                 a 
                                 , 
                                 i 
                               
                             
                           
                           ) 
                         
                       
                       - 
                       
                         0.42 
                          
                         
                           ( 
                           
                             
                               ( 
                               
                                 
                                   M 
                                   i 
                                 
                                 - 
                                 
                                   W 
                                   i 
                                 
                               
                               ) 
                             
                             - 
                             58.15 
                           
                           ) 
                         
                       
                       - 
                       
                         1.7 
                         × 
                         
                           10 
                           
                             - 
                             5 
                           
                         
                          
                         
                           
                             M 
                             i 
                           
                            
                           
                             ( 
                             
                               5867 
                               - 
                               
                                 p 
                                 
                                   a 
                                   , 
                                   i 
                                 
                               
                             
                             ) 
                           
                         
                       
                       - 
                       
                         0.0014 
                          
                         
                             
                         
                          
                         
                           
                             M 
                             i 
                           
                            
                           
                             ( 
                             
                               34 
                               - 
                               
                                 T 
                                 
                                   z 
                                   , 
                                   i 
                                 
                               
                             
                             ) 
                           
                         
                       
                       - 
                       
                         3.96 
                         × 
                         
                           10 
                           
                             - 
                             8 
                           
                         
                          
                         
                           
                             f 
                             
                               cl 
                               , 
                               i 
                             
                           
                            
                           
                             ( 
                             
                               
                                 
                                   ( 
                                   
                                     
                                       T 
                                       
                                         cl 
                                         , 
                                         i 
                                       
                                     
                                     + 
                                     273.15 
                                   
                                   ) 
                                 
                                 4 
                               
                               - 
                               
                                 
                                   ( 
                                   
                                     
                                       
                                         T 
                                         _ 
                                       
                                       
                                         r 
                                         , 
                                         i 
                                       
                                     
                                     + 
                                     273.15 
                                   
                                   ) 
                                 
                                 4 
                               
                             
                             ) 
                           
                         
                       
                       - 
                       
                         
                           f 
                           
                             cl 
                             , 
                             i 
                           
                         
                          
                         
                           
                             h 
                             
                               c 
                               , 
                               i 
                             
                           
                            
                           
                             ( 
                             
                               
                                 T 
                                 
                                   cl 
                                   , 
                                   i 
                                 
                               
                               - 
                               
                                 T 
                                 
                                   z 
                                   , 
                                   i 
                                 
                               
                             
                             ) 
                           
                         
                       
                     
                     ] 
                   
                 
               
               
                 
                   ( 
                   20 
                   ) 
                 
               
             
             
               
                 
                   
                       
                   
                    
                   
                     
                       
                         ∀ 
                         i 
                       
                       = 
                       1 
                     
                     , 
                     … 
                      
                     
                         
                     
                     , 
                     
                       N 
                       z 
                     
                     , 
                   
                 
               
               
                 
                     
                 
               
             
             
               
                 
                   
                     
                       T 
                       
                         cl 
                         , 
                         i 
                       
                     
                     = 
                     
                       
                         35.7 
                         - 
                         
                           0028 
                            
                           
                             ( 
                             
                               
                                 M 
                                 i 
                               
                               - 
                               
                                 W 
                                 i 
                               
                             
                             ) 
                           
                         
                         - 
                         
                           3.96 
                           × 
                           
                             10 
                             
                               - 
                               8 
                             
                           
                            
                           
                             I 
                             
                               cl 
                               , 
                               i 
                             
                           
                            
                           
                             
                               f 
                               
                                 cl 
                                 , 
                                 i 
                               
                             
                              
                             
                               ( 
                               
                                 
                                   
                                     ( 
                                     
                                       
                                         T 
                                         
                                           cl 
                                           , 
                                           i 
                                         
                                       
                                       + 
                                       273.15 
                                     
                                     ) 
                                   
                                   4 
                                 
                                 - 
                                 
                                   
                                     ( 
                                     
                                       
                                         
                                           T 
                                           _ 
                                         
                                         
                                           r 
                                           , 
                                           i 
                                         
                                       
                                       + 
                                       273.15 
                                     
                                     ) 
                                   
                                   4 
                                 
                               
                               ) 
                             
                           
                         
                         + 
                         
                           
                             I 
                             
                               cl 
                               , 
                               i 
                             
                           
                            
                           
                             f 
                             
                               cl 
                               , 
                               i 
                             
                           
                            
                           
                             
                               h 
                               
                                 c 
                                 , 
                                 i 
                               
                             
                              
                             
                               ( 
                               
                                 
                                   T 
                                   
                                     cl 
                                     , 
                                     i 
                                   
                                 
                                 - 
                                 
                                   T 
                                   
                                     z 
                                     , 
                                     i 
                                   
                                 
                               
                               ) 
                             
                           
                            
                           
                             ∀ 
                             i 
                           
                         
                       
                       = 
                       1 
                     
                   
                   , 
                   … 
                    
                   
                       
                   
                   , 
                   
                     N 
                     z 
                   
                   , 
                 
               
               
                 
                   ( 
                   21 
                   ) 
                 
               
             
             
               
                 
                   
                     h 
                     
                       c 
                       , 
                       i 
                     
                   
                   = 
                   
                     { 
                     
                       
                         
                           
                             
                               
                                 2.38 
                                  
                                 
                                   
                                      
                                     
                                       
                                         T 
                                         
                                           cl 
                                           , 
                                           i 
                                         
                                       
                                       - 
                                       
                                         T 
                                         
                                           z 
                                           , 
                                           i 
                                         
                                       
                                     
                                      
                                   
                                   0.25 
                                 
                               
                               , 
                               
                                 
                                   if 
                                    
                                   
                                       
                                   
                                    
                                   2.38 
                                    
                                   
                                     
                                        
                                       
                                         
                                           T 
                                           
                                             cl 
                                             , 
                                             i 
                                           
                                         
                                         - 
                                         
                                           T 
                                           
                                             z 
                                             , 
                                             i 
                                           
                                         
                                       
                                        
                                     
                                     0.25 
                                   
                                 
                                 &gt; 
                                 
                                   12.1 
                                    
                                   
                                     
                                       v 
                                       
                                         ar 
                                         , 
                                         i 
                                       
                                     
                                   
                                 
                               
                             
                           
                         
                         
                           
                             
                               
                                 12.1 
                                  
                                 
                                   
                                     v 
                                     
                                       ar 
                                       , 
                                       i 
                                     
                                   
                                 
                               
                               , 
                               
                                 
                                   if 
                                    
                                   
                                       
                                   
                                    
                                   2.38 
                                    
                                   
                                     
                                        
                                       
                                         
                                           T 
                                           
                                             cl 
                                             , 
                                             i 
                                           
                                         
                                         - 
                                         
                                           T 
                                           
                                             z 
                                             , 
                                             i 
                                           
                                         
                                       
                                        
                                     
                                     0.25 
                                   
                                 
                                 &lt; 
                                 
                                   12.1 
                                    
                                   
                                     
                                       v 
                                       
                                         ar 
                                         , 
                                         i 
                                       
                                     
                                   
                                 
                               
                             
                           
                         
                       
                       , 
                     
                   
                 
               
               
                 
                   ( 
                   22 
                   ) 
                 
               
             
             
               
                 
                   
                       
                   
                    
                   
                     
                       f 
                       
                         cl 
                         , 
                         i 
                       
                     
                     = 
                     
                       { 
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       1.00 
                                       + 
                                       
                                         1.29 
                                          
                                         
                                             
                                         
                                          
                                         
                                           I 
                                           
                                             cl 
                                             , 
                                             i 
                                           
                                         
                                       
                                     
                                     , 
                                   
                                 
                                 
                                   
                                     
                                       if 
                                        
                                       
                                           
                                       
                                        
                                       
                                         I 
                                         
                                           cl 
                                           , 
                                           i 
                                         
                                       
                                     
                                     ≤ 
                                     0.078 
                                   
                                 
                               
                               
                                 
                                   
                                     
                                       1.05 
                                       + 
                                       
                                         0.645 
                                          
                                         
                                             
                                         
                                          
                                         
                                           I 
                                           
                                             cl 
                                             , 
                                             i 
                                           
                                         
                                       
                                     
                                     , 
                                   
                                 
                                 
                                   
                                     
                                       if 
                                        
                                       
                                           
                                       
                                        
                                       
                                         I 
                                         
                                           cl 
                                           , 
                                           i 
                                         
                                       
                                     
                                     &gt; 
                                     0.078 
                                   
                                 
                               
                             
                              
                             
                               ∀ 
                               i 
                             
                           
                           = 
                           1 
                         
                         , 
                         … 
                          
                         
                             
                         
                         , 
                         
                           N 
                           z 
                         
                         , 
                       
                     
                   
                 
               
               
                 
                   ( 
                   23 
                   ) 
                 
               
             
             
               
                 
                   
                       
                   
                    
                   
                     
                       
                         p 
                         
                           a 
                           , 
                           i 
                         
                       
                       = 
                       
                         
                           
                             
                               h 
                               
                                 z 
                                 , 
                                 i 
                               
                             
                             
                               0.622 
                               + 
                               
                                 h 
                                 
                                   z 
                                   , 
                                   i 
                                 
                               
                             
                           
                            
                           
                             p 
                             atm 
                           
                            
                           
                             ∀ 
                             i 
                           
                         
                         = 
                         1 
                       
                     
                     , 
                     … 
                      
                     
                         
                     
                     , 
                     
                       N 
                       z 
                     
                     , 
                   
                 
               
               
                 
                   ( 
                   24 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where for room i, PMV i  is the predicted mean vote index for occupants in the room, M i  is the metabolic rate in (W/m 2 ) for occupants in the room, W i  is the effective mechanical power in (W/m 2 ) in the room, I cl,i  is the clothing insulation in (m 2 K/W) in the room, f cl,i  is the clothing area factor in the room,  T   r,i  is the mean radiant temperature in the room, v ar,i  is the relative air velocity in the room in (m/s), h c,i  is the convective heat transfer coefficient in (W/m 2 /K), p a,i  is the water vapor partial pressure in (atm) in the room, T cl,i  is the clothing surface temperature in the room. 
         [0053]    HVAC Outdoor and Indoor Unit 
         [0054]    In the preferred embodiment, the outdoor and indoor units are modeled as 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         P 
                         hvac 
                       
                       = 
                       
                         
                           a 
                           0 
                         
                         + 
                         
                           
                             a 
                             1 
                           
                           * 
                           
                             T 
                             oa 
                           
                         
                         + 
                         
                           
                             a 
                             2 
                           
                           * 
                           Cf 
                         
                       
                     
                      
                     
                       
 
                     
                      
                     
                       
                         
                           Q 
                           . 
                         
                         
                           all 
                           , 
                           hvac 
                         
                       
                       = 
                       
                         
                           b 
                           0 
                         
                         + 
                         
                           
                             b 
                             1 
                           
                           * 
                           
                             T 
                             oa 
                           
                         
                         + 
                         
                           
                             b 
                             2 
                           
                           * 
                           
                             C 
                             f 
                           
                         
                       
                     
                      
                     
                       
 
                     
                      
                     
                       X 
                       cond 
                     
                     = 
                     
                       
                         
                           Δ 
                            
                           
                               
                           
                            
                           X 
                         
                         
                           Δ 
                            
                           
                               
                           
                            
                           H 
                         
                       
                        
                       
                         
                           Q 
                           . 
                         
                         
                           all 
                           , 
                           hvac 
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       Δ 
                        
                       
                           
                       
                        
                       X 
                     
                     = 
                     
                       
                         
                           
                             ∑ 
                             
                               i 
                               = 
                               1 
                             
                             
                               N 
                               z 
                             
                           
                            
                           
                               
                           
                            
                           
                             
                               
                                 m 
                                 . 
                               
                               
                                 hvac 
                                 , 
                                 i 
                               
                             
                              
                             
                               h 
                               
                                 z 
                                 , 
                                 i 
                               
                             
                           
                         
                         - 
                         
                           
                             ∑ 
                             
                               i 
                               = 
                               1 
                             
                             
                               N 
                               z 
                             
                           
                            
                           
                             
                               
                                 m 
                                 . 
                               
                               
                                 hvac 
                                 , 
                                 i 
                               
                             
                              
                             
                               h 
                               out 
                             
                           
                         
                       
                       
                         
                           ∑ 
                           
                             i 
                             = 
                             1 
                           
                           
                             N 
                             z 
                           
                         
                          
                         
                           
                             m 
                             . 
                           
                           
                             hvac 
                             , 
                             i 
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       RH 
                       out 
                     
                     = 
                     
                       
                         h 
                         out 
                       
                       
                         0.622 
                         + 
                         
                           h 
                           out 
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       Δ 
                        
                       
                           
                       
                        
                       H 
                     
                     = 
                     
                       
                         
                           ∑ 
                           
                             i 
                             = 
                             1 
                           
                           
                             N 
                             z 
                           
                         
                          
                         
                           
                             
                               m 
                               . 
                             
                             
                               hvac 
                               , 
                               i 
                             
                           
                            
                           
                             H 
                             
                               z 
                               , 
                               i 
                             
                           
                         
                       
                       - 
                       
                         
                           ∑ 
                           
                             i 
                             = 
                             1 
                           
                           
                             N 
                             z 
                           
                         
                          
                         
                           
                             
                               m 
                               . 
                             
                             
                               hvac 
                               , 
                               i 
                             
                           
                            
                           
                             H 
                             
                               z 
                               , 
                               out 
                             
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       H 
                       
                         z 
                         , 
                         i 
                       
                     
                     = 
                     
                       
                         
                           C 
                           p 
                         
                          
                         
                           T 
                           
                             z 
                             , 
                             i 
                           
                         
                       
                       + 
                       
                         
                           h 
                           
                             z 
                             , 
                             i 
                           
                         
                          
                         
                           ( 
                           
                             
                               
                                 C 
                                 pw 
                               
                                
                               
                                 T 
                                 
                                   z 
                                   , 
                                   i 
                                 
                               
                             
                             + 
                             
                               L 
                               v 
                             
                           
                           ) 
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       H 
                       
                         z 
                         , 
                         out 
                       
                     
                     = 
                     
                       
                         
                           C 
                           p 
                         
                          
                         
                           T 
                           
                             z 
                             , 
                             i 
                           
                         
                       
                       + 
                       
                         
                           h 
                           
                             z 
                             , 
                             out 
                           
                         
                          
                         
                           ( 
                           
                             
                               
                                 C 
                                 pw 
                               
                                
                               
                                 T 
                                 out 
                               
                             
                             + 
                             
                               L 
                               v 
                             
                           
                           ) 
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       T 
                       out 
                     
                     = 
                     
                       
                         
                           ( 
                           
                             1 
                             - 
                             BPF 
                           
                           ) 
                         
                         * 
                         
                           T 
                           cond 
                         
                       
                       + 
                       
                         
                           
                             ∑ 
                             
                               i 
                               = 
                               1 
                             
                             
                               N 
                               z 
                             
                           
                            
                           
                             
                               
                                 m 
                                 . 
                               
                               
                                 hvac 
                                 , 
                                 i 
                               
                             
                              
                             
                               T 
                               
                                 z 
                                 , 
                                 i 
                               
                             
                           
                         
                         
                           
                             ∑ 
                             
                               i 
                               = 
                               1 
                             
                             
                               N 
                               z 
                             
                           
                            
                           
                             
                               m 
                               . 
                             
                             
                               hvac 
                               , 
                               i 
                             
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         
                           Q 
                           . 
                         
                         
                           sen 
                           , 
                           hvac 
                           , 
                           i 
                         
                       
                       = 
                       
                         
                           
                             
                               m 
                               . 
                             
                             
                               hvac 
                               , 
                               i 
                             
                           
                            
                           
                             C 
                             p 
                           
                            
                           
                             T 
                             out 
                           
                            
                           
                             ∀ 
                             i 
                           
                         
                         = 
                         1 
                       
                     
                     , 
                     … 
                      
                     
                         
                     
                     , 
                     
                       N 
                       z 
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         
                           Q 
                           . 
                         
                         
                           lat 
                           , 
                           hvac 
                           , 
                           i 
                         
                       
                       = 
                       
                         
                           
                             
                               m 
                               . 
                             
                             
                               hvac 
                               , 
                               i 
                             
                           
                            
                           
                             
                               h 
                               out 
                             
                              
                             
                               ( 
                               
                                 
                                   
                                     C 
                                     p 
                                   
                                    
                                   
                                     T 
                                     out 
                                   
                                 
                                 + 
                                 
                                   L 
                                   v 
                                 
                               
                               ) 
                             
                           
                            
                           
                             ∀ 
                             i 
                           
                         
                         = 
                         1 
                       
                     
                     , 
                     … 
                      
                     
                         
                     
                     , 
                     
                       N 
                       z 
                     
                     , 
                   
                 
               
               
                 
                   ( 
                   25 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where, P hvac  is the amount of electric power consumed by the HVAC outdoor unit, {dot over (Q)} all,hvac  is the total heating delivered by the HVAC unit, Cf is the compressor frequency of the HVAC unit, a 0 , a 1 , a 2 , b 0 , b 1 , b 2  are constants, X cond  is the amount of condensation in the outdoor unit, ΔX is the difference in specific humidity between the inlet and outlet of the outdoor unit, {dot over (m)} hvac,i  is the mass flow rate of air from the room air conditioners, h out  is the specific humidity of air at outlet of outdoor unit, RH out  is the relative humidity of air at outlet of outdoor unit, ΔH is the difference in specific enthalpy between the inlet and outlet of the outdoor unit, H z,i  is the specific enthalpy of the return air from the air conditioner in room i, H out  is the specific enthalpy of the air supplied by the outdoor unit to the rooms, BPF is the bypass factor of the outdoor unit, T cond  is the condensation temperature at the outdoor unit. 
         [0055]    Typically, RH out  is selected to 95%, BPF is selected to 0.2 and T cond  is selected to 5 deg C. 
         [0056]    The model in Eq. (25) applies for a single outdoor unit, and can be extended to the case of multiple outdoor units. 
         [0057]    Comfort Optimization Formulation 
         [0058]    In the preferred embodiment, the optimization minimizes the electric power consumption of the outdoor unit as, 
         [0000]    
       
         
           
             
               
                 
                   min 
                    
                   
                       
                   
                    
                   
                     
                       ∫ 
                       0 
                       T 
                     
                      
                     
                       
                         P 
                         hvac 
                       
                        
                       
                           
                       
                        
                       
                          
                         t 
                       
                     
                   
                 
               
               
                 
                   ( 
                   26 
                   ) 
                 
               
             
             
               
                 
                   
                     
                       
                         
                             
                         
                       
                       
                         
                           
                             
                               Eq 
                               . 
                               
                                   
                               
                                
                               
                                 ( 
                                 17 
                                 ) 
                               
                             
                              
                             
                               - 
                             
                              
                             
                               ( 
                               19 
                               ) 
                             
                           
                           , 
                           
                             
                               Eq 
                               . 
                               
                                   
                               
                                
                               
                                 ( 
                                 20 
                                 ) 
                               
                             
                              
                             
                               - 
                             
                              
                             
                               ( 
                               21 
                               ) 
                             
                           
                           , 
                           
                             ( 
                             23 
                             ) 
                           
                           , 
                           
                             ( 
                             24 
                             ) 
                           
                           , 
                           
                             ( 
                             25 
                             ) 
                           
                         
                       
                     
                     
                       
                         
                           
                               
                           
                            
                           
                             s 
                             . 
                             t 
                             . 
                           
                         
                       
                       
                         
                           
                             h 
                             
                               c 
                               , 
                               i 
                             
                           
                           = 
                           
                             
                               1 
                               2 
                             
                              
                             
                               ( 
                               
                                 
                                   
                                     
                                       
                                         2.38 
                                          
                                         
                                           
                                              
                                             
                                               
                                                 T 
                                                 
                                                   cl 
                                                   , 
                                                   i 
                                                 
                                               
                                               - 
                                               
                                                 T 
                                                 
                                                   z 
                                                   , 
                                                   i 
                                                 
                                               
                                             
                                              
                                           
                                           0.25 
                                         
                                       
                                       + 
                                       
                                         12.1 
                                          
                                         
                                           
                                             v 
                                             
                                               ar 
                                               , 
                                               i 
                                             
                                           
                                         
                                       
                                       + 
                                     
                                   
                                 
                                 
                                   
                                     
                                       
                                         
                                           
                                             ( 
                                             
                                               
                                                 2.38 
                                                  
                                                 
                                                   
                                                      
                                                     
                                                       
                                                         T 
                                                         
                                                           cl 
                                                           , 
                                                           i 
                                                         
                                                       
                                                       - 
                                                       
                                                         T 
                                                         
                                                           z 
                                                           , 
                                                           i 
                                                         
                                                       
                                                     
                                                      
                                                   
                                                   0.25 
                                                 
                                               
                                               - 
                                               
                                                 12.1 
                                                  
                                                 
                                                   
                                                     v 
                                                     
                                                       ar 
                                                       , 
                                                       i 
                                                     
                                                   
                                                 
                                               
                                             
                                             ) 
                                           
                                           2 
                                         
                                         + 
                                         
                                           τ 
                                           2 
                                         
                                       
                                     
                                   
                                 
                               
                               ) 
                             
                           
                         
                       
                     
                     
                       
                         
                             
                         
                       
                       
                         
                           
                             
                               ∀ 
                               i 
                             
                             = 
                             1 
                           
                           , 
                           … 
                            
                           
                               
                           
                           , 
                           
                             
                               N 
                               z 
                             
                              
                             
                                 
                             
                              
                             such 
                              
                             
                                 
                             
                              
                             that 
                           
                         
                       
                     
                   
                   } 
                 
               
               
                 
                     
                 
               
             
             
               
                 
                   
                     
                       
                         ∀ 
                         
                           t 
                           ∈ 
                           
                             [ 
                             
                               0 
                               , 
                               T 
                             
                             ] 
                           
                         
                       
                        
                       
                         
 
                       
                        
                       
                         
                           Initial 
                            
                           
                               
                           
                            
                           condition 
                            
                           
                               
                           
                            
                           for 
                            
                           
                               
                           
                            
                           room 
                            
                           
                               
                           
                            
                           temperatu 
                            
                           
                               
                           
                            
                           res 
                         
                         , 
                         
                           
 
                         
                          
                         
                           humidity 
                            
                           
                               
                           
                            
                           and 
                            
                           
                               
                           
                            
                           wall 
                            
                           
                               
                           
                            
                           temperatu 
                            
                           
                               
                           
                            
                           res 
                         
                       
                        
                       
                         
 
                       
                        
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       
                                         Bounds 
                                          
                                         
                                             
                                         
                                          
                                         on 
                                          
                                         
                                             
                                         
                                          
                                         
                                           PMV 
                                           i 
                                         
                                          
                                         
                                           ∀ 
                                           i 
                                         
                                       
                                       = 
                                       1 
                                     
                                     , 
                                     … 
                                      
                                     
                                         
                                     
                                     , 
                                     
                                       N 
                                       z 
                                     
                                   
                                 
                               
                               
                                 
                                   
                                     
                                       Bounds 
                                        
                                       
                                           
                                       
                                        
                                       on 
                                        
                                       
                                           
                                       
                                        
                                       Cf 
                                     
                                     , 
                                     
                                       
                                         m 
                                         . 
                                       
                                       
                                         hvac 
                                         , 
                                         i 
                                       
                                     
                                   
                                 
                               
                             
                           
                         
                         
                           
                             
                               Physical 
                                
                               
                                   
                               
                                
                               bounds 
                                
                               
                                   
                               
                                
                               on 
                                
                               
                                   
                               
                                
                               variabl 
                                
                               
                                   
                               
                                
                               es 
                             
                           
                         
                       
                     
                     } 
                   
                    
                   
                     ∀ 
                     
                       t 
                       ∈ 
                       
                         
                           [ 
                           
                             0 
                             , 
                             T 
                           
                           ] 
                         
                         . 
                       
                     
                   
                 
               
               
                 
                     
                 
               
             
           
         
       
     
         [0059]    In Eq. (26), a smoothing formulation is used to model the conditional statements in the PMV calculation. The comfort requirement is formulated as upper and lower limits on the PMV for each room. The values of +0.5 and −0.5 are typically used when the building is occupied. The compressor frequency is limited to be within 10 Hz˜80 Hz, and the mass flow rates are also limited based on the capacity of the fans in the individual air conditioning units. In addition, limits such as non-negativity of temperatures, humidity and other quantities from physical considerations are included in the optimization formulation. 
         [0060]    There are a number of parameters whose values for the period of the optimization are provided. These parameters are:
       (Q ins,1 , . . . , Q ins,N     w   , T oa , h oa , M 1 , W 1 , I cl,1 , v ar,1 , {dot over (Q)} sen,occ,1 , {dot over (Q)} lat,occ,1 , . . . , M N     z   , W N     z   , I cl,N     z   , V ar,N     z   , {dot over (Q)} sen,occ,N     z   , {dot over (Q)} lat,occ,N     z   ).       
 
         [0062]    As described above, the minimization problem in Eq. (26), based on smoothing formulation, is well behaved for τ&gt;0, but the smoothing parameter has to be decreased to 0 to recover a solution to the original problem. The procedure for solving this problem is shown in  FIG. 5 . 
         [0063]    For simplicity of this description, the building dynamics model is represented as 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               
                                 
                                    
                                   x 
                                 
                                 
                                    
                                   t 
                                 
                               
                               = 
                               
                                 
                                   f 
                                   diff 
                                 
                                  
                                 
                                   ( 
                                   
                                     
                                       x 
                                        
                                       
                                         ( 
                                         t 
                                         ) 
                                       
                                     
                                     , 
                                     
                                       y 
                                        
                                       
                                         ( 
                                         t 
                                         ) 
                                       
                                     
                                     , 
                                     
                                       u 
                                        
                                       
                                         ( 
                                         t 
                                         ) 
                                       
                                     
                                     , 
                                     
                                        
                                       
                                         ( 
                                         t 
                                         ) 
                                       
                                     
                                   
                                   ) 
                                 
                               
                             
                           
                         
                         
                           
                             
                               
                                 
                                   f 
                                   
                                     a 
                                      
                                     
                                         
                                     
                                      
                                     lg 
                                   
                                 
                                  
                                 
                                   ( 
                                   
                                     
                                       x 
                                        
                                       
                                         ( 
                                         t 
                                         ) 
                                       
                                     
                                     , 
                                     
                                       y 
                                        
                                       
                                         ( 
                                         t 
                                         ) 
                                       
                                     
                                     , 
                                     
                                       u 
                                        
                                       
                                         ( 
                                         t 
                                         ) 
                                       
                                     
                                     , 
                                     
                                        
                                       
                                         ( 
                                         t 
                                         ) 
                                       
                                     
                                   
                                   ) 
                                 
                               
                               = 
                               0 
                             
                           
                         
                       
                       } 
                     
                      
                     
                       ∀ 
                       
                         t 
                         ∈ 
                         
                           [ 
                           
                             0 
                             , 
                             T 
                           
                           ] 
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         ( 
                         
                           
                             x 
                              
                             
                               ( 
                               0 
                               ) 
                             
                           
                           , 
                           
                             y 
                              
                             
                               ( 
                               0 
                               ) 
                             
                           
                         
                         ) 
                       
                       = 
                       
                         ( 
                         
                           
                             x 
                             ^ 
                           
                           , 
                           
                             y 
                             ^ 
                           
                         
                         ) 
                       
                     
                     , 
                   
                 
               
               
                 
                   ( 
                   27 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where x the set of differential variables corresponds to
       (T z,1 , h z,1 , . . . , T z,N     z   , h z,N     z   , T w,1 , . . . , T w,N     w   ), y
 
the set of algebraic variables corresponds to
   (PMV 1 , T cl,1 ,  T   r,1 , h c,1 , p a,1 , {dot over (Q)} sen,hvac,1 , {dot over (Q)} lat,hvac,1 , . . . , PMV 1 , T cl,N     z   ,  T   r,N     z   , h c,N     z   , p a,N     z   , {dot over (Q)} sen,hvac,N     z   , {dot over (Q)} lac,hvac,N     z   ),
 
u the set of control variables corresponds to
   (Cf, {dot over (m)} hvac,1 , . . . , {dot over (m)} hvac,N     z   ),
 
and d the set of time dependent parameters
   (Q ins,1 , . . . , Q ins,N     w   , T oa , h oa , M 1 , W 1 , I cl,1 , v ar,1 , . . . , M N     z   , W N     z   , I cl,N     z   , v).       
 
         [0068]    The differential equations correspond to Equations (17)-(19). The algebraic equations correspond to Equations (20)-(21), (23)-(25) and the smoothing formulation (26). With this representation, the optimization problem in Eq. (26) can be recast as 
         [0000]    
       
         
           
             
               
                 
                   min 
                    
                   
                       
                   
                    
                   
                     
                       ∫ 
                       0 
                       T 
                     
                      
                     
                       
                         c 
                          
                         
                           ( 
                           
                             x 
                             , 
                             y 
                             , 
                             u 
                           
                           ) 
                         
                       
                        
                       
                           
                       
                        
                       
                          
                         t 
                       
                     
                   
                 
               
               
                 
                   ( 
                   28 
                   ) 
                 
               
             
             
               
                 
                   
                     
                       
                         
                           
                             
                               s 
                               . 
                               t 
                               . 
                               
                                   
                               
                                
                               
                                 
                                   
                                     
                                       
                                         
                                            
                                           x 
                                         
                                         
                                            
                                           t 
                                         
                                       
                                       = 
                                       
                                         
                                           f 
                                           diff 
                                         
                                          
                                         
                                           ( 
                                           
                                             
                                               x 
                                                
                                               
                                                 ( 
                                                 t 
                                                 ) 
                                               
                                             
                                             , 
                                             
                                               y 
                                                
                                               
                                                 ( 
                                                 t 
                                                 ) 
                                               
                                             
                                             , 
                                             
                                               u 
                                                
                                               
                                                 ( 
                                                 t 
                                                 ) 
                                               
                                             
                                             , 
                                             
                                                
                                               
                                                 ( 
                                                 t 
                                                 ) 
                                               
                                             
                                           
                                           ) 
                                         
                                       
                                     
                                   
                                 
                                 
                                   
                                     
                                       
                                         
                                           f 
                                           
                                             a 
                                              
                                             
                                                 
                                             
                                              
                                             1 
                                              
                                             
                                                 
                                             
                                              
                                             g 
                                           
                                         
                                          
                                         
                                           ( 
                                           
                                             
                                               x 
                                                
                                               
                                                 ( 
                                                 t 
                                                 ) 
                                               
                                             
                                             , 
                                             
                                               y 
                                                
                                               
                                                 ( 
                                                 t 
                                                 ) 
                                               
                                             
                                             , 
                                             
                                               u 
                                                
                                               
                                                 ( 
                                                 t 
                                                 ) 
                                               
                                             
                                             , 
                                             
                                                
                                               
                                                 ( 
                                                 t 
                                                 ) 
                                               
                                             
                                           
                                           ) 
                                         
                                       
                                       = 
                                       0 
                                     
                                   
                                 
                               
                             
                             } 
                           
                            
                           
                             ∀ 
                             
                               t 
                               ∈ 
                               
                                 [ 
                                 
                                   0 
                                   , 
                                   T 
                                 
                                 ] 
                               
                             
                           
                         
                          
                         
                           
 
                         
                          
                         
                           
                             ( 
                             
                               
                                 x 
                                  
                                 
                                   ( 
                                   0 
                                   ) 
                                 
                               
                               , 
                               
                                 y 
                                  
                                 
                                   ( 
                                   0 
                                   ) 
                                 
                               
                             
                             ) 
                           
                           = 
                           
                             ( 
                             
                               
                                 x 
                                 ^ 
                               
                               , 
                               
                                 y 
                                 ^ 
                               
                             
                             ) 
                           
                         
                          
                         
                           
 
                         
                          
                         
                           
                             
                               
                                 
                                   
                                     
                                       
                                         
                                           x 
                                           _ 
                                         
                                          
                                         
                                           ( 
                                           t 
                                           ) 
                                         
                                       
                                       ≤ 
                                       
                                         x 
                                          
                                         
                                           ( 
                                           t 
                                           ) 
                                         
                                       
                                       ≤ 
                                       
                                         
                                           x 
                                           _ 
                                         
                                          
                                         
                                           ( 
                                           t 
                                           ) 
                                         
                                       
                                     
                                   
                                 
                                 
                                   
                                     
                                       
                                         
                                           y 
                                           _ 
                                         
                                          
                                         
                                           ( 
                                           t 
                                           ) 
                                         
                                       
                                       ≤ 
                                       
                                         y 
                                          
                                         
                                           ( 
                                           t 
                                           ) 
                                         
                                       
                                       ≤ 
                                       
                                         
                                           y 
                                           _ 
                                         
                                          
                                         
                                           ( 
                                           t 
                                           ) 
                                         
                                       
                                     
                                   
                                 
                               
                             
                           
                           
                             
                               
                                 
                                   
                                     u 
                                     _ 
                                   
                                    
                                   
                                     ( 
                                     t 
                                     ) 
                                   
                                 
                                 ≤ 
                                 
                                   u 
                                    
                                   
                                     ( 
                                     t 
                                     ) 
                                   
                                 
                                 ≤ 
                                 
                                   
                                     u 
                                     _ 
                                   
                                    
                                   
                                     ( 
                                     t 
                                     ) 
                                   
                                 
                               
                             
                           
                         
                       
                       } 
                     
                      
                     
                       ∀ 
                       
                         t 
                         ∈ 
                         
                           [ 
                           
                             0 
                             , 
                             T 
                           
                           ] 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                     
                 
               
             
           
         
       
     
         [0000]    where  x ,  x  are lower and upper limits on differential variables,  y ,  y  are lower and upper limits on algebraic variables and  u , ū Tare lower and upper limits on the controls. 
         [0069]    The limits are assumed to be function of time because different bounds can be specified based on the occupancy conditions. The optimization problem in Eq. (28) is an instance of optimal control problem. These problems are generally solved by discretizing the differential and algebraic equations, which are now imposed at a finite set of time instances instead of all time instants in [0, T]. 
         [0070]    Discretization schemes, such as the explicit Euler, implicit Euler, Runge-Kutta methods, or collocation schemes can be used. With such a discretization, the problem in Eq. (28) is reduced to a nonlinear program with finite number of variables and constraints. 
         [0071]    In the preferred embodiment, the optimal control problem is Eq. (28) is discretized using an implicit Euler scheme as 
         [0000]    
       
         
           
             
               
                 
                   
                     min 
                      
                     
                         
                     
                      
                     Δ 
                      
                     
                         
                     
                      
                     t 
                      
                     
                       
                         ∑ 
                         
                           k 
                           = 
                           1 
                         
                         
                           N 
                           T 
                         
                       
                        
                       
                           
                       
                        
                       
                         c 
                          
                         
                           ( 
                           
                             
                               x 
                               k 
                             
                             , 
                             
                               y 
                               k 
                             
                             , 
                             
                               u 
                               k 
                             
                           
                           ) 
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         
                           s 
                           . 
                           t 
                           . 
                         
                       
                       
                         
                           
                             
                               
                                 
                                   x 
                                   k 
                                 
                                 - 
                                 
                                   x 
                                   
                                     k 
                                     - 
                                     1 
                                   
                                 
                               
                               
                                 Δ 
                                  
                                 
                                     
                                 
                                  
                                 t 
                               
                             
                             = 
                             
                               
                                 
                                   
                                     f 
                                     diff 
                                   
                                    
                                   
                                     ( 
                                     
                                       
                                         x 
                                         k 
                                       
                                       , 
                                       
                                         y 
                                         k 
                                       
                                       , 
                                       
                                         u 
                                         k 
                                       
                                       , 
                                       
                                         d 
                                         k 
                                       
                                     
                                     ) 
                                   
                                 
                                  
                                 
                                   ∀ 
                                   k 
                                 
                               
                               = 
                               1 
                             
                           
                           , 
                           … 
                            
                           
                               
                           
                           , 
                           
                             N 
                             T 
                           
                         
                       
                     
                     
                       
                         
                             
                         
                       
                       
                         
                           
                             0 
                             = 
                             
                               
                                 
                                   
                                     f 
                                     
                                       a 
                                        
                                       
                                           
                                       
                                        
                                       1 
                                        
                                       
                                           
                                       
                                        
                                       g 
                                     
                                   
                                    
                                   
                                     ( 
                                     
                                       
                                         x 
                                         k 
                                       
                                       , 
                                       
                                         y 
                                         k 
                                       
                                       , 
                                       
                                         u 
                                         k 
                                       
                                       , 
                                       
                                         d 
                                         k 
                                       
                                     
                                     ) 
                                   
                                 
                                  
                                 
                                   ∀ 
                                   k 
                                 
                               
                               = 
                               1 
                             
                           
                           , 
                           … 
                            
                           
                               
                           
                           , 
                           
                             N 
                             T 
                           
                         
                       
                     
                     
                       
                         
                             
                         
                       
                       
                         
                           
                             ( 
                             
                               
                                 x 
                                 0 
                               
                               , 
                               
                                 y 
                                 0 
                               
                             
                             ) 
                           
                           = 
                           
                             ( 
                             
                               
                                 x 
                                 ^ 
                               
                               , 
                               
                                 y 
                                 ^ 
                               
                             
                             ) 
                           
                         
                       
                     
                     
                       
                         
                             
                         
                       
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       
                                         
                                           
                                             
                                               
                                                 
                                                   x 
                                                   _ 
                                                 
                                                 k 
                                               
                                               ≤ 
                                               
                                                 x 
                                                 k 
                                               
                                               ≤ 
                                               
                                                 
                                                   x 
                                                   _ 
                                                 
                                                 k 
                                               
                                             
                                           
                                         
                                         
                                           
                                             
                                               
                                                 
                                                   y 
                                                   _ 
                                                 
                                                 k 
                                               
                                               ≤ 
                                               
                                                 y 
                                                 k 
                                               
                                               ≤ 
                                               
                                                 
                                                   y 
                                                   _ 
                                                 
                                                 k 
                                               
                                             
                                           
                                         
                                       
                                     
                                   
                                   
                                     
                                       
                                         
                                           
                                             u 
                                             _ 
                                           
                                           k 
                                         
                                         ≤ 
                                         
                                           u 
                                           k 
                                         
                                         ≤ 
                                         
                                           
                                             u 
                                             _ 
                                           
                                           k 
                                         
                                       
                                     
                                   
                                 
                                 } 
                               
                                
                               
                                 ∀ 
                                 k 
                               
                             
                             = 
                             1 
                           
                           , 
                           … 
                            
                           
                               
                           
                           , 
                           
                             N 
                             T 
                           
                           , 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   29 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where Δt is the time step of the discretization and N T =T/Δt are the number of discretization steps in the optimization. The optimization problem in Eq. (29) is very sparse and appropriate use of spare linear algebra can reduce the computational complexity. 
         [0072]    In the preferred embodiment, the optimization problem in (29) is solved using nonlinear programming algorithms that use sparse linear algebra techniques. 
         [0073]    In another embodiment the conditional equations in PMV calculation is formulated using complementarity constraints 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           
                             
                               min 
                                
                               
                                   
                               
                                
                               
                                 
                                   ∫ 
                                   0 
                                   T 
                                 
                                  
                                 
                                   
                                     P 
                                     hvac 
                                   
                                    
                                   
                                       
                                   
                                    
                                   
                                      
                                     t 
                                   
                                 
                               
                             
                              
                             
                               
 
                             
                              
                             
                               
                                 
                                   
                                       
                                   
                                 
                                 
                                   
                                     
                                       
                                         Eq 
                                         . 
                                         
                                             
                                         
                                          
                                         
                                           ( 
                                           17 
                                           ) 
                                         
                                       
                                        
                                       
                                         - 
                                       
                                        
                                       
                                         ( 
                                         19 
                                         ) 
                                       
                                     
                                     , 
                                     
                                       
                                         Eq 
                                         . 
                                         
                                             
                                         
                                          
                                         
                                           ( 
                                           20 
                                           ) 
                                         
                                       
                                        
                                       
                                         - 
                                       
                                        
                                       
                                         ( 
                                         21 
                                         ) 
                                       
                                     
                                     , 
                                     
                                       ( 
                                       23 
                                       ) 
                                     
                                     , 
                                     
                                       ( 
                                       24 
                                       ) 
                                     
                                     , 
                                     
                                       ( 
                                       25 
                                       ) 
                                     
                                   
                                 
                               
                               
                                 
                                   
                                       
                                   
                                 
                                 
                                   
                                     
                                       
                                         
                                           - 
                                           2.38 
                                         
                                          
                                         
                                           
                                              
                                             
                                               
                                                 T 
                                                 
                                                   cl 
                                                   , 
                                                   i 
                                                 
                                               
                                               - 
                                               
                                                 T 
                                                 
                                                   z 
                                                   , 
                                                   i 
                                                 
                                               
                                             
                                              
                                           
                                           0.25 
                                         
                                       
                                       + 
                                       
                                         12.1 
                                          
                                         
                                           
                                             v 
                                             
                                               ar 
                                               , 
                                               i 
                                             
                                           
                                         
                                       
                                       - 
                                       
                                         λ 
                                         i 
                                       
                                       + 
                                       
                                         v 
                                         i 
                                       
                                     
                                     = 
                                     0 
                                   
                                 
                               
                               
                                 
                                   
                                       
                                   
                                 
                                 
                                   
                                     
                                       λ 
                                       i 
                                     
                                     , 
                                     
                                       
                                         z 
                                         i 
                                       
                                       ≥ 
                                       0 
                                     
                                     , 
                                     
                                       
                                         
                                           λ 
                                           i 
                                         
                                          
                                         
                                           z 
                                           i 
                                         
                                       
                                       ≤ 
                                       τ 
                                     
                                   
                                 
                               
                               
                                 
                                   
                                       
                                   
                                 
                                 
                                   
                                     
                                       1 
                                       - 
                                       
                                         z 
                                         i 
                                       
                                     
                                     , 
                                     
                                       
                                         v 
                                         i 
                                       
                                       ≥ 
                                       0 
                                     
                                     , 
                                     
                                       
                                         
                                           ( 
                                           
                                             1 
                                             - 
                                             
                                               z 
                                               i 
                                             
                                           
                                           ) 
                                         
                                          
                                         
                                           v 
                                           i 
                                         
                                       
                                       ≤ 
                                       τ 
                                     
                                   
                                 
                               
                               
                                 
                                   
                                     s 
                                     . 
                                     t 
                                     . 
                                   
                                 
                                 
                                   
                                     
                                       h 
                                       
                                         c 
                                         , 
                                         i 
                                       
                                     
                                     = 
                                     
                                       
                                         
                                           ( 
                                           
                                             2.38 
                                              
                                             
                                               
                                                  
                                                 
                                                   
                                                     T 
                                                     
                                                       cl 
                                                       , 
                                                       i 
                                                     
                                                   
                                                   - 
                                                   
                                                     T 
                                                     
                                                       z 
                                                       , 
                                                       i 
                                                     
                                                   
                                                 
                                                  
                                               
                                               0.25 
                                             
                                           
                                           ) 
                                         
                                          
                                         
                                           z 
                                           i 
                                         
                                       
                                       + 
                                       
                                         12.1 
                                          
                                         
                                           
                                             v 
                                             
                                               ar 
                                               , 
                                               i 
                                             
                                           
                                         
                                          
                                         
                                           ( 
                                           
                                             1 
                                             - 
                                             
                                               z 
                                               i 
                                             
                                           
                                           ) 
                                         
                                       
                                     
                                   
                                 
                               
                               
                                 
                                   
                                       
                                   
                                 
                                 
                                   
                                     
                                       
                                         ∀ 
                                         i 
                                       
                                       = 
                                       1 
                                     
                                     , 
                                     … 
                                      
                                     
                                         
                                     
                                     , 
                                     
                                       
                                         N 
                                         z 
                                       
                                        
                                       
                                           
                                       
                                        
                                       such 
                                        
                                       
                                           
                                       
                                        
                                       that 
                                     
                                   
                                 
                               
                             
                           
                           } 
                         
                          
                         
                           
                             
                               
                                   
                               
                             
                           
                           
                             
                               
                                   
                               
                             
                           
                           
                             
                               
                                   
                               
                             
                           
                           
                             
                               
                                   
                               
                             
                           
                           
                             
                               
                                   
                               
                             
                           
                         
                       
                        
                       
                         
 
                       
                        
                       
                         ∀ 
                         
                           t 
                           ∈ 
                           
                             [ 
                             
                               0 
                               , 
                               T 
                             
                             ] 
                           
                         
                       
                        
                       
                         
 
                       
                        
                       
                         
                           Initital 
                            
                           
                               
                           
                            
                           condition 
                            
                           
                               
                           
                            
                           for 
                            
                           
                               
                           
                            
                           room 
                            
                           
                               
                           
                            
                           temperatu 
                            
                           
                               
                           
                            
                           res 
                         
                         , 
                         
                           
 
                         
                          
                         
                           humidity 
                            
                           
                               
                           
                            
                           and 
                            
                           
                               
                           
                            
                           wall 
                            
                           
                               
                           
                            
                           temperatu 
                            
                           
                               
                           
                            
                           res 
                         
                       
                        
                       
                         
 
                       
                        
                       
                         
                           
                             
                               
                                 
                                   
                                     
                                       
                                         Bounds 
                                          
                                         
                                             
                                         
                                          
                                         on 
                                          
                                         
                                             
                                         
                                          
                                         
                                           PMV 
                                           i 
                                         
                                          
                                         
                                           ∀ 
                                           i 
                                         
                                       
                                       = 
                                       1 
                                     
                                     , 
                                     … 
                                      
                                     
                                         
                                     
                                     , 
                                     
                                       N 
                                       z 
                                     
                                   
                                 
                               
                               
                                 
                                   
                                     
                                       Bounds 
                                        
                                       
                                           
                                       
                                        
                                       on 
                                        
                                       
                                           
                                       
                                        
                                       Cf 
                                     
                                     , 
                                     
                                       m 
                                       
                                         hvac 
                                         , 
                                         i 
                                       
                                     
                                   
                                 
                               
                             
                           
                         
                         
                           
                             
                               Physical 
                                
                               
                                   
                               
                                
                               bounds 
                                
                               
                                   
                               
                                
                               on 
                                
                               
                                   
                               
                                
                               variabl 
                                
                               
                                   
                               
                                
                               es 
                             
                           
                         
                       
                     
                     } 
                   
                    
                   
                     ∀ 
                     
                       t 
                       ∈ 
                       
                         [ 
                         
                           0 
                           , 
                           T 
                         
                         ] 
                       
                     
                   
                 
               
               
                 □ 
               
             
           
         
       
     
         [0074]    In another embodiment, the conditional equations in PMV calculation is formulated using binary variables as the Mixed Integer Nonlinear Programming (MINLP) 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       min 
                        
                       
                           
                       
                        
                       
                         
                           ∫ 
                           0 
                           T 
                         
                          
                         
                           
                             P 
                             hvac 
                           
                            
                           
                               
                           
                            
                           
                              
                             t 
                           
                         
                       
                     
                      
                     
                       
 
                     
                      
                     
                       
                         
                           
                               
                           
                         
                         
                           
                             
                               
                                 Eq 
                                 . 
                                 
                                     
                                 
                                  
                                 
                                   ( 
                                   14 
                                   ) 
                                 
                               
                                
                               
                                 - 
                               
                                
                               
                                 ( 
                                 16 
                                 ) 
                               
                             
                             , 
                             
                               
                                 Eq 
                                 . 
                                 
                                     
                                 
                                  
                                 
                                   ( 
                                   17 
                                   ) 
                                 
                               
                                
                               
                                 - 
                               
                                
                               
                                 ( 
                                 19 
                                 ) 
                               
                             
                             , 
                             
                               ( 
                               20 
                               ) 
                             
                             , 
                             
                               ( 
                               21 
                               ) 
                             
                             , 
                             
                               ( 
                               22 
                               ) 
                             
                           
                         
                       
                       
                         
                           
                               
                           
                         
                         
                           
                             
                               
                                 
                                   
                                     
                                       
                                         
                                           
                                             z 
                                             i 
                                           
                                           ∈ 
                                           
                                             { 
                                             
                                               0 
                                               , 
                                               1 
                                             
                                             } 
                                           
                                         
                                       
                                     
                                     
                                       
                                         
                                           
                                             2.38 
                                              
                                             
                                               
                                                  
                                                 
                                                   
                                                     T 
                                                     
                                                       cl 
                                                       , 
                                                       i 
                                                     
                                                   
                                                   - 
                                                   
                                                     T 
                                                     
                                                       z 
                                                       , 
                                                       i 
                                                     
                                                   
                                                 
                                                  
                                               
                                               0.25 
                                             
                                           
                                           ≥ 
                                           
                                             
                                               ( 
                                               
                                                 12.1 
                                                  
                                                 
                                                   
                                                     v 
                                                     
                                                       ar 
                                                       , 
                                                       i 
                                                     
                                                   
                                                 
                                               
                                               ) 
                                             
                                              
                                             
                                               z 
                                               i 
                                             
                                           
                                         
                                       
                                     
                                   
                                 
                               
                               
                                 
                                   
                                     
                                       h 
                                       
                                         c 
                                         , 
                                         i 
                                       
                                     
                                     = 
                                     
                                       
                                         ( 
                                         
                                           2.38 
                                            
                                           
                                             
                                                
                                               
                                                 
                                                   T 
                                                   
                                                     cl 
                                                     , 
                                                     i 
                                                   
                                                 
                                                 - 
                                                 
                                                   T 
                                                   
                                                     z 
                                                     , 
                                                     i 
                                                   
                                                 
                                               
                                                
                                             
                                             0.25 
                                           
                                         
                                         ) 
                                       
                                       ≥ 
                                       
                                         
                                           ( 
                                           
                                             12.1 
                                              
                                             
                                               
                                                 v 
                                                 
                                                   ar 
                                                   , 
                                                   i 
                                                 
                                               
                                             
                                           
                                           ) 
                                         
                                          
                                         
                                           ( 
                                           
                                             1 
                                             - 
                                             
                                               z 
                                               i 
                                             
                                           
                                           ) 
                                         
                                       
                                     
                                   
                                 
                               
                             
                             } 
                           
                         
                       
                       
                         
                           
                               
                           
                         
                         
                           
                             
                               
                                 
                                     
                                 
                               
                               
                                 
                                   
                                     
                                       ∀ 
                                       1 
                                     
                                     = 
                                     1 
                                   
                                   , 
                                   … 
                                    
                                   
                                       
                                   
                                   , 
                                   
                                     N 
                                     z 
                                   
                                 
                               
                             
                           
                         
                       
                     
                   
                   } 
                 
                  
                 
                   
 
                 
                  
                 
                   s 
                   . 
                   t 
                   . 
                   
                       
                   
                    
                   
                     ∀ 
                     
                       t 
                       ∈ 
                       
                         [ 
                         
                           0 
                           , 
                           T 
                         
                         ] 
                       
                     
                   
                 
                  
                 
                   
 
                 
                  
                 
                   min 
                    
                   
                       
                   
                    
                   
                     
                       ∫ 
                       0 
                       T 
                     
                      
                     
                       
                         P 
                         hvac 
                       
                        
                       
                           
                       
                        
                       
                          
                         t 
                       
                        
                       
                         
 
                       
                        
                       
                         
                           
                             
                                 
                             
                           
                           
                             
                               
                                 Initial 
                                  
                                 
                                     
                                 
                                  
                                 condition 
                                  
                                 
                                     
                                 
                                  
                                 for 
                                  
                                 
                                     
                                 
                                  
                                 room 
                                  
                                 
                                     
                                 
                                  
                                 temperatu 
                                  
                                 
                                     
                                 
                                  
                                 res 
                               
                               , 
                             
                           
                         
                         
                           
                             
                               s 
                               . 
                               t 
                               . 
                             
                           
                           
                             
                               humidity 
                                
                               
                                   
                               
                                
                               and 
                                
                               
                                   
                               
                                
                               wall 
                                
                               
                                   
                               
                                
                               temperatu 
                                
                               
                                   
                               
                                
                               res 
                             
                           
                         
                         
                           
                             
                                 
                             
                           
                           
                             
                               
                                 
                                   Bounds 
                                    
                                   
                                       
                                   
                                    
                                   on 
                                    
                                   
                                       
                                   
                                    
                                   
                                     PMV 
                                     i 
                                   
                                    
                                   
                                     ∀ 
                                     i 
                                   
                                 
                                 = 
                                 1 
                               
                               , 
                               … 
                                
                               
                                   
                               
                               , 
                               
                                 N 
                                 z 
                               
                             
                           
                         
                         
                           
                             
                                 
                             
                           
                           
                             
                               
                                 Bounds 
                                  
                                 
                                     
                                 
                                  
                                 on 
                                  
                                 
                                     
                                 
                                  
                                 Cf 
                               
                               , 
                               
                                 
                                   m 
                                   . 
                                 
                                 
                                   hvac 
                                   , 
                                   i 
                                 
                               
                             
                           
                         
                         
                           
                             
                                 
                             
                           
                           
                             
                               Physical 
                                
                               
                                   
                               
                                
                               bounds 
                                
                               
                                   
                               
                                
                               on 
                                
                               
                                   
                               
                                
                               variabl 
                                
                               
                                   
                               
                                
                               es 
                             
                           
                         
                       
                     
                   
                 
               
               } 
             
              
             
               ∀ 
               
                 t 
                 ∈ 
                 
                   [ 
                   
                     0 
                     , 
                     T 
                   
                 
               
             
           
         
       
     
         [0075]    In another embodiment, comfort optimization is formulated using simplification of the conditional equations in PMV calculation as, 
         [0000]    
       
         
           
             
               
                 
                   min 
                    
                   
                       
                   
                    
                   
                     
                       ∫ 
                       0 
                       T 
                     
                      
                     
                       
                         P 
                         hvac 
                       
                        
                       
                           
                       
                        
                       
                          
                         t 
                       
                     
                   
                 
                  
                 
                   
 
                 
                  
                 
                   
                     
                       
                         
                           
                             
                               
                                 Eq 
                                 . 
                                 
                                     
                                 
                                  
                                 
                                   ( 
                                   14 
                                   ) 
                                 
                               
                                
                               
                                 - 
                               
                                
                               
                                 ( 
                                 16 
                                 ) 
                               
                             
                           
                         
                         
                           
                             
                               
                                 
                                   Eq 
                                   . 
                                   
                                       
                                   
                                    
                                   
                                     ( 
                                     17 
                                     ) 
                                   
                                 
                                  
                                 
                                   - 
                                 
                                  
                                 
                                   ( 
                                   19 
                                   ) 
                                 
                               
                               , 
                               
                                 ( 
                                 20 
                                 ) 
                               
                               , 
                               
                                 ( 
                                 21 
                                 ) 
                               
                               , 
                               
                                 ( 
                                 22 
                                 ) 
                               
                             
                           
                         
                       
                     
                   
                   
                     
                       
                         
                           
                             h 
                             
                               c 
                               , 
                               i 
                             
                           
                           = 
                           
                             
                               12.1 
                                
                               
                                 
                                   v 
                                   
                                     ar 
                                     , 
                                     i 
                                   
                                 
                               
                                
                               
                                 ∀ 
                                 1 
                               
                             
                             = 
                             1 
                           
                         
                         , 
                         … 
                          
                         
                             
                         
                         , 
                         
                           N 
                           z 
                         
                       
                     
                   
                 
               
               } 
             
              
             
               ∀ 
               
                 t 
                 ∈ 
                 
                   [ 
                   
                     0 
                     , 
                     T 
                   
                   ] 
                 
               
             
           
         
       
       
         
           
             
               
                 
                   
                     s 
                     . 
                     t 
                     . 
                   
                    
                   
                       
                   
                 
               
               
                 
                   
                     Initial 
                      
                     
                         
                     
                      
                     condition 
                      
                     
                         
                     
                      
                     for 
                      
                     
                         
                     
                      
                     room 
                      
                     
                         
                     
                      
                     temperature 
                   
                   , 
                 
               
             
             
               
                 
                     
                 
               
               
                 
                   humidity 
                    
                   
                       
                   
                    
                   and 
                    
                   
                       
                   
                    
                   wall 
                    
                   
                       
                   
                    
                   temperatures 
                 
               
             
             
               
                 
                     
                 
               
               
                 
                   
                     
                       
                         
                           
                             
                               
                                 Bounds 
                                  
                                 
                                     
                                 
                                  
                                 on 
                                  
                                 
                                     
                                 
                                  
                                 
                                   PMV 
                                   i 
                                 
                                  
                                 
                                   ∀ 
                                   i 
                                 
                               
                               = 
                               1 
                             
                             , 
                             … 
                              
                             
                                 
                             
                             , 
                             
                               N 
                               z 
                             
                           
                         
                       
                       
                         
                           
                             
                               Bounds 
                                
                               
                                   
                               
                                
                               on 
                                
                               
                                   
                               
                                
                               Cf 
                             
                             , 
                             
                               
                                 m 
                                 . 
                               
                               
                                 hvac 
                                 , 
                                 i 
                               
                             
                           
                         
                       
                       
                         
                           
                             Physical 
                              
                             
                                 
                             
                              
                             bounds 
                              
                             
                                 
                             
                              
                             on 
                              
                             
                                 
                             
                              
                             variables 
                           
                         
                       
                     
                     } 
                   
                    
                   
                     ∀ 
                     
                       t 
                       ∈ 
                       
                         [ 
                         
                           0 
                           , 
                           T 
                         
                         ] 
                       
                     
                   
                 
               
             
           
         
       
     
         [0076]    Although the invention has been described by way of examples of preferred embodiments, it is to be understood that various other adaptations and modifications can be made within the spirit and scope of the invention. Therefore, it is the object of the appended claims to cover all such variations and modifications as come within the true spirit and scope of the invention.