# Title **Introduction** KAIROS models short-term flexibility sources on the demand side (DSM) to simulate operational responses over sub-hourly to daily horizons. These mechanisms allow modeling of load shifting and flexible demand behavior. The following constraints ensure that these technologies are correctly represented in the optimization problem. --- **1. Power consumption incorporating DSM** The consumption by each demand category includes the effect of DSM, which can shift load positively or negatively: $$ d_{d,t} = Dem_{d,t} + dsm_{d,t} $$ Where: * {math}`d_{d,t}`: actual consumption, * {math}`Dem_{d,t}`: baseline demand (MW), * {math}`dsm_{d,t}`: load shifted via demand-side management (MW). Positive values increase consumption, negative values reduce it. --- **2. DSM constraints (Upper and Lower Bounds)** DSM is modeled as a virtual storage that must return to neutrality over time: **Upper Bound (DSM discharge limit):** $$ AD_{d} · LSP_{d} \ge sum_{tt=1}^{t-1} dsm_{d,t} · Dur_{t} $$ **Lower Bound (DSM charge limit):** $$ -AD_{d} · LSP_{d} \le sum_{tt=1}^{t-1} dsm_{d,t} · Dur_{t} $$ Where: * {math}`Dur_{t}`: duration of time block in hours, * {math}`LSP_{d}`: load shifting potential (in hours), * {math}`AD_{d}`: average demand. These bounds enforce that DSM does not inject or absorb more energy than its defined storage-like capability. --- **3. Unserved Energy (ENS) Constraint** KAIROS limits unserved energy as a fraction of average demand to maintain reliability: $$ ens_{d,t} \le AD_{d} $$ Where: * {math}`ens_{d,t}`: unserved energy at time , --- **4. Node-Level Energy Balance Constraint** Each node in the network maintains an energy balance that includes all sources and sinks: $$ \sum_{g(n)} g_{g,t} - \sum_{g(n)} pump_{g,t} + \sum_{s(n)} ( s_{dis,s,t} - s_{cha,s,t} ) + \sum_{d(n)} ens_{d,t} - \sum_{l(n)} flow_{l,t} - \sum_{l(n)} 0.5 · loss_{l,t} = sum_{d(n)} d_{d,t} - \sum_{l(n)} 0.5 · loss_{l,t} $$ Where: * {math}`g_{g,t}`: generation, * {math}`pump_{g,t}`: pumping load (if any), * {math}`s_{dis,s,t}`: storage discharging, * {math}`s_{cha,s,t}`: storage charging, * {math}`ens_{d,t}`: unserved energy, * {math}`d_{d,t}`: net consumption, * {math}`flow_{l,t}`: flow from the current node, * {math}`loss_{l,t}`: power losses. --- **Conclusion** These constraints support the realistic and effective modeling of short-term storage and DSM flexibility in KAIROS, enabling more resilient and cost-efficient energy system operation under variable renewable conditions and demand fluctuations.