Home Energy Scheduling Lab

Home Energy Scheduling Lab

animation
smart-grid
applications
Try Change Flexible load moved off peak (%), then press Calculate daily cost.
Observe Watch Peak import and Modelled daily cost after pressing Calculate daily cost.
Explain Describe how Calculate daily cost uses local generation before export.

Technical boundaries. The model assumes one peak block, £0.14/kWh off peak, 90% round-trip storage efficiency and perfect forecast. It has no power-rate limit or battery degradation.

Home Energy Scheduling Lab

Use the model to schedule a flexible appliance and battery against one time-of-use peak. The must-run load and appliance deadline remain constraints; local generation is used before export; net-metering credit is not assumed to equal the retail tariff.

viewof defaHemsFlexible = Inputs.range([0, 12], {label: "Flexible appliance energy (kWh/day)", step: 0.5, value: 5})
viewof defaHemsShift = Inputs.range([0, 100], {label: "Flexible load moved off peak (%)", step: 10, value: 60})
viewof defaHemsSolar = Inputs.range([0, 20], {label: "Local generation (kWh/day)", step: 1, value: 8})
viewof defaHemsBattery = Inputs.range([0, 12], {label: "Usable storage dispatched at peak (kWh)", step: 1, value: 3})
viewof defaHemsPeakPrice = Inputs.range([0.10, 0.80], {label: "Peak tariff (£/kWh)", step: 0.05, value: 0.40})
viewof defaHemsExportPrice = Inputs.range([0, 0.30], {label: "Export credit (£/kWh)", step: 0.02, value: 0.08})
defaHemsResult = {
  const mustRunPeak = 9;
  const mustRunOffPeak = 10;
  const shifted = defaHemsFlexible * defaHemsShift / 100;
  const remainingPeakFlexible = defaHemsFlexible - shifted;
  const solarToLoad = Math.min(defaHemsSolar, mustRunPeak + remainingPeakFlexible);
  const residualPeak = Math.max(0, mustRunPeak + remainingPeakFlexible - solarToLoad);
  const batteryToPeak = Math.min(defaHemsBattery, residualPeak);
  const peakImport = residualPeak - batteryToPeak;
  const offPeakImport = mustRunOffPeak + shifted + defaHemsBattery / 0.9;
  const exportKwh = Math.max(0, defaHemsSolar - solarToLoad);
  const scheduledCost = peakImport * defaHemsPeakPrice + offPeakImport * 0.14 - exportKwh * defaHemsExportPrice;
  const baselinePeak = mustRunPeak + defaHemsFlexible;
  const baselineCost = baselinePeak * defaHemsPeakPrice + mustRunOffPeak * 0.14;
  return html`<div class="callout callout-style-default callout-tip"><div class="callout-body-container"><div class="callout-body">
    <p><strong>Peak import:</strong> ${baselinePeak.toFixed(1)} -> <strong>${peakImport.toFixed(1)} kWh</strong>. Modelled daily cost: £${baselineCost.toFixed(2)} -> <strong>£${scheduledCost.toFixed(2)}</strong>.</p>
    <p>Local generation used ${solarToLoad.toFixed(1)} kWh; storage supplied ${batteryToPeak.toFixed(1)} kWh at peak; exported ${exportKwh.toFixed(1)} kWh; shifted appliance energy ${shifted.toFixed(1)} kWh.</p>
    <p><small>Assumptions: one peak block, £0.14/kWh off peak, 90% round-trip storage efficiency, no power-rate limit, no battery degradation, perfect forecast, and a flexible appliance that still meets its deadline. Validate with interval meter data, actual tariff rules, inverter limits, device opt-out, comfort/safety constraints, and settlement evidence.</small></p>
  </div></div></div>`;
}

Back to the chapter