Code and data to replicate all results in Home Battery Dispatch under a Tiered Peak Power Tariff.
Requires Gurobi and MOSEK licenses (free for academic use).
uv syncuv run python run.py # Run everything
uv run python run.py --train # Train forecasters only
uv run python run.py --experiments # Run experiments only
uv run python run.py --figures # Generate figures onlyIndividual experiments:
uv run python run.py --baseline # Baseline policies
uv run python run.py --prescient # Prescient optimization
uv run python run.py --mpc # MPC policies
uv run python run.py --capacity # Capacity sweep
uv run python run.py --sensitivity # Sensitivity analysisResults are saved to results/, figures to figures/.
If you find this repository useful, consider giving it a star. The bibtex entry for citing this work is below.
@article{perez2026home,
title={Home battery dispatch under a tiered peak power tariff},
author={P{\'e}rez-Pi{\~n}eiro, David and Skogestad, Sigurd and Boyd, Stephen},
journal={Optimization and Engineering},
pages={1--21},
year={2026},
publisher={Springer}
}