A tangible non-transitory computer-readable storage medium including instructions that, when executed by a processor of a thermostat, cause the processor of the thermostat to perform operations including:
- identifying a DR event that defines a DR event period;
- accessing a plurality of parameter sets;
- generating candidate setpoint schedules during the DR event for the plurality of parameter sets;
- simulating each of the candidate setpoint schedules using a thermodynamic model of how the structure responds to a heating, ventilation, and air conditioning (HVAC) system;
- generating predicted indoor temperature profiles or HVAC duty cycle schedules for each of the simulated candidate setpoint schedules;
- evaluating a cost function for each of the predicted indoor temperature profiles or HVAC duty cycle schedules, the cost function comprising a combination of:
- a first factor representative of a total energy consumption of the HVAC system during the DR event period;
- a second factor representative of a metric of occupant discomfort in the structure;
- and
- a third factor representative of deviations of a rate of energy consumption of the HVAC system from an equalized rate of energy consumption of the HVAC system over the DR event period such that the rate of energy consumption by the HVAC system over the DR event period can be made substantially constant;
- selecting an optimal predicted indoor temperature profile or HVAC duty cycle schedule that minimizes the cost function;
- and
- controlling the HVAC system during the DR event period in accordance with the optimal predicted indoor temperature profile or HVAC duty cycle schedule.