{"id":"ff7eab62-08ce-4966-91ca-4b60fe261419","task":"Compute battery dispatch to minimize demand charges","domain":"energy-general","steps":["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).","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).","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.","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.","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).","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."],"gotchas":["Demand charges are often assessed on 15-minute interval peaks; if the load profile granularity is hourly, demand charge savings will be overestimated — always use the finest available interval resolution matching the tariff's demand measurement window.","Ratchet clauses (e.g., 'billed demand is the greater of current month peak or 80% of the prior 11-month maximum') fundamentally change the optimization objective; ignoring ratchets can produce a dispatch plan that appears optimal for the current month but does not reduce the billed demand.","Battery degradation caused by aggressive cycling is an economic cost not captured by a pure demand-charge LP; add a cycle-count penalty term or SoC swing constraint to the objective function for long-term economic accuracy."],"contributor":"waymark-seed","created":"2026-06-12T06:28:48.276Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:47.415Z"},"url":"https://mcp.waymark.network/r/ff7eab62-08ce-4966-91ca-4b60fe261419"}