## 1. Introduction

In recent years, networked computation has become nearly ubiquitous, and power systems have begun relying more heavily on renewable power and market-based settling of supply and demand. These trends create both a need and an opportunity for dynamic pricing and demand response to help balance the power system. In a smart grid environment, price-responsive customers and devices can reschedule electricity loads from the times when electricity supply is scarce and production costs are high to times when supply is abundant and costs are low, thereby reducing bills and also improving the supply-demand balance for the power system as a whole. For example, [

1] shows a method for incorporating demand response into day-ahead procurement with renewable energy; [

2] reports on savings achievable by industrial customers with dynamic pricing, and [

3] discusses savings available to small customers.

Air conditioning systems in buildings provide a rich opportunity for demand response. Buildings account for 40% of all electricity consumed in the United States, with half that figure attributed to heating, ventilation and air conditioning (HVAC) [

4].

There is an extensive literature on adjusting the timing of air conditioner operation in commercial buildings to reduce demand during high-cost times and increase it in low-cost times. This uses the building’s thermal mass as a form of thermal storage that has the same effect as an electric battery. It is helpful to divide previous work into three categories: optimal control using detailed building models and simplified user preferences, optimal control with realistic user preferences and simplified building models, or heuristic approaches that choose setpoints based on time-of-day or electricity price alone. This paper introduces a new control strategy that spans the first two classes—optimal control with realistic user preferences and a detailed building model.

The first class of price-responsive control algorithms all seek to shift air conditioner operation between hours while maintaining temperatures within a narrow band that preserves occupant comfort. For example, several authors used simple control algorithms with “brick-wall” temperature limits to investigate the aggregate load-shifting potential of HVAC systems: [

5] used such an algorithm to show that electricity demand need not be considered as purely inelastic; [

6] used such an algorithm as part of an effort to estimate the effects of large scale adoption of demand response technologies, and [

7] used a “brick-wall” algorithm to estimate the potential flexibility of residential HVAC loads in smart grids. Others in the first class of algorithms focus on the savings available to individual customers in a dynamic pricing environment [

8], possibly addressing specific technological innovations in the building [

9]. Among the customer-focused algorithms, one of the most advanced was introduced by Corbin, Henze, and May-Ostendorp [

10]. They use Particle Swarm Optimization (PSO) [

11] with a detailed thermal simulation in open-source EnergyPlus building simulation software [

12] to perform model predictive control of the HVAC system in a commercial office building. Although Corbin et al. do not mention it, their algorithm represents a sort of “gold standard” for building control—it is able to directly optimize HVAC operation throughout the day to minimize costs under time-varying pricing, using state-of-the-art building simulation software to directly account for the complex, nonlinear behavior of the coupled building and HVAC system.

However, there is one significant shortcoming in the algorithms in this first class—they all use a “brick wall” representation of people’s preferences for comfort, assuming the occupants are indifferent within a narrow range around an ideal temperature, but will not tolerate temperatures outside this range. This assumption produces solutions that generally peg the temperature at the lower edge of the allowed band during pre-cooling times and at the upper edge of the allowed band during other times. This likely does not match true occupant preferences, and foregoes opportunities to make occupants more comfortable when prices are low, and also to move slightly outside the standard comfort band for greater savings when prices are high or occupancy is low.

The second class of algorithms uses more realistic functions to represent customer preferences. These add a term to the cost calculation (objective function) representing users’ willingness to pay to move closer to the ideal temperature. This term takes a few shapes: linear in absolute deviation from the ideal temperature ([

13] used this as part of an Immune Clonal Selection algorithm, and [

14] used this in a linear program); a “bathtub” shape with a curved bottom and plateaus on either side ([

15] is a classic example, and [

16] is a more recent instance); or a quadratic curve with a minimum at the ideal temperature ([

17] used this with occupancy prediction for a single room, and [

18] used it with zonal occupancy predictions for 2–3 zone buildings). Unlike the first class of algorithms, the second class are able to choose settings that increase user comfort when low costs justify it, or relax temperature settings further when customers would prefer that due to high cooling costs. This has the potential to produce solutions that give a better balance of cost vs. comfort, depending on each customer’s preferences. They could also potentially provide more flexiblity to the power system, since they will give deeper demand reductions in times of scarcity and greater increases in times of abundance.

However, all of the algorithms we have identifed in this second class represent the building itself via simplified linear or quadratic models of the building’s response to setpoints. As a consequence, they cannot model the complex, nonlinear behavior of the building. This encompasses a number of factors that strongly affect HVAC energy demand, including variations in efficiency based on equipment loads, outdoor temperatures or humidity; activation of economizers and reheat; “coasting” behavior when cooling setpoints exceed actual air temperatures, and full-load operation when the building cannot immediately reach setpoints. Consequently, although previous algorithms in this class can closely follow user preferences, they do not optimize operation of the building itself as precisely as Corbin et al.’s PSO method [

10].

A third class of algorithms uses heuristic methods to select air conditioner setpoints. Night-setback control is a well-established strategy where air conditioning setpoints are raised to a fixed level during unoccupied times and then lowered to a comfortable temperature during occupied times [

19]. Another approach is to raise setpoints when prices are high and lower them when prices are low, using price-temperature relationships provided by the authors. For example, [

20] adjusts setpoints based on differences between hourly prices and the daily mean price, and [

21] adjusts setpoints based on the price difference from a fixed, low threshold and also the difference between the current temperature and the desired temperature.

In this study, we introduce a new model predictive control algorithm for commercial building air conditioners that we call “cost-comfort particle swarm optimization” (CCPSO). This algorithm combines the best of the first two types of approach: precise optimization via a detailed, nonlinear building model and a direct consideration of user preferences for cost savings vs. comfort.

We compare the performance of CCPSO to representative models from each of the control classes discussed above: a “brick wall” PSO approach [

10], standard night-setback [

19], the “transactive power” heuristic [

20] and a linearized building model with the same quadratic treatment of comfort as CCPSO [

18]. We find that CCPSO can produce solutions that are simultaneously superior in both cost and comfort to the other strategies. We also find that CCPSO time-shifts power demand more strongly than the other strategies, potentially improving the system’s ability to help balance time-varying supply and demand. This attribute will be especially important in future, high-renewable power systems.

## 2. Methods

In this section, we describe the CCPSO model and inputs. The complete input data, code and results used for this study are available in the

Supplementary Information.

#### 2.1. Optimization Problem

CCPSO selects temperature setpoints for a building HVAC system with the goal of maximizing net benefit to the building occupants—the value of comfort minus electricity costs. Setpoints are selected and evaluated for a sequence of future timesteps, so that the algorithm can pre-cool the building when electricity prices are low or “coast” without cooling when prices are high. At any timestep, the building fabric may be warmer or colder than the long-run average. This thermal energy—or lack of it—constitutes work deferred or stored by the HVAC system, which could result in higher or lower costs in later timesteps. It is not possible to directly assign a financial value to the energy stored in the building fabric, because it depends on electricity prices, occupancy and weather in later timesteps, as well as the strategy used to respond to those conditions. So CCPSO uses two methods to assess this value indirectly.

First, although we expect CCPSO to be run once per day or more often, the planning period extends more than 24 h into the future. This forces the model to consider—and optimize—how energy in the building mass at the end of the first day will affect costs on later days.

Second, the planning period is followed by a standardized “termination period”, with pre-specified setpoints, to assign a financial value to thermal energy in the building fabric at the end of the planning period. Without these extra days, the algorithm could be biased toward leaving the building underconditioned at the end of the planning period, since that would reduce costs during the planning period with no apparent negative impact on later days. The termination period also returns the building model to a standard state before evaluating other setpoints. As will be discussed below, for our example building, we found that cooling decisions on one day have a minimal effect on the state of the building one week later, so the termination period may not strongly influence decisions about the first day of operation. However, the termination period is also needed as part of the thermal modeling process (discussed further below), and performing cost and comfort assesment during this period may increase accuracy somewhat.

In concrete terms, the problem to be solved each day by CCPSO is given by

To solve this problem, optimal setpoints ${\mathbf{t}}_{\mathrm{set}}$ must be found for the planning period, timeblocks H on days 1 to ${n}_{\mathrm{p}}$. The function ${b}_{d,s,z}({\mathbf{t}}_{\mathrm{set}})$ represents the benefit of the thermal comfort in the corresponding time and location if the system uses setpoints ${\mathbf{t}}_{\mathrm{set}}$, i.e., the amount the building owner would be willing to pay for this amount of cooling. The function ${c}_{d,s}({\mathbf{t}}_{\mathrm{set}})$ represents the cost of purchasing electricity to run the HVAC system with these setpoints. Below, we discuss the computation of these functions in more detail.

In order to reduce the dimensionality of

${\mathbf{t}}_{\mathrm{set}}$ and achieve faster solutions, the problem in Equation (

1) includes two simplifications. The time blocks

$h\in H$ are hourly from midnight to noon, then one block for 12:00 p.m. to 7:00 p.m. and one more for 7:00 p.m. to midnight. This provides high resolution during pre-cooling and high-occupancy periods and a sparser representation during coasting and low-occupancy periods. In addition, rather than choosing different temperature setpoints for each zone, we choose a single setpoint for each time block and apply it to all zones. This representation reduces the problem size while still allowing detailed modeling of pre-chilling strategies. This creates a

$|H|\xb7{n}_{\mathrm{p}}=98$ dimensional

${\mathbf{t}}_{\mathrm{set}}$ similar to [

10].

#### 2.1.1. Economic Demand for Cooling

We are not aware of any literature describing building managers’ demand for cooling services, so we use a simple, plausible form. First, we make the following assumptions:

**Assumption** **1.** If cooling were free, managers would cool to the temperature that makes the most occupants thermally neutral, t_{ideal} (assumed to be 72.5 °F in this paper);

**Assumption** **2.** the amount of cooling that would be selected declines as the cost of cooling rises;

**Assumption** **3.** the relationship expressed in Assumption 2 is linear; and

**Assumption** **4.** the perceived benefit of cooling is proportional to building occupancy, measured in person·hours.

Assumption 1 reflects rational behavior; Assumption 2 expresses the economic “law of demand”; Assumptions 3 and 4 are hypothesized for the purpose of this paper. Below, we test a range of proportionality constants for Assumption 3; future work could use field research to estimate both the form and coefficients for the demand function to improve on Assumptions 3 and 4.

With these assumptions, we obtain a demand function for cooling during a given timestep:

where

p is the marginal cost of cooling the building (

$/°F), 2 is introduced to help with integration later,

w is a linear proportionality constant (in

$/(°F

^{2}·person·hour)),

c is the amount of cooling applied (°F),

${c}_{\mathrm{ideal}}$ is the amount of cooling needed to reach

${t}_{\mathrm{ideal}}$,

o is the building occupancy (number of people) and

$\delta $ is the duration of the timestep (hours). The standard interpretation of this demand function is that

p is the amount that the manager would be willing to pay for one more unit of cooling, when already obtaining

c units of cooling. Thus, the total value that the manager places on

c units of cooling can be calculated by integrating the demand function:

Here, we have used

$c={t}_{0}-{t}_{\mathrm{act}}$, where

${t}_{0}$ is the building temperature with no cooling and

${t}_{\mathrm{act}}$ is the actual temperature. For optimization purposes, we may ignore

$wo\delta {c}_{\mathrm{ideal}}^{2}$, the benefit of cooling to

${t}_{\mathrm{ideal}}$, which is constant. This leaves a discomfort index that can be included in the optimization:

With this discomfort index and a change of sign, Equation (

1) becomes

Note that Equation (

5) can be interpreted as a multi-objective optimization problem minimizing discomfort and cost, where

w is a weight or penalty charge used to reconcile the two objectives. By varying the value of

w, it is possible to choose an operating strategy anywhere on the Pareto frontier for these two objectives—trading off between minimum cost and minimum discomfort. The algorithm described here allows users to choose any point along this frontier.

#### 2.1.2. Electricity Cost

If forecasts of future electricity prices, building occupancy and weather conditions are available, then the cost of electricity can be calculated as

${c}_{d,s}({\mathbf{t}}_{\mathrm{set}})={r}_{d,s}{e}_{d,s}({\mathbf{t}}_{\mathrm{set}})$, where

${r}_{d,s}$ is the electricity price during timestep

s of day

d, and

${e}_{d,s}({\mathbf{t}}_{\mathrm{set}})$ is the amount of electricity used by the HVAC system during that timestep, in response to the setpoints

${\mathbf{t}}_{\mathrm{set}}$. This gives the objective function:

Section 2.2 shows how we choose values of

${\mathbf{t}}_{\mathrm{set}}$ to solve this optimization problem,

Section 2.3 discusses how we compute

${e}_{d,s,z}$ and

${t}_{\mathrm{act},d,s,z}$ from

${\mathbf{t}}_{\mathrm{set}}$ and

Section 2.4 discusses the specific data we used for this work.

Section 3 presents our results.

#### 2.2. Particle Swarm Optimization

For real-world HVAC systems, the problem given by Equation (

6) is inherently non-convex. For example, turning off the cooling system and “coasting” during one time block (by assigning a high value to

${t}_{\mathrm{set},d,h}$ for that period) may be a locally optimal strategy, but not globally optimal. Furthermore, the most natural method for calculating cost and comfort due to the choice of

${\mathbf{t}}_{\mathrm{set}}$—building simulation, as discussed in

Section 2.3—does not yield derivatives for the objective function. Consequently, this problem must be solved via a derivative-free, global optimization method. For this work, we use particle swarm optimization (PSO) to do this.

As originally described by Kennedy, Eberhart and Shi [

11], PSO is a meta-heuristic that progressively refines a population (swarm) of candidate solutions (particles) per iteration (generation); it is suited well for global optimization problems. Inspired by flocking movements of fish and birds, it makes few assumptions about the search space and does not require the problem to be differentiable. We use a PSO variant [

22] that utilizes a logarithmically-decreasing inertial weight

${c}_{0}$ [

23] inspired by findings in [

24], alongside the usual cognitive and social attraction weights,

${c}_{1}$ and

${c}_{2}$:

Elements of this equation are described in the Nomenclature table, along with the specific values used for this work. The vector-valued quantities, ${\mathbf{t}}_{p}$, ${\mathbf{v}}_{p}$, ${\mathbf{b}}_{p}$ and ${\mathbf{b}}_{g}$ have one component for each time block on each day of the planning period.

Positions of all particles are updated once per generation

k, calculated by adding fractions of individual previous velocities, and cognitive and social components. The cognitive component denotes a particle’s memory of its personal best,

${\mathbf{b}}_{p}$, against its current position

${\mathbf{t}}_{p}$. Similarly, the social component denotes communication of the entire swarm, with comparisons against the swarm’s current best position,

${\mathbf{b}}_{g}(k)$. Particles are evaluated by calculating the objective function of Equation (

6) with

${\mathbf{t}}_{\mathrm{set}}={\mathbf{t}}_{p}$, using EnergyPlus software (8.3.0, U.S. Dept. of Energy, Washington, DC, USA) as discussed in

Section 2.3. Using inertia

${c}_{0}{\mathbf{v}}_{p}$, particles maintain some of their previous trajectory, which is noted to improve exploration properties [

25]. Upon completion,

${\mathbf{t}}_{\mathrm{set}}$ is set equal to the best solution in the final iteration

k:

${\mathbf{t}}_{\mathrm{set}}={\mathbf{b}}_{g}(k)$To accelerate convergence, the search space for ${\mathbf{t}}_{\mathrm{set}}$ is bounded between 60 °F and 90 °F. If a particle hits the bounds of the search space, it is reflected back into the search space, as if the space was mirrored over the boundary.

To form the initial population, 44 particles are dispersed in the search space using a uniform, random distribution. An additional particle is initialized using a heuristic approach given by:

where

${r}_{d,h}$ is the mean value of

${r}_{d,s}$ for time steps that fall in block

h on day

d.

Attraction weights are selected to satisfy the following, ensuring stability [

26]:

Within these constraints, the coefficients are fine-tuned for faster convergence based on interactive testing.

Iteration continues until either $k={k}_{\mathrm{max}}$, computation time reaches two hours, or the objective function improves by less than $15 over the course of 15 successive iterations.

#### 2.3. EnergyPlus Software

To use the PSO algorithm discussed in

Section 2.2, it is necessary to repeatedly calculate the functions

${e}_{d,s,z}({\mathbf{t}}_{p})$ and

${t}_{\mathrm{act},d,s,z}({\mathbf{t}}_{p})$, which show the electricity usage and temperature if setpoints

${\mathbf{t}}_{p}$ are used for the building’s HVAC system. To perform these computations, we use EnergyPlus software. EnergyPlus is a whole-building energy simulation engine that is widely used in academic and industry research to help design energy-efficient buildings. It can provide highly detailed simulations of the operation and effects of an HVAC system, incorporating factors such as building shape, materials and construction, internal and external gains, and the size of HVAC components.

Normally, EnergyPlus is run as a freestanding program. When run, it initializes the building model, simulates a study period using predefined setpoints, saves results, and then terminates. However, initializing the building model requires significant computational overhead, which slows down the PSO process. Thus, we accelerated the computation by setting up a co-simulation between our Matlab (R2017a, The MathWorks, Inc., Natick, MA, USA) PSO implementation and EnergyPlus, using the MLE+ Matlab toolbox [

27]. As shown in

Figure 1, EnergyPlus first initializes itself, and then goes into a repeated loop over the planning and termination periods. At each timestep during these periods, EnergyPlus requests setpoints from the Matlab PSO software. By supplying appropriate values, the CCPSO algorithm uses EnergyPlus to efficiently calculate building performance (

${e}_{d,s,z}({\mathbf{t}}_{p})$ and

${t}_{\mathrm{act},d,s,z}({\mathbf{t}}_{p})$) over these periods without reinitializing EnergyPlus for each iteration. In our configuration, the termination period uses the same weather and setpoints as were actually used during the time immediately before the planning period. Consequently, after testing candidate settings for the planning period, this technique effectively returns the building model to the same conditions at the start of each iteration, with no wasted calculations.

The CCPSO optimization was run with 20 parallel EnergyPlus workers on a 20-core Linux computer, which were used as needed to simulate the planning and termination periods for each PSO particle during each iteration. Complete code for this model is provided in the

Supplementary Information.

#### 2.4. Simulation Parameters

#### 2.4.1. Building Model

We tested the CCPSO algorithm using the benchmark large Chicago office building included with the EnergyPlus installation. This building has exterior walls constructed with eight inches of concrete for the walls and interior floors, possessing a window-to-wall ratio of 38%. The orientation of the building is south, with an aspect ratio of 1.5. The glazing U-value is 3.24 W/m^{2}/K; the solar heat gain coefficient is 0.39. These properties indicate a building with high thermal mass, and follow ASHRAE 90.1-2004.

For all intermediate stories, a single five-zone floor is modeled (north, south, east, west and core), with a multiplier factor of 10. In total, there are 15 zones and 46,320 m^{2} of conditioned space. The peak occupancy is 2299 people. Each floor is conditioned using a variable air volume (VAV) system with two large water-cooled chillers. A night cycle manager operates in 30 min cycles and an economizer uses outdoor air to provide free cooling when appropriate.

Primary heating and reheating coils are disabled, so that the air conditioning system can be set to “coast” by selecting a high ${t}_{\mathrm{set},d,h}$; in this case, ${t}_{\mathrm{act}}$ floats until it reaches ${t}_{\mathrm{set},d,h}$ or establishes thermal equilibrium. A fractional schedule indicates occupancy relative to max, throughout the building. This ranges from zero at night to one during weekday mornings and afternoons, with intermediate values during lunch hours and on weekends. Lighting and equipment are assumed to follow the same fractional schedule as occupancy.

#### 2.4.2. Length of Planning and Termination Periods

As discussed in

Section 2.3, each iteration of CCPSO concludes by modeling building performance during a multi-day termination period. This period is used both to evaluate lingering effects of the setpoints chosen during the plannning period, and also to return the simulated building to a state that matches the current state of the real building. For both of these purposes, the termination period must be long enough to return the building to a standard state, which is not affected by any setpoints that were used before the termination period.

In order to choose the termination period length

${n}_{\mathrm{t}}$, we conducted a test of the effect of thermal mass on deep cooling operation. For this test, we define a night-setback strategy as follows:

with

Note that reheat is disabled in this building, so the high nighttime setpoints cause the building to “coast” without applying heating or cooling.

The test is shown in

Figure 2 (also see [

10]). After reaching steady state using the setpoints given by Equations (

11) and (

12), an extreme chilling schedule (60 °F) is used continuously until the end of Day 7. Power consumption decreases for several days after the building returns to normal operation; i.e., a normal level of comfort is maintained with less power input. By Day 14, the power consumption and zone temperatures return to within 1% of the steady state values. In this sense, the building “forgets” the extreme perturbation one week earlier. We conclude that the building’s thermal state will be determined almost entirely by the weather and setpoints from the most recent seven days, so we set

${n}_{\mathrm{t}}=7\phantom{\rule{4.pt}{0ex}}\mathrm{days}$. We also set the planning period

${n}_{\mathrm{p}}$ to seven days, in order to ensure that this period includes all the days that could be affected by the binding decisions made for day 1.

#### 2.4.3. Discomfort Penalty

As discussed in

Section 2.1, the

w parameter can be set by the user to a suitable value to indicate their particular preference for low cost vs. high comfort. Each value of this parameter will drive the algorithm toward a different point on the Pareto frontier of cost vs. comfort. By testing several different values, it is possible to plot part of this frontier. For this work, we chose values of

w that produced comfort that spanned a range from about half the discomfort level of the brick-wall PSO strategy, up to slightly less comfortable than the brick-wall strategy. Specifically, we used values for

w from the following list:

#### 2.4.4. Electricity Prices

Our reference building is located in the Commonwealth Edison (ComEd) service territory in Chicago, IL, USA. Small ComEd customers can subscribe to flat tariffs where the price-per-kWh component changes only twice a year, e.g.,

$61 per MWh for summer 2018 [

28]. However, large customers are required to sign up for ComEd’s hourly pricing service, which uses a per-kWh charge that is linked directly to the Pennsylvania–Jersey–Maryland (PJM) hourly price. Those charges varied between −

$13 and +

$106 per MWh in July 2018 [

29] (negative prices occurred when wind production was high and demand was low, and wind farms or other generators paid the pool to take their power rather than curtailing it).

For this study, we use the PJM prices from July 2007, which varied between

$21/MWh and

$204/MWh, with a mean of

$68/MWh (

Figure 3). These prices and date range were selected to match [

10], to which we compare our results. Like [

10], we neglect bill components other than the per-kWh energy charge.

#### 2.5. Evaluation Process

We simulated use of the CCPSO algorithm on a rolling basis over the period of 1–31 August 2007. At the start of each simulated day, we retrieved power prices and weather for a 7-day planning period beginning on that day. We used historical weather data for Chicago from the U.S. National Oceanic and Atmospheric Administration [

30] and locational marginal power prices from the PJM Interconnection for corresponding days in 2007 (

Section 2.4.4). We also retrieved historical conditions for use in the conditioning and termination periods. For the historical period prior to 1 August 2007, we assume the building was operated with the night-setback policy given by Equations (

11) and (

12). For this test, we assumed perfect foresight of weather and prices.

We then used the PSO algorithm discussed in

Section 2.2 to choose optimal setpoints

${\mathbf{t}}_{\mathrm{set}}$ for the coming planning period. Finally, we recorded the weather, setpoints, costs and discomfort from the first day of the planning period for later reference. The recorded values from the first day of each optimization represent the “actual” operation of the simulated system—they are used as the historical conditions for the termination/conditioning period, and are reviewed later to evaluate the performance of the system over the whole study period.

#### 2.6. Benchmarks

To establish benchmarks for evaluation of the CCPSO algorithm, we also ran four previously described control strategies for the same reference office building, prices and weather, as discussed at the end of

Section 1. Code to implement each of these algorithms, as described below, is included in the

Supplementary Information.

#### 2.6.1. Brick-Wall Particle Swarm Optimization (PSO)

The algorithm reported by Corbin et al. [

10] is similar to CCPSO, but with “brick-wall” constraints on temperature. This algorithm requires that setpoints fall strictly within the range 71.6 °F ≤

${t}_{\mathrm{set},d,h}$ ≤ 75 °F during occupied hours, but doesn’t assign any other cost to discomfort. The brick-wall PSO is otherwise identical to CCPSO, aside from the performance enhancements noted in

Section 2.3. To create benchmarks for CCPSO, we used the brick-wall PSO algorithm to choose setpoints for 1–31 August, then evaluated the total cost and discomfort that would occur over this period, using the discomfort Equation (

4).

#### 2.6.2. Night-Setback

Night-setback is a well-established HVAC control strategy, where setpoints are raised to a high level during unoccupied times, allowing the air conditioning system to shutdown or make better use of free cooling [

19]. Temperatures are then lowered to a comfortable temperature during occupied times. We evaluated electricity cost and comfort when using the night-setback strategy given by Equation (

11), with values for

${t}_{\mathrm{base}}$ ranging from 72.5° (comfort-seeking) to 75 °F (cost-reducing). Setpoints were 80 °F during unoccupied times.

#### 2.6.3. Transactive Power

The “transactive power” strategy [

20] chooses setpoints each hour according to the equation

where

r is the electricity price during the current hour,

$\overline{r}$ is the mean electricity price for the day,

$\sigma $ is the standard deviation of electricity prices during the day,

${\Delta}_{\mathrm{high}}$ is an adjustment factor applied when

$r>\overline{r}$ and

${\Delta}_{\mathrm{low}}$ is applied when

$r<\overline{r}$. For our benchmark, we used 80 °F setpoints during unoccupied times and followed the transactive power strategy during occupied times. For precooling configurations, where

${\Delta}_{\mathrm{low}}$ was nonzero, we also applied the transactive power strategy during the last two hours before occupancy began in the morning. We calculated

$\overline{r}$ and

$\sigma $ based only on the hours when the transactive power strategy was in effect. We tested this strategy with all permutations of

$k\in \{1,2,3\}$,

${\Delta}_{\mathrm{high}}\in \{5,10\}$ and

${\Delta}_{\mathrm{low}}\in \{-3,0\}$, as described in [

20].

#### 2.6.4. Linearized Building Optimization

Leow et al. [

18] report a building control strategy with the same objective function as CCPSO, including a quadratic discomfort term. However, instead of using PSO to optimize setpoints for a detailed building model, they use dynamic programming to directly optimize setpoints for a linearized building model. Their model solves for multiple zones, but when setpoints are the same in all zones, it reduces to a fairly simple form:

where

i indexes over the

n hours of the study,

${r}_{i}$ is the price of electricity during hour

i,

${e}_{i}$ is the amount of electricity used by the HVAC system during hour

i,

w is a penalty term identical to CCPSO,

${t}_{i}$ is the average air temperature in occupied spaces during hour

i and

${t}_{\mathrm{ideal}}$ is the preferred temperature. The second line of this problem is a linearized thermal model of the building, where

${t}_{i}^{0}$ is the effective outdoor temperature during hour

i and

${c}_{1}$,

${c}_{2}$ and

${c}_{3}$ are constant coefficients that are found by regression using historical observations of the building’s behavior. Leow et al. define the effective outdoor temperature each hour as

where

${t}_{\mathrm{OA}}$ is the outdoor air temperature,

a is the absorptivity of the building exterior (assumed by Leow et al., to be 0.4),

I is the solar irradiance on the building,

${h}_{0}$ is an external surface coefficient, assumed to be 20 W/m

^{2} °C, and

${t}_{\mathrm{LWR}}$ is the temperature drop due to longwave radiation, assumed to be –6 °C.

To implement the linearized building optimization, we first simulated operation of the reference building for the month of August 2007 using the night-setback strategy with nighttime setpoint of 80 °F and daytime setpoint of 72.5 °F. We then calculated the regression coefficients

${c}_{1}$,

${c}_{2}$ and

${c}_{3}$ based on the hourly irradiance, energy consumption and temperature data from this simulation. We next used CPLEX software (12.8.0, IBM Corp., Armonk, NY, USA) to solve the model in Equation (

15) directly as a quadratic program, producing optimal temperatures for each hour of August 2007. Finally, we used EnergyPlus to simulate operation of the building with setpoints matching these temperature targets, and tabulated the resulting electricity cost and discomfort measures over the month. We repeated this process with values of the

w ranging from 200 to 10,000

$/(10

^{6} °F

^{2}·person·hour).

## 4. Conclusions

This work introduces a new control algorithm, CCPSO, which seeks to optimize air conditioner temperature setpoints for a commercial building, responding to time-varying electricity prices, in order to minimize cost while maximizing comfort. CCPSO differs from previous work by combining an explicit, continuous model of user preferences for comfort vs. cost savings with a detailed simulation of building thermal behavior. Combining these elements allows CCPSO to optimize closely to building occupants’ preferences, achieving both lower cost and higher comfort than previously reported control strategies. CCPSO also shifts load more strongly from peak to off-peak hours than previously reported strategies, which may be especially important in high-renewable power systems.

Compared to a standard night-setback strategy that achieves similar comfort (75 °C during the day, off during the night), CCPSO reduced power costs by 6% during a month of cooling in Chicago. Compared to previous work using a PSO control algorithm with “brick-wall” constraints (no preference for further cooling within an allowed temperature band, and infinite aversion to going outside the allowed band), CCPSO reduced power costs by about 1%. Although these savings are modest, they come at no additional cost and may be significant for a large building. With the CCPSO algorithm, savings can also be increased or decreased—with a corresponding trade-off in comfort—depending on users’ comfort preferences. CCPSO also outperformed two other methods from the literature—transactive power and optimization via a linearized building model—with financial savings of 8–11% at comparable comfort levels.

Of particular interest for high-renewable power systems, we found that CCPSO is more responsive to dynamic prices than the previous approaches, providing a 3–14% reduction in load during system peaks and ≥15% increase in load during minimum-price times. This response could improve utilization of efficient baseload plants in current-day power systems, and could help integrate renewable power in future power systems, where high and low prices may correspond to scarcity and abundance of renewable power. This shift from peak to off-peak may also provide additional financial savings by reducing demand charges associated with the customer or system’s peak demand. CCPSO offers a “best of both worlds” approach, enabling building managers to find the best balance of cost and comfort, and at the same time improving the supply-demand balance in the rest of the power system, reducing costs for all users.

CCPSO does, however, have some limitations. The main limitation (shared with the brick-wall PSO) is that it is computationally intensive, requiring about 1.25 h to find setpoints for each day on a computer with two 10-core 2.8 GHz Intel Xeon “Ivy Bridge” processors (Intel Corp., Santa Clara, CA, USA). This work only tested CCPSO for a commercial building with fixed day/night occupancy cycles; results may differ significantly for residential HVAC, which has different patterns for each household and different equipment available. As presented here, CCPSO also does not optimize each zone separately, which could allow better trade-offs between comfort and cooling energy, e.g., by providing less cooling in low-occupancy zones. Although this work used a state-of-the-art building simulation model to evaluate performance, CCPSO has not been tested in a physical building environment.

In future work, we plan to address these shortcomings by testing the use of reduced-form models of the building and HVAC to obtain faster solutions, investigating use of CCPSO in a residential context, optimizing individual zones separately, and applying the algorithm in practice in large buildings. We also plan to study opportunities for improved performance via enhanced building thermal memory and incorporate uncertain forecasts peak-demand charges.