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)
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.
PYPOWER depends upon these prerequisites on the level of the operating system:
- Python 2.7 - 3.9
PYPOWER is recommended to be installed into a virtual environment:
$ python3.8 -m venv venv # Or any supported Python version
PYPOWER depends upon SciPy, which can be installed as follows:
$ venv/bin/python -m pip install -r requirements.txt
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
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
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.
Questions and comments regarding PYPOWER should be directed to the mailing list:
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.
- 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
- PyCIM