pyopf

PyOPF: Python-based Optimal Power Flow Modeling

https://github.com/yasirroni/pyopf

Science Score: 67.0%

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

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.6%) to scientific vocabulary
Last synced: 9 months ago · JSON representation ·

Repository

PyOPF: Python-based Optimal Power Flow Modeling

Basic Info
  • Host: GitHub
  • Owner: yasirroni
  • License: mit
  • Default Branch: main
  • Homepage:
  • Size: 182 KB
Statistics
  • Stars: 3
  • Watchers: 0
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Created over 2 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

GitHub codecov DOI

:zap: PyOPF: Optimal Power Flow Modeling in Python

PyOPF is Optimal Power Flow (OPF) modeling framework in Python. This modeling is basically based on Pyomo, which is a solver-agnostic optimization modeling package in Python. PyOPF generally can take PGLib based input and formulate various OPF problems including AC-OPF, DC-OPF.

Installation

pip install opf

  • Dependencies
    • python>=3.8
    • pyomo>=6.5.0
    • numpy>=1.22.3
    • ipopt>=1.0.3

Formulations

  1. :o: AC-OPF (AC Optimal Power Flow): python model = opf.build_model('acopf')

    • AC-OPF with a polar bus voltage variable representations.
    • The detailed formulation can be found in PGLib.
    • PyOPF takes the the input files from PGLib, which is basically based on MATPOWER format.
    • Uses various solvers supported in Pyomo including IPOPT and Gurobi to solve problem instances.
  2. :o: DC-OPF (DC Optimal Power Flow) python model = opf.build_model('dcopf') # base DC-OPF model model = opf.build_model('dcopf-ptdf') # DC-OPF model using PTDF

    • Linear approximation to AC-OPF.
    • Also support PTDF (power transfer distribution factor) based formulation.
    • Only use active power generations and bus voltage angles (for base DC-OPF) as variables.
    • Like AC-OPF, PGLib m-files can be taken as input.

Warmstarting

  • PyOPF fully supports primal and dual warmstarting for IPOPT. Documentation is to be added. python model.setup_warmstart(warmstart_solution_dict)

Examples

Running AC-OPF from PGLib.

  • Before solving the AC-OPF, you should install IPOPT, which is a canonical solver for AC-OPF, as follows: conda install -c conda-forge ipopt

  • Running the following AC-OPF problem ```python import opf

    build abstract model for AC-OPF

    model = opf.build_model('acopf')

    load pglib input model file

    network = opf.parsefile("./data/pglibopfcase5pjm.m")

    create the model instance (concrete model)

    model.instantiate(network)

    solve the problem

    result = model.solve(solveroption={'printlevel' : 5, 'linear_solver': 'ma27'}, tee=True)

    check the optimal objective value

    print('obj value', result['obj_cost'])

    check the (primal) optimal solution

    print('primal solution', result['sol']['primal']) ```

Citation

  • If you exploit this repository in your research, please cite using the following BibTeX:

@software{ PyOPF_2023, author = {Park, Seonho}, doi = {10.5281/zenodo.7772531}, license = {MIT}, month = {10}, title = {{PyOPF: Optimal Power Flow Modeling in Python}}, version = {0.3.1}, year = {2023} }

Owner

  • Name: Muhammad Yasirroni
  • Login: yasirroni
  • Kind: user
  • Location: Indonesia
  • Company: Universitas Gadjah Mada

Citation (CITATION.cff)

cff-version: 1.2.0
message: "PyOPF: Python-based Optimal Power Flow Modeling"
authors:
  - family-names: Park
    given-names: Seonho
    email: park.seonho@gmail.com
    orcid: https://orcid.org/0000-0002-4726-2441
title: "PyOPF: Optimal Power Flow Modeling in Python"
version: 0.3.0
date-released: 2023-03-15
license: MIT
doi: 10.5281/zenodo.7772531	

GitHub Events

Total
  • Watch event: 1
  • Push event: 6
Last Year
  • Watch event: 1
  • Push event: 6