Solves power flow and optimal power flow problems
Project description
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
PYPOWER is no longer actively maintained. However, should improvements to PYPOWER be required then the original author may be available on contract. Please do not hesitate to get in contact directly.
Prerequisites
PYPOWER depends upon these prerequisites on the level of the operating system:
Python 2.7 - 3.9
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 SciPy, 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:
License & Copyright
Copyright (c) 1996-2015, Power System Engineering Research Center (PSERC) Copyright (c) 2010-2021 Richard Lincoln
The code in PYPOWER is distributed under the 3-clause BSD license below. The PYPOWER case files distributed with PYPOWER are not covered by the BSD license. In most cases, the data has either been included with permission or has been converted from data available from a public source.
While not required by the terms of the license, we do request that publications derived from the use of MATPOWER explicitly acknowledge that fact by citing:
R. D. Zimmerman, C. E. Murillo-Sanchez, and R. J. Thomas, “MATPOWER: Steady-State Operations, Planning and Analysis Tools for Power Systems Research and Education,” Power Systems, IEEE Transactions on, vol. 26, no. 1, pp. 12–19, Feb. 2011.
Links
MATPOWER from PSERC (Cornell)
matpower.app MATPOWER web application based on GNU Octave in WebAssembly
Oct2PYPOWER Python bridge to MATPOWER using Oct2Py
pandapower from Fraunhofer IWES and University of Kassel
TESP from PNNL
MatDyn by Stijn Cole
PSAT by Federico Milano
OpenDSS from EPRI
GridLAB-D from PNNL
Changelog
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)
[FIX] Fixed error in runopf() (issue #11).
[FIX] Fixed runpf.py with ENFORCE_Q_LIMS option (pull request #13).
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file PYPOWER-5.1.15.tar.gz
.
File metadata
- Download URL: PYPOWER-5.1.15.tar.gz
- Upload date:
- Size: 249.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d01e40f1850937e1a4e34ab3c7aa5c76006b23d4cc8a547818b26a808303c8a8 |
|
MD5 | d033a6f3bc54ee175ab423858ce65ca9 |
|
BLAKE2b-256 | 44d172199e71a827f54581e6c8bfb2b4320573030f8c072400070aa1ad266f66 |
File details
Details for the file PYPOWER-5.1.15-py2.py3-none-any.whl
.
File metadata
- Download URL: PYPOWER-5.1.15-py2.py3-none-any.whl
- Upload date:
- Size: 346.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba37c6dafe81c8c1f1f7d8676383e59ae048feac99069d7d053f89671e074b0a |
|
MD5 | a3defe1df1e54a83cb94ae4519644332 |
|
BLAKE2b-256 | 7a468db1ade05ab6eaa218a319a9fe7b9077706f92b67d8d1d2018dbc805ae55 |