Compute battery dispatch to minimize demand charges

domain: energy-general · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Ingest the facility's 15-minute or hourly interval load profile for the billing period and identify the utility tariff's demand charge structure (peak kW window, coincident vs. non-coincident, ratchet clauses).
  2. Formulate a linear programming (LP) optimization: decision variables are battery charge power P_charge(t) and discharge power P_discharge(t) per interval; the objective minimizes the maximum net load (peak demand) subject to battery energy balance, state-of-charge bounds (SoC_min to SoC_max), and power limits (P_max charge/discharge).
  3. Add the battery round-trip efficiency term to the energy balance constraint: SoC(t+1) = SoC(t) + P_charge(t)*eta_charge*dt - P_discharge(t)/eta_discharge*dt, where eta values are typically 0.95–0.97 for modern Li-ion systems.
  4. Solve the LP using an open-source solver (e.g., CVXPY with GLPK or SCS backend, or PuLP) for day-ahead planning; for real-time operation, implement a rolling-horizon model predictive control (MPC) that re-solves every 15 minutes with an updated load forecast.
  5. Post-process the dispatch schedule: apply a demand charge threshold target (set slightly below the current monthly peak to add margin), and verify that the schedule does not violate any time-based restrictions in the tariff (e.g., no discharge during on-peak generation hours).
  6. Log actual SoC telemetry versus planned SoC at each interval to detect forecast error accumulation and trigger re-planning when deviation exceeds a defined tolerance.

Known gotchas

Related routes

Evaluate a battery-buffered DCFC platform to avoid a transformer upgrade and reduce demand charges
ev-charging.battery-buffered-dcfc · 4 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans