Download & Installation

The openTEPES model has been tested using the latest versions of Python 3.14.6 and Pyomo 6.10.1, and it uses Gurobi 13.0.2 as a commercial MIP solver, for which a free academic license is available. It uses Pyomo so that it is independent of the preferred solver. Alternatively, you can use one of the free solvers HiGHS 1.15.1, SCIP 10.0.2, GLPK 5.0, or CBC 2.10.13. You can list the serial solver interfaces available under Pyomo with this call:

pyomo help -s

The Gurobi, HiGHS, SCIP, and GLPK solvers can be installed as packages:

conda install -c gurobi      gurobi
pip   install                highspy
conda install -c conda-forge pyscipopt
conda install                glpk

The openTEPES model can also be solved with GAMS and a valid GAMS license for a solver. The GAMS language is not included in the openTEPES package and must be installed separately. This option is activated by calling the openTEPES model with the solver name ‘gams’.

It also requires the following packages:

  • Pandas for reading input data and writing results

  • psutil for detecting the number of CPUs

  • Plotly, Altair, and Colour for plotting results and drawing the network map

  • NetworkX for representing the DC power flow formulation with cycle constraints

Cases

Here are the input files for:

Code

The openTEPES code is provided under the GNU Affero General Public License:

  • the code cannot become part of a closed-source commercial software product

  • any future changes and improvements to the code remain free and open

The source code can be downloaded from GitHub or installed with pip.

This model is a work in progress and will be updated accordingly. If you want to subscribe to openTEPES model updates, send an email to andres.ramos@comillas.edu.

Installation

Installation guide.

There are two ways to get all the required packages under Windows. We recommend using the Python distribution Miniconda. If you do not want to use it or already have an existing Python installation, you can also download the required packages on your own.

Miniconda (recommended)

  1. Install Miniconda. Choose the 64-bit installer if possible.

    1. During the installation procedure, keep both checkboxes “modify the PATH” and “register Python” selected! If only higher Python versions are available, you can switch to a specific Python version by typing conda install python=<version>.

    2. Remark: if Anaconda or Miniconda was installed previously, please check that Python is registered in the environment variables.

  2. Packages and Solver:

    1. Launch a new Anaconda prompt (or a terminal in any IDE)

    2. HiGHS is our recommendation if you want a free and open-source solver.

    3. Install openTEPES via pip by running pip install openTEPES

Continue at Get started.

GitHub Repository (the hard way)

  1. Clone the openTEPES repository

  2. Launch the Anaconda prompt (or a terminal in any IDE)

  3. Navigate to the repository directory with cd "C:\Users\<username>\...\openTEPES". (Note that the path is where the repository was cloned.)

  4. Install openTEPES via pip by running pip install .

Solvers

HiGHS

The HiGHS solver can also be used. It can be installed using: pip install highspy.

Gurobi

Another recommendation is to use the Gurobi solver. It is a commercial solver, but it is more powerful than open-source solvers for large-scale problems. As a commercial solver, it requires a license, which is free of charge for academic use and can be obtained by signing up on the Gurobi website. You can also ask for a 30-day evaluation license to test the solver. It can be installed using conda install -c gurobi gurobi, and then you can request an academic or commercial license. Activate the license on your computer using the grbgetkey command (you need to be in a university internet domain if you are installing an academic license).

GLPK

An easy option to install is the free and open-source GLPK solver. However, it can be very slow for large-scale problems. It can be installed using: conda install glpk.

CBC

The CBC solver is another free and open-source solver. For Windows users, the easiest way to install the CBC solver is to download the binaries from this site and copy the cbc.exe file into the “bin” directory of the Anaconda or Miniconda environment, which is on the PATH. Under Linux, it can be installed using: conda install -c conda-forge coincbc.

Mosek

Another alternative is the Mosek solver. Note that it is a commercial solver, and you need a license for it. Mosek is a good alternative for dealing with QP, SOCP, and SDP problems. You only need to run conda install -c mosek mosek for installation and then request a license (academic or commercial). You can apply for an academic license here. Mosek also provides a license guide. If you request an academic license, you will receive it by email and only need to place it in the path C:\Users\<username>\mosek on your computer.

GAMS

The openTEPES model can also be solved with GAMS and a valid GAMS license for a solver. The GAMS language is not included in the openTEPES package and must be installed separately. This option is activated by calling the openTEPES model with the solver name ‘gams’.

Get started

Developers

By cloning the openTEPES repository, you can create branches and propose pull requests. Any help will be greatly appreciated.

Users

If you are not planning on developing, please follow the instructions in Installation.

Once installation is complete, openTEPES can be executed in test mode from a command prompt. In the directory of your choice, run the openTEPES_Main command by typing the following in the command prompt (Windows) or terminal (Linux); depending on your default Python version, you might need to call python3 instead of python:

openTEPES_Main

You will then be asked for five parameters (case, dir, solver, results, and console log).

Remark: at this step, just press Enter for each input, and openTEPES will be executed with the default parameters.

After this, in a directory of your choice, make a copy of the 9n or sSEP case to create a new case of your choice, keeping the current format of the CSV files. You can then run openTEPES_Main properly by entering the new case and the directory of your choice. Note that the solver is glpk by default, but it can be changed to any other solver that Pyomo supports (e.g., gurobi, highs).

Then, the results are written to the folder named after the case. The results contain plots and summary spreadsheets for multiple optimized energy scenarios, periods, and load levels, as well as the investment decisions.

Note that there is an alternative way to run the model: create a new script, script.py, and write the following:

from openTEPES.openTEPES import openTEPES_run

openTEPES_run(<dir>, <case>, <solver>, <results>, <log>)

A case can be a CSV directory or a single .duckdb file (see Electric System Input Data). To run many related cases at once — scenario ensembles or sensitivity sweeps — see Multiple runs.

Run the Tutorial

The tutorial can be run in Binder:

Binder badge: launch the openTEPES tutorial