PandaModels.jl
Overview
PandaModels.jl (pandapower + PowerModels) is a Julia package which containing supplementary data and codes to prepare pandapower networks in a compatible format for Julia packages which are based on InfrastructureModels, such as PowerModels.jl to run and calculate steady-state power network optimization. These packages use JuMP as an optimization environment.
As the figure below illustrates, with the help of PandaModels, pandapower and PowerModels.jl are connected in a functional way. The pandapower-PowerModels (PM-PP) converter enables conversion from the pandapower format to the PowerModels format. After the optimization in PowerModels, the PP-PM converter transforms the optimization results back to the original pandapower grid model, which can be used for further analysis. In addition to the existing PowerModels optimization models, pandamodels enables adding custom optimization models. Presently, reactive power optimizations can be down with pandamodels to maintain voltage setpoints, maintain reactive power setpoints, and minimize active power losses.
Installation
Install Julia
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.5 is the most recent stable version of Julia that supports all these packages.
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.
Add the Julia binary folder (e.g. /Julia-1.5.0/bin) to the system variable PATH Providing the path is correct, you can now enter the Julia
prompt by executing:
$ julia
Install PyCall
The Julia package PyCall allows to call Python
in Julia
. By default, PyCall
uses the Conda.jl package to install a Miniconda distribution private to Julia.
import Pkg
Pkg.add("PyCall")
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"
import Pkg
Pkg.build("PyCall")
test if calling Python
from Julia
works as described here.
If you cannot plot using PyCall
and PyPlot
in Julia, see the workarounds offered here.
Install PyJulia
At the moment only the pip
package manager, not conda
, is supported in Python
to install the PyJulia package, the name of the PyJulia
package in pip
is Julia
:
pip install julia
Install Package
If you want to use the PandaModels.jl package out of Python/pandapower environment, you can install is as a registered package by using the Julia package manager:
import Pkg
Pkg.add("PandaModels")
Pkg.build("PandaModels")
Pkg.resolve()
Otherwise, the package will be automatically installed in pandapower environment by applying the PyJulia
-PyCall
interface.
Acknowledgements
This package has been developed as part of the Department of Energy Management and Power System Operation (e²n), University of Kassel and Fraunhofer Institute for Energy Economics and Energy System Technology (IEE).
The developers thank Carleton Coffrin, the primary developer of PowerModels.jl, for his support.