Skip to content

Latest commit

 

History

History
41 lines (22 loc) · 3.01 KB

powermodels.rst

File metadata and controls

41 lines (22 loc) · 3.01 KB

Optimization with PowerModels.jl

Installation

If you are not yet using Julia, install it. Note that you need a version that is supported PowerModels, PyCall and pyjulia for the interface to work. Currently, Julia 1.1 is the most recent version of Julia that supports all these packages.

Note

You don't necessarily need a Julia IDE if you are using PowerModels through pandapower, but it might help for debugging to install an IDE such as Juno. Also, PyCharm has a Julia Plugin.

  1. Add the Julia binary folder (e.g. /Julia-1.1.0/bin) to the system variable PATH. Providing the path is correct, you can now enter the julia prompt by executing julia in your shell.
  2. The library PyCall allows to use Python from inside julia. By default, PyCall uses the Conda.jl package to install a Miniconda distribution private to Julia. To use an already installed Python distribution (e.g. Anaconda), set the PYTHON environment variable inside the Julia prompt to e.g.: ENV["PYTHON"]="C:\\Anaconda3\\python.exe".
  3. Access the package mode by typing ]. Now install the packages: add Ipopt PowerModels PyCall.
  4. Test your PowerModels installation by executing test PowerModels. Then, test if calling Python from Julia works as described here.

Note

If you cannot plot using PyCall and PyPlot in Julia, see the workarounds offered here.

  1. To call Julia from Python, install the pyjulia package with pip install julia. Afterwards, test if everything works by importing PowerModels from Python with: from julia.PowerModels import run_ac_opf. This takes some time, since Python starts a julia instance in the background, but it if the import completes without error everything is configured correctly and you can now use PowerModels to optimize pandapower networks.
  2. Additional packages are required to use the pandapower - PowerModels.jl interface. Install the "JSON" and "JuMP" packages with, e.g., julia -e 'import Pkg; Pkg.add("JSON"); Pkg.add("JuMP")' or by entering ] inside the julia console and calling add JSON add JuMP

Usage

The usage is explained in the PowerModels tutorial.

pandapower.runpm_ac_opf

pandapower.runpm_dc_opf

pandapower.runpm

The TNEP optimization is explained in the PowerModels TNEP tutorial. Additional packages including "juniper"

pandapower.runpm_tnep