OPFLearn.jl Documentation
Package Overview
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 paper, "OPF-Learn: An Open-Source Framework for Creating Representative AC Optimal Power Flow Datasets". A Python interface for OPFLearn.jl is available at opflearn.
Installation
If you haven’t already, your first step should be to install Julia. Instructions are available at julialang.org/downloads.
Installing OPFLearn can now be done using the Julia package manager.
] add OPFLearn
For the development version of OPFLearn, install the package with,
] add OPFLearn#main
By default OPFLearn uses IPOPT to solve AC OPF problems, which comes installed as a dependancy of OPFLearn. When using different formulations for relaxed AC OPF problems, such as a Semidefinite Relaxation, additional solvers are required. For conic AC OPF formulations a conic solver must be installed. OPFLearn was tested with the SCS solver, which can be installed with
] add SCS
Testing that the OPFLearn package works properly can be done with
] test OPFLearn
To test distributed dataset creation the following commands can be entered in the REPL, where nproc is the number of processors to run the test with as a string.
using Pkg
nproc = "4"
Pkg.test("OPFLearn"; test_args = [nproc])
OPFLearn can take a while to start up on the first run of each session as Julia takes a notable amount of time to precompile IPOPT.
In the current release of OPFLearn the distributed dataset creation tests can get stuck loading packages on distributed processors. If you run into this issue, you can inturrupt these tests with 'ctrl+c'.