the dynamical model and the cost function without undermining the basic approach [@haves2010model; @Oldewurtel201215; @goyal2013occupancy]. Finally, the energy penalty gain can be varied over time to reflect, for example, changing system efficiency or electricity cost.

Building Thermal Model
======================

Thermal model accuracy influences controller performance, so we need a thermal model that closely approximates the dominant dynamics. Here we outline how the state-space building model is generated, and we validate it against EnergyPlus simulation results.

Thermal model creation has historically been a manual process contributing substantially to MPC implementation cost. Research efforts such as the [*Sustain*]{} platform (Figure \[fig:Sustain\]) [@Greenberg201344; @dobbsautomatic] and the Building Resistance-Capacitance Modeling Toolbox [@sturzenegger2014brcm] have arisen to streamline the creation of dynamical equations suitable for MPC. Here we have used a module in [*Sustain*]{} to generate a resistor-capacitor network directly from a CAD model. The thermal model states are the building’s internal temperatures, including zone air plus wall layers and roofing materials that are not normally measured; a state observer can easily estimate these values during operation.[^2] Although not used here, ways to automatically tune the RC network parameters on-line and even estimate disturbances such as solar load have recently been introduced [@radecki_online_2013].

The model used 