https://github.com/ai4opt/pglearn.jl

Instance generator for OPF problems

https://github.com/ai4opt/pglearn.jl

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.0%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Instance generator for OPF problems

Basic Info
  • Host: GitHub
  • Owner: AI4OPT
  • License: mit
  • Language: Julia
  • Default Branch: main
  • Size: 879 KB
Statistics
  • Stars: 6
  • Watchers: 3
  • Forks: 4
  • Open Issues: 23
  • Releases: 0
Created almost 4 years ago · Last pushed 10 months ago
Metadata Files
Readme License

README.md

Copyright Georgia Tech 2022-2024

Build codecov docs-dev

PGLearn

Instance generator for various OPF problems.

Installation instructions

This repository is a non-registered Julia package.

  • Option 1: install as a Julia package. You can use it, but not modify the code julia using Pkg Pkg.add(url="git@github.com:AI4OPT/PGLearn.jl.git")

  • Option 2: clone the repository. Use this if you want to change the code bash git clone git@github.com:AI4OPT/PGLearn.jl.git To use the package after cloning the repo bash $ cd PGLearn $ julia --project=. julia> using PGLearn

    If you are modifying the source code, it is recommened to use the package Revise.jl so that you can use the changes without having to start Julia. Make sure you load Revise before loading PGLearn in your julia session. julia using Revise using PGLearn

Using HSL solvers (ma27, ma57)

Please refer to Ipopt.jl installation instructions for how to install non-default linear solvers, e.g., HSL, Pardiso, etc... Note that a specific license may be required.

To use HSL linear solvers when solving OPF instances, set the parameter "linearsolver" to "ma27" or "ma57" in the config file. The recommended solver for Ipopt is ma27. ```toml solver.name = "Ipopt" solver.attributes.linearsolver = "ma27" ```

Quick start

Building and solving an OPF problem

```julia using PGLib, PowerModels using PGLearn using Ipopt

Load data from PGLib case

pmnetwork = PowerModels.makebasicnetwork(pglib("14ieee")) data = PGLearn.OPFData(pm_network)

Build OPF optimization model

To switch formulations, replace ACOPF with, e.g., DCOPF or SOCOPF

opf = PGLearn.build_opf(PGLearn.ACOPF, data, Ipopt.Optimizer)

Solve and extract result

PGLearn.solve!(opf) res = PGLearn.extract_result(opf) ```

Generating random OPF instances

```julia using Random using PGLib, PowerModels using PGLearn

Load data from PGLib case

pmnetwork = PowerModels.makebasicnetwork(pglib("14ieee")) data = PGLearn.OPFData(pm_network)

Load scaler using global scaling + uncorrelated LogNormal noise

config = Dict( "load" => Dict( "noisetype" => "ScaledUniform", "l" => 0.8, "u" => 1.2, "sigma" => 0.10,
) ) opf
sampler = SimpleOPFSampler(data, config)

Generate a new instance

rng = MersenneTwister(42) newdata = rand(rng, opfsampler)

data.pd[1] # old 0.217

new_data.pd[1] # new 0.21480423013573954 # ⚠️ exact value depends on Julia version) ```

To generate multiple instances, run the above code in a loop julia dataset = [ PGLearn.rand(rng, opf_sampler) for i in 1:100 ]

Generating datasets

A script for generating multiple ACOPF instances is given in exp/sampler.jl.

It is called from the command-line as follows: bash julia --project=. exp/sampler.jl <path/to/config.toml> <seed_min> <seed_max> where * <path/to/config.toml> is a path to a valid configuration file in TOML format (see exp/config.toml for an example) * <seed_min> and <seed_max> are minimum and maximum values for the random seed. Must be integer values. The script will generate instances for values smin, smin+1, ..., smax-1, smax.

Acknowledgements

This material is based upon work supported by the National Science Foundation under Grant No. 2112533 NSF AI Institute for Advances in Optimization (AI4OPT). Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.

Owner

  • Name: AI4OPT
  • Login: AI4OPT
  • Kind: organization

GitHub Events

Total
  • Issues event: 14
  • Watch event: 2
  • Delete event: 8
  • Issue comment event: 28
  • Push event: 55
  • Pull request review comment event: 26
  • Pull request review event: 24
  • Pull request event: 16
  • Fork event: 1
  • Create event: 7
Last Year
  • Issues event: 14
  • Watch event: 2
  • Delete event: 8
  • Issue comment event: 28
  • Push event: 55
  • Pull request review comment event: 26
  • Pull request review event: 24
  • Pull request event: 16
  • Fork event: 1
  • Create event: 7

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 2
  • Total pull requests: 3
  • Average time to close issues: 23 days
  • Average time to close pull requests: 3 days
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 3.5
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 2
  • Pull requests: 3
  • Average time to close issues: 23 days
  • Average time to close pull requests: 3 days
  • Issue authors: 2
  • Pull request authors: 2
  • Average comments per issue: 3.5
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • klamike (3)
  • mtanneau (2)
  • allensctong (2)
  • ivanightingale (1)
  • hoang-tn (1)
Pull Request Authors
  • klamike (4)
  • dependabot[bot] (3)
  • ivanightingale (2)
  • mtanneau (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (3) github_actions (3)

Dependencies

.github/workflows/CompatHelper.yml actions
.github/workflows/ci.yml actions
  • actions/cache v1 composite
  • actions/checkout v2 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/documentation.yml actions
  • actions/checkout v4 composite
  • julia-actions/cache v1 composite
  • julia-actions/setup-julia v2 composite
.github/workflows/doc_cleanup.yml actions
  • actions/checkout v4 composite