1. The operating boundary is the utility bill cycle
The coordinator uses the building’s configured billing start day and local timezone.
At a new cycle it rebuilds the tariff matrix, gently refreshes the learned load model, runs the
annual optimizer, and commits the new peak target. Repeating the refresh for an already committed
cycle is safely skipped unless an authorized force refresh is requested.
2. Learning is idempotent and auditable
αused = (1−w)αprevious + wαfit
A SHA-256 fingerprint identifies the bill values used by the fit. New bills receive one gentle
update; unchanged bills use an effective w of zero, so repeated Runs cannot teach the same
evidence twice. Model version, fit values, learning reason, fingerprint, and timestamp are retained
in the model metadata and audit ledger.
3. Refresh is transactional
The rates, load matrix, metadata, and dispatch artifacts are backed up before refresh. They are
committed together after a successful optimization; a failure restores the prior complete set and
records the error. Mid-cycle initialization does not invent a zero peak: it requests meter-history
backfill, while live readings accumulate a monotonic measured peak for the active cycle.
4. Annual GLOP chooses the economic plan
min [Σ renergy,tPgrid,tΔt + Σ rdemand,pPpeak,p + cdegradationEdischarge]
The annual linear program values both TOU energy arbitrage and billing-period peak
shaving. Battery state of charge, power, efficiency, and equipment constraints determine what is
physically available. A zero degradation cost permits marginal arbitrage; a realistic degradation
cost should be configured when battery wear matters.
5. Daily CP-SAT creates the executable BMS schedule
The daily solver receives the annual plan’s realizable demand target. On a peak-threat day it
minimizes slot-level energy cost while enforcing the target during demand-window slots, plus binary
charge/discharge modes, minimum dwell, one charge and discharge run per day, power ramping, efficiency,
and state-of-charge limits. If natural load is already below the target, storage is suppressed.
6. Always keep the tariff units separate
- $/kWh energy rate prices every imported kWh and drives TOU charging and discharging.
- $/kW demand rate prices the cycle’s measured peak in the applicable demand window.
Chart-reading rule: a ribbon changing from $77/kW to $46/kW
does not prove the TOU energy price changed. Inspect the $/kWh series separately. Discharge below the
demand cap can still be valid energy arbitrage when the high TOU energy period continues.
7. What the live widget proves
The Engineering View reports the active cycle, coordinator state, refresh status, model version,
learning reason, planned peak target, measured peak, and meter-history status. These fields explain
what the system decided; the model audit ledger preserves why the learning state changed.