Skip to main content

PYPOWER is a power flow and Optimal Power Flow (OPF) solver. It is a port of MATPOWER to the Python programming language. Current features include:

  • DC and AC (Newton’s method & Fast Decoupled) power flow and

  • DC and AC optimal power flow (OPF)

Status

libraries pyversions license downloads travis pypi_version

Prerequisites

PYPOWER depends upon these prerequisites on the level of the operating system:

Virtual Environment

PYPOWER is recommended to be installed into a virtual environment:

$ python3.8 -m venv venv  # Or any supported Python version

Dependencies

PYPOWER depends upon NumPy, SciPy and PyRLU which can be installed as follows:

$ venv/bin/python -m pip install -r requirements.txt

Installation

The recommended way of installing PYPOWER is using pip:

$ venv/bin/python -m pip install PYPOWER

Alternatively, download and unpack the tarball and install:

$ tar zxf PYPOWER-5.x.y.tar.gz
$ venv/bin/python setup.py install

Testing

PYPOWER can be tested locally using the same tooling as on Travis CI:

$ venv/bin/python -m tox -e py27,py38  # Or any supported Python version

Using PYPOWER

Installing PYPOWER creates pf and opf commands. To list the command options:

$ venv/bin/pf -h

or:

$ venv/bin/opf -h

PYPOWER includes a selection of test cases. For example, to run a power flow on the IEEE 14 bus test case:

$ venv/bin/pf -c case14

Alternatively, the path to a PYPOWER case data file can be specified:

$ venv/bin/pf /path/to/case14.py

The opf command has the same calling syntax. For example, to solve an OPF for the IEEE Reliability Test System and write the solved case to file:

$ venv/bin/opf -c case24_ieee_rts --solvedcase=rtsout.py

For further information please refer to https://rwl.github.io/PYPOWER/ and the API documentation.

Support

Questions and comments regarding PYPOWER should be directed to the mailing list:

pypower@googlegroups.com

Changelog

Version 5.1.21 (2026-08-01)

  • [CHANGE] Replaced all deprecated numpy.in1d usage with numpy.isin.

Version 5.1.5 (2020-10-21)

  • [NEW] Added new function: AC continuation power flow

Version 5.1.2 (2017-06-09)

  • [NEW] Configured continuous integration using Travis.

Version 5.1.0 (2017-06-09)

  • [NEW] Added Python 3 support.

Version 5.0.1 (2016-07-04)

  • [FIX] Fixed issue #21 and issue #25 in savecase() (pull request #26).

  • [CHANGE] Based on ‘recursion limit’ issues affecting savemat() in savecase(), converted non-scalars to arrays.

  • [NEW] Created t_savecase.py and added t_savecase() to test_pypower.py.

Version 5.0.0 (2015-05-29)

  • [CHANGE] 3-clause BSD License

Version 4.1.2 (2014-10-27)

Version 4.1.1 (2014-09-17)

  • [FIX] loadcase.py: Fixed NumPy 1.9 warning about “== None” comparisions.

Version 4.1.0 (2014-05-29)

  • [NEW] Support for Python 3 (3.3 and above).

  • [CHANGE] Updated to MATPOWER 4.1.

  • [REMOVED] Support for Python 2.5 and below.

Version 4.0.1 (2011-07-14)

  • [CHANGE] printpf.py: changed boolean operators from bitwise to logical to fix the output options

  • [FIX] savecase.py: adding indentation to produce valid Python modules

Version 4.0.0 (2011-07-07)

Initial release, port of MATPOWER version 4.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypower-5.1.21.tar.gz (249.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pypower-5.1.21-py2.py3-none-any.whl (347.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pypower-5.1.21.tar.gz.

File metadata

  • Download URL: pypower-5.1.21.tar.gz
  • Upload date:
  • Size: 249.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pypower-5.1.21.tar.gz
Algorithm Hash digest
SHA256 e5f5a8954cc7e339dff6c6feefc242268d7db41a151da22406d1c3dac6e3010a
MD5 91ff0afb50f24676fd7d7a1c89e7de0b
BLAKE2b-256 bca7e52848d7e82f6e97314787293ffff522c98a1d072c1388948f0d7dc9e606

See more details on using hashes here.

File details

Details for the file pypower-5.1.21-py2.py3-none-any.whl.

File metadata

  • Download URL: pypower-5.1.21-py2.py3-none-any.whl
  • Upload date:
  • Size: 347.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pypower-5.1.21-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cf61990475a34b10d639ead84bd4ded608170fc7d16d69022bb9e3948731303d
MD5 e8784e285fcaf383df865e83184de84b
BLAKE2b-256 64d4b30e11b01b20f89b9974b879d0ecfc4f0d68b66d0ebb21f5365239915053

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page