Abstract
Buildings are a promising source of flexibility for the application of demand response. In this work, we introduce a novel battery model formulation to capture the state evolution of a single building. Being fully data-driven, the battery model identification requires one dataset from a period of nominal controller operation, and one from a period with flexibility requests, without making any assumptions on the underlying controller structure. We consider parameter uncertainty in the model formulation and show how to use risk measures to encode risk preferences of the user in robust uncertainty sets. Finally, we demonstrate the uncertainty-aware prediction of flexibility envelopes for a building simulation model from the Python library Energym.
Introduction
Grid operators increasingly rely on Demand Response (DR) to balance the intermittent nature of renewable energy. Buildings, with their significant thermal mass, act as "virtual batteries" that can shift energy consumption. However, quantifying available flexibility is challenging due to the complexity of building physics and unknown internal control logic. Moreover, existing models often fail to account for the risk of violating occupant comfort constraints during flexibility events. This work addresses these challenges by proposing a controller-agnostic, data-driven battery model that incorporates uncertainty quantification via Conditional Value at Risk (CVaR).
Methodology
The proposed approach treats a building as an abstract state-space system where the state represents stored thermal energy.
Controller-Agnostic Battery Model
The model is "controller-agnostic," meaning it does not require knowledge of the building's internal thermostat or control structure (e.g., PID or MPC). It uses switched linear dynamics to distinguish between a "request phase" (following a grid signal) and a "recovery phase" (returning to nominal state). The state is defined abstractly by the time remaining before a comfort limit is reached, enhancing portability across building types.
Uncertainty Quantification via CVaR
To manage inherent randomness from occupant behavior and environmental factors, the model integrates CVaR into robust uncertainty sets. A risk parameter, $\alpha$, allows users to tune the model's conservatism. A low $\alpha$ produces conservative, highly reliable flexibility estimates, while a high $\alpha$ yields more aggressive predictions at the cost of increased risk of infeasibility.
Experimental Setup
The methodology was validated using the SimpleHouseRad-v0 model from the Energym library. Training data consisted of six weeks of simulated operation in Basel, Switzerland: three weeks of nominal operation and three weeks of random power requests (1–4 hours). Testing was performed on ten days of unseen weather data from Lausanne, Switzerland.
Results and Discussion
The model successfully generated flexibility envelopes that characterize the building's capacity to shift load over time. A critical finding is the quantifiable trade-off between reliability and predictive accuracy governed by the parameter $\alpha$.
As shown in Figure 2, a conservative setting ($\alpha \approx 0.002$) resulted in a very low failure rate (0.16% infeasible predictions) but higher mean absolute error in duration. Conversely, a risk-neutral setting ($\alpha = 1.0$) improved accuracy (reducing error from ~28 to ~15 timesteps) but increased the failure rate to 6.09%. This "knob" allows building managers to align flexibility offerings with their specific risk tolerance and potential grid penalties.
Conclusion
This research demonstrates that a simple, data-driven battery model can effectively capture complex building dynamics for demand response. By incorporating CVaR, the model provides a robust framework for predicting flexibility envelopes while managing the risk of comfort violations. Future work will focus on aggregating these models for neighborhood-scale flexibility and incorporating external uncertainties like weather forecast errors.
Summary updated