Supplementary function and port of MATPOWER in Python, powered by octave via oct2py.
-
Download octave.
-
Install octave, and write down the installation destination path.
C:\Program Files\octave-7.3.0-w64
-
From the installation destination path, find the octave client path, that is the path to
octave-cli.exe
undermingw64\bin\
folder. Copy the path.C:\Program Files\octave-7.3.0-w64\mingw64\bin\octave-cli.exe
-
Open Environment Variable. You can access it by pressing Windows-Key, type
edit the system environment variables
, and press Enter to search. -
Click
Environment Variables
. -
Under
System variables
, clickNew...
. -
Fill the
Variable name
withOCTAVE_EXECUTABLE
, andVariable value
with the octave client path.Variable name:
OCTAVE_EXECUTABLE
Variable value:
C:\Program Files\octave-7.3.0-w64\mingw64\bin\octave-cli.exe
-
Restart (not shutdown, but restart) the computer to make
os.environ
recognize the new path.
-
Install
oct2py
from python PyPI using a command prompt.pip install oct2py
-
Check
octave
andoct2py
installation by running the below python code.from oct2py import octave octave.path()
The recommended way to install MATPOWER from python is using matpower-pip.
pip install matpower
If you already have MATPOWER installed, you can pass the path to mypower when starting matpower instance.
To use oct2py based MATPOWER, use:
import mypower as myp
m = myp.start_matpower()
mypc = m.runpf(nout=1) # nout specify number of returned variable from Octave
See the tutorial for a detailed example.
We do request that publications derived from the use of mypower
, explicitly acknowledge that fact by citing the appropriate paper(s) and the software mentioned in MATPOWER publication and the following citation:
M. Yasirroni, Sarjiya, "mypower: Supplementary function and Python port of MATPOWER", GitHub, 2021. [Online]. Available: https://github.com/yasirroni/mypower.
If a journal publication from the author appears, it also needs to be cited.
- Muhammad Yasirroni - yasirroni
See also the list of contributors who participated in this project.
Feel free if you want to contribute.
This repository was supported by the Faculty of Engineering, Universitas Gadjah Mada under the supervision of Mr. Sarjiya