Skip to content

Supplementary function and port of MATPOWER in Python.

License

Notifications You must be signed in to change notification settings

yasirroni/mypower

Repository files navigation

mypower

Supplementary function and port of MATPOWER in Python, powered by octave via oct2py.

Requirements

Octave (Tutorial for Windows 10)

  1. Download octave.

  2. Install octave, and write down the installation destination path.

    C:\Program Files\octave-7.3.0-w64
    
  3. From the installation destination path, find the octave client path, that is the path to octave-cli.exe under mingw64\bin\ folder. Copy the path.

    C:\Program Files\octave-7.3.0-w64\mingw64\bin\octave-cli.exe
    
  4. Open Environment Variable. You can access it by pressing Windows-Key, type edit the system environment variables, and press Enter to search.

  5. Click Environment Variables.

  6. Under System variables, click New....

  7. Fill the Variable name with OCTAVE_EXECUTABLE, and Variable 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

  8. Restart (not shutdown, but restart) the computer to make os.environ recognize the new path.

oct2py

  1. Install oct2py from python PyPI using a command prompt.

    pip install oct2py
  2. Check octave and oct2py installation by running the below python code.

    from oct2py import octave
    
    octave.path()

MATPOWER

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.

Usage

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.

Citing mypower

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.

Authors

See also the list of contributors who participated in this project.

Feel free if you want to contribute.

Acknowledgment

This repository was supported by the Faculty of Engineering, Universitas Gadjah Mada under the supervision of Mr. Sarjiya

About

Supplementary function and port of MATPOWER in Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages