Skip to content

Commit

Permalink
Merge pull request e2nIEE#14 from e2nIEE/julia_pkg
Browse files Browse the repository at this point in the history
update gurobi installation for linux
  • Loading branch information
MMajidi137 authored Oct 12, 2021
2 parents 77de654 + adc996d commit 46cd8b7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions doc/opf/powermodels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Optimization with PandaModels.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.5 <https://julialang.org/downloads/oldreleases/>`_ is the most recent version of Julia that supports all these packages.
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 <https://julialang.org/downloads/oldreleases/>`_ 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 PandaModels through pandapower, but it might help for debugging to install an IDE such as `Juno <http://docs.junolab.org/latest/man/installation>`_. Also, PyCharm has a Julia Plugin.

Expand Down Expand Up @@ -45,11 +45,13 @@ Optional additional solvers, such as `Gurobi <https://www.gurobi.com/>`__ are co

1. Download and install from `Gurobi download <https://www.gurobi.com/downloads/>`__ (you'll need an account for this)

2. Get your Gurobi license at `Gurobi license <https://www.gurobi.com/downloads/licenses/>`__ and download it (remember where you stored it).
2. Run the file to get the gurobi folder, e.g., in linux you need to run :code:`tar -xzf gurobi<version>_linux64.tar.gz`

3. Activate the license by calling :code:`grbgetkey YOUR_KEY` as described on the Gurobi license page.
3. Get your Gurobi license at `Gurobi license <https://www.gurobi.com/downloads/licenses/>`__ and download it (remember where you stored it).

4. Add some Gurobi paths and the license path to your local PATH environment variables. In linux you can just open your `.bashrc` file with, e.g., :code:`nano .bashrc` in your home folder and add:
4. Activate the license by calling :code:`grbgetkey YOUR_KEY` as described on the Gurobi license page.

5. Add some Gurobi paths and the license path to your local PATH environment variables. In linux you can just open your `.bashrc` file with, e.g., :code:`nano .bashrc` in your home folder and add:

::

Expand All @@ -73,7 +75,7 @@ Optional additional solvers, such as `Gurobi <https://www.gurobi.com/>`__ are co
export GRB_LICENSE_FILE="/PATH_TO_YOUR_LICENSE_DIR/gurobi.lic"


5. Install the `julia - Gurobi interface <https://github.com/jump-dev/Gurobi.jl>`_ with
7. Install the `julia - Gurobi interface <https://github.com/jump-dev/Gurobi.jl>`_ and set the GUROBI_HOME environment with

:code:`julia -e 'import Pkg; Pkg.add("Gurobi");'`

Expand All @@ -83,9 +85,9 @@ Optional additional solvers, such as `Gurobi <https://www.gurobi.com/>`__ are co

inside Julia package mode.

6. Build and test your Gurobi installation by entering :code:`julia` prompt and then :code:`import Pkg; Pkg.build("Gurobi")`. This should compile without an error.
8. Build and test your Gurobi installation by entering :code:`julia` prompt and then :code:`import Pkg; Pkg.build("Gurobi")`. This should compile without an error.

7. Now, you can use Gurobi to solve your linear problems, e.g., the DC OPF, with :code:`runpm_dc_opf(net, pm_model="DCPPowerModel", pm_solver="gurobi")`
9. Now, you can use Gurobi to solve your linear problems, e.g., the DC OPF, with :code:`runpm_dc_opf(net, pm_model="DCPPowerModel", pm_solver="gurobi")`


Usage
Expand All @@ -101,4 +103,4 @@ The usage is explained in the `PowerModels tutorial <https://github.com/e2nIEE/p

The TNEP optimization is explained in the `PowerModels TNEP tutorial <https://github.com/e2nIEE/pandapower/blob/develop/tutorials/tnep_powermodels.ipynb>`__. Additional packages including "juniper"

.. autofunction:: pandapower.runpm_tnep
.. autofunction:: pandapower.runpm_tnep

0 comments on commit 46cd8b7

Please sign in to comment.