Layer 3: Optimization Engine
Available Features
EV Charging Optimization
Fleet charging schedule optimization with tariff-aware, priority-based, carbon-conscious scheduling
Peak Shaving Controller
Battery dispatch optimization to minimize peak demand and demand charges using a two-pass algorithm
Multi-Objective Optimization
Configurable objective weights for cost, carbon, and peak reduction trade-offs
Tariff Integration
Native consumption of Qubit tariff schemas — time-of-use, demand charges, and carbon intensity
Quick Start
Installation
Optimize an EV Charging Schedule
Architecture
Technology Stack
- Core
- Data Integration
- Constraints
- Python 3.9+ — Primary language
- NumPy / pandas — Numerical computation and schedule DataFrames
- Pydantic — Configuration validation
- Greedy LP — Cost-sorted slot filling for EV scheduling
- Two-pass dispatch — Peak identification + cheapest-slot charging
Optimization Algorithms
EV Charging — Greedy LP
The EV scheduler uses a greedy linear-programming relaxation:- Build an availability matrix — which vehicles are present at each time slot
- Compute effective cost per slot —
cost_weight * price + carbon_weight * carbon_intensity - Process sessions by priority (urgent first), then deadline (earliest departure first)
- For each session, fill cheapest available slots until energy requirement is met
- Enforce site capacity by tracking remaining headroom at each slot
Peak Shaving — Two-Pass Dispatch
The peak shaving controller uses a two-pass algorithm:- Pass 1 (Discharge): Walk forward through time. At each slot where load exceeds the peak target, discharge the battery (respecting SOC limits and max discharge rate)
- Pass 2 (Charge): Calculate total energy discharged, then schedule recharging in the cheapest off-peak slots that have headroom below the peak target
- Shave peak demand below the target threshold
- Minimize charging cost by exploiting TOU tariff structure
- Respect all battery physical constraints (SOC, charge/discharge rates, efficiency)
- Account for battery degradation cost
Integration with Qubit Stack
Schedule Output
Produces time-indexed DataFrames with per-slot dispatch commands, SOC profiles, and cost breakdowns
Next Steps
Get Started
Install and run your first optimization in 5 minutes
EV Charging
Deep dive into fleet charging optimization
Peak Shaving
Deep dive into battery dispatch for demand reduction
GitHub Repository
Explore source code and contribute
Layer 3 Optimization Engine is production-ready, powering EV charging fleets and battery dispatch across commercial and industrial energy sites.