11SDG 11 · sustainable cities and communities 7SDG 7 · affordable and clean energy

Linear Programming Scheduler

live
Since June 2026 Region GB SDGs 7 + 11

Most EVs charge the instant you plug in — straight into the evening carbon peak. This widget pulls the live GB grid carbon-intensity forecast and runs a small linear program to shift your charge into the cleanest half-hours, so you wake up full on the greenest electrons of the night.

threshold 55 g · clean grid below // kerbside · charge when the grid is clean grid 60 gCO₂/kWh · charging
11 SDG 11 · sustainable cities
trip · 01

Your trip tomorrow

Tell me how far you are driving and when you leave. I will schedule the charge into the cleanest half-hours of the night.

240 km ~48 kWh
0200400 km

based on 0.2 kWh/km average

Forecast from the National Grid carbon intensity API · next ~12h

Your clean-charge plan appears here

Set your distance and departure, then press Optimise charge.

02 · linear programming

The optimisation problem

The scheduler is a small LP: given a carbon intensity forecast and a required energy delivery, find the power drawn in each half-hour period that minimises total carbon. No integer variables — the solver picks fractional kW freely, and the greedy structure of the problem means the optimal always concentrates charge in the lowest-carbon windows first.

Formulation

minimise Σt ct · xt · Δt
 
subject to
  Σt xt · Δt ≥ Ereq // must charge fully
  0 ≤ xt ≤ Pmax // charger power bounds

Parameters

ctCarbon intensity forecast for period t (gCO₂/kWh) — live from the GB grid API
xtDecision variable: power drawn in period t (kW)
ΔtPeriod length — 0.5 h (30-minute settlement periods)
EreqEnergy required by departure (kWh)
PmaxCharger power limit (kW) — 7 kW home / 11 kW fast / 22 kW three-phase

Why a faster charger isn't penalised

You might expect a 22 kW charger to throttle itself and spread the load. For a deterministic carbon objective it shouldn't. The optimum is always to fill the cleanest half-hours at full power, so a faster charger can pack the whole session into the few lowest-carbon slots. In a clean window a 22 kW charge can average a lower gCO₂/kWh than a 7 kW one, because the slower charger is forced to use more slots and picks up dirtier ones. The solver isn't charging early out of greed. It has already ranked every slot up to your departure and confirmed nothing cleaner exists.

The honest caveat is that this version optimises against the P50 median forecast only. Committing all the energy to a single half-hour is a bet on that one estimate. The P10/P90 bands drawn above are not yet used by the solver. Making the schedule uncertainty-aware, so it hedges across slots when the forecast is wide, is the next iteration I want to build.