A Julia package for transmission grid planning on realistic power system networks. Provides DC and linearized AC formulations for co-optimizing line switching, line hardening, battery storage siting, and solar PV siting against load shedding, cost, and risk-exposure objectives, plus nonlinear AC verification/recovery runs for checking planned decisions. Applications include planning under severe-weather risk such as wildfires, with built-in support for USGS Fire Potential Index data.
Key Features:
- Four formulations: wildfire-aware switching (DCOTS, LACOTS) and pure power-flow baselines (DCOPF, LACOPF) sharing the same investment-planning interface
- Nonlinear AC verification with diagnostics: Replay fixed planning decisions with AC power flow (
ACPF) or run AC redispatch/recovery with load shedding (ACOPF), including voltage, thermal, islanding, and recovery-stress diagnostics - Investment planning: Line hardening, battery energy storage (BESS), and solar PV siting under a shared infrastructure budget
- Multiple objectives: Load shedding, risk exposure, generation cost, or a weighted tradeoff
- Two switching methods: Optimal MIP-based and fast thresholded heuristic
- Hazard-agnostic risk interface: Accept any per-line risk signal; built-in loader for USGS Fire Potential Index (wildfire) included
- Multi-period optimization: Single days, date ranges, or entire months/years
- Flexible network support: Pre-configured for 6+ realistic test cases (RTS-GMLC, CATS, Texas7k, ACTIVSg2000/10k, WECC240), or bring any MATPOWER case via
:case_filewith explicit hooks for supplying risk and coordinate data
Full documentation lives at rpiansky3.github.io/PowerGridPlanning.jl:
- Models and Methods — formulations, switching methods, objectives, hardening
- Data — bundled reference data, supported networks, solar/census/wildfire pipelines
- Usage Guide — every
solve_ots,solve_opf, andverify_acparameter - Command-Line Interface — running studies from the terminal
- Examples — 17 worked examples
- Results Dictionary and Plotting
- API Reference
Requires Julia 1.10+. Planning solves default to Gurobi (academic licenses available), but any JuMP-compatible MIP solver can be supplied via the :optimizer parameter — e.g. the open-source HiGHS (:optimizer => HiGHS.Optimizer). Ipopt, included, handles AC verification.
using Pkg
Pkg.add("PowerGridPlanning")To track the latest development version on main instead of the registered release:
Pkg.add(url="https://github.com/rpiansky3/PowerGridPlanning.jl")The repository ships with a reference dataset in test_data/ covering June 2020 for all six networks. Use :data_dir => "test_data" to run immediately after cloning — no additional data download required.
using PowerGridPlanning
opt_parameters = Dict(
:network => "RTS",
:model => "DCOTS",
:objective => "loadshed",
:times => [(2020, 6, 15)], # June 15, 2020 — available for all 6 networks
:data_dir => "test_data"
)
results = solve_ots(opt_parameters)
println("Solve time: $(results[:solve_time]) seconds")
println("Total load shed: $(results[:total_load_shed]) MW")
println("Risk reduction: $(results[:risk_reduction_pct])%")
println("Lines switched off: $(length(results[:switched_off_lines][1]))")A full walkthrough is available as an executed tutorial in the docs and as a Jupyter notebook at tutorial.ipynb. Both are generated from the same source (docs/lit/tutorial.jl), so they never drift apart — edit the Literate source, not the notebook.
julia --project=. test/runtests.jl # CI suite — no Gurobi license required
julia --project=. test/runtests_full.jl # Full suite — requires Gurobi license
PGP_LIVE_TESTS=1 julia --project=. test/runtests.jl # Opt-in: adds live Census API testIf you use this package in your research, please cite:
@software{PowerGridPlanning_jl,
author = {Piansky, Ryan},
title = {PowerGridPlanning.jl: Transmission Grid Planning with Co-Optimized Switching, Hardening, and Storage},
year = {2026},
version = {0.2.0},
url = {https://github.com/rpiansky3/PowerGridPlanning.jl}
}This package is released under the MIT License.
For questions, bug reports, or feature requests, please open an issue on the GitHub repository.
This package builds upon optimal transmission switching formulations for wildfire risk mitigation, incorporating both DC and linearized AC power flow models.