OPFLearn.jl is a Julia package for creating datasets for machine learning approaches to solving AC optimal power flow (AC OPF). It was developed to provide researchers with a standardized way to efficiently create AC OPF datasets that are representative of more of the AC OPF feasible load space compared to typical dataset creation methods. The OPFLearn dataset creation method uses a relaxed AC OPF formulation to reduce the volume of the unclassified input space throughout the dataset creation process. Over time this input space tightens around the relaxed AC OPF feasible region to increase the percentage of feasible load profiles found while uniformly sampling the input space. Load samples are processed using AC OPF formulations from PowerModels.jl. More information on the dataset creation method can be found in our publication, "OPF-Learn: An Open-Source Framework for Creating Representative AC Optimal Power Flow Datasets".
To use OPFLearn.jl a PowerModels network data dictionary is required (can be loaded from Matpower ".m" files) to define the network the dataset is being created for. Datasets created using OPFLearn.jl can be specified to save the following parameters in per unit,
Input Data | Output Data | Dual Data |
---|---|---|
• Load Active Power (pl) • Load Reactive Power (ql) |
• Generator Active Power (pg) • Generator Reactive Power (qg) • Generator Voltage Magnitude (vm_gen) • Bus Voltage (v_bus) • Edge To Active Power (p_to) • Edge From Active Power (p_fr) • Edge To Reactive Power (q_to) • Edge From Reactive Power (q_fr) |
• Min Bus Voltage (v_min) • Max Bus Voltage (v_max) • Min Generator Active Power (pg_min) • Max Generator Active Power (pg_max) • Min Generator Reactive Power (qg_min) • Max Generator Reactive Power (qg_max) • Max Edge To Active Power (p_to_max) • Max Edge From Active Power (p_fr_max • Max Edge To Reactive Power (q_to_max) • Max Edge From Reactive Power (q_fr_max) |
The package documentation includes a variety of useful information including installation instructions and a quick-start guide.
Datasets with 10,000 samples for PGLib-OPF test networks (v21.07) case5_pjm, case14_ieee, case30_ieee, case57_ieee, and case118_ieee, can be found on the NREL Data Catalog here. NOTE: CURRENTLY, THESE OPFLEARN DATASETS HAVE INCORRECT VALUES FOR THE COMPLEX BUS VOLTAGES. THE ANGLE OF THE COMPLEX BUS VOLTAGES ('v_bus') MUST BE SCALED BY -180/π TO GET THE CORRECT VALUES. AN EXAMPLE FUNCTION IN JULIA THAT PERFORMS THIS CORRECTION ON A SINGLE 'v_bus' VALUE IS
function correct_angle_error(v_bus)
return abs(v_bus)*exp(1im*-rad2deg(angle(v_bus)))
end
The development of this code was supported in part by the U.S. Department of Energy, Office of Science, Office of Workforce Development for Teachers and Scientists (WDTS) under the Science Undergraduate Laboratory Internships Program (SULI), and the Laboratory Directed Research and Development (LDRD) Program at NREL.
The primary developer is Trager Joswig-Jones (@TragerJoswig-Jones) with support from the following contributors,
- Ahmed S. Zamzam (@asazamzam) NREL, Project Technical Lead and developed original OPFLearn MATLAB code
- Kyri Baker (@kyribaker) CU Boulder, Advised on original AC OPF formulations and dataset creation method
If you find OPFlearn useful in your work, we kindly request that you cite the following publication:
@misc{joswigjones2021opflearn,
title={OPF-Learn: An Open-Source Framework for Creating Representative AC Optimal Power Flow Datasets},
author={Trager Joswig-Jones and Kyri Baker and Ahmed S. Zamzam},
year={2021},
eprint={2111.01228},
archivePrefix={arXiv},
primaryClass={eess.SY}
}
Citation of PowerModels, used for formulating AC OPF problems, is also encouraged when publishing works that use OPFLearn. Note that OPFLearn was NOT developed in any part in collaboration with PowerModels.jl.
This code is provided under a modified BSD-3 license