Skip to content

HOPE-Model-Project/HOPE

Repository files navigation

HOPE - Holistic Optimization Program for Electricity

Docs Build Status

image

How to cite HOPE?

You can cite the paper:

Wang, S., Song, Z., Mehrtash, M., & Hobbs, B. F. (2025). HOPE: Holistic Optimization Program for Electricity. SoftwareX, 29, 101982. https://doi.org/10.1016/j.softx.2024.101982

Overview

The Holistic Optimization Program for Electricity (HOPE) model is a transparent and open-source tool for evaluating electric sector transition pathways and policy scenarios regarding power system planning, system operation, optimal power flow, and market designs. It is a highly configurable and modulized tool coded in the Julia language and optimization package JuMP. The HOPE consists of multiple modes for modeling optimization problems of modern power systems and electricity markets, including:

  1. GTEP mode: a generation & transmission expansion planning model
  2. PCM mode: a production cost model
  3. DART mode: (under development): a SCUC/SCED market model for simulating day-ahead and real-time markets
  4. OPF mode: (under development): an optimal power flow model
  5. HOPE-AI mode: an AI agent helps connect all HOPE modules and enables complex modeling workflows. The current HOPE-AI framework is powered by PowerAgent, while more specialized agents are under development.

Users can select the proper mode of HOPE based on their research needs. Each mode is modeled as linear/mixed linear programming and can be solved with open-source (i.e., Cbc, GLPK, Clp, etc.) or commercial (e.g., Gurobi and CPLEX) solver packages.

The HOPE model was originally developed by a team of researchers in Prof. Benjamin F. Hobbs's group at Johns Hopkins University. The main contributors for Verson 1 include Dr. Shen Wang, Dr. Mahdi Mehrtash, and Zoe Song. The current developers include Ziting Huang, etc.

Current HOPE model is also maintaining by researchers at MIT, including Shen Wang, Dr. Juan Senga and Prof. Christopher Knittel.

The HOPE-AI module is developed in collaboration with Qian Zhang at Harvard University.

Looking for the legacy Maryland-focused version? The pre-v2 codebase is archived at HOPE-MD.

Preparation Phase

1. Install Julia

Install Julia language (Julia 1.9 or later is required for the current HOPE package setup). A short video tutorial on how to download and install Julia is provided here.

2. Download HOPE repository

Clone OR download the HOPE repository to your local directory - click the green "Code" button on the HOPE main page and choose "Clone" (recommended) or "Download ZIP". image Then save the HOPE project in your working folder/home directory (e.g., the path to the HOPE project could be: /yourpath/home/HOPE).

Note

If you downloaded the ZIP, rename the extracted folder to HOPE (the zip extracts to a folder named after the branch, e.g., HOPE-main).

In your HOPE project, the files should be something like below: image

3. Get model cases

Model cases are maintained in a separate repository: HOPEModelCases. Clone it into the ModelCases/ folder inside your HOPE directory:

git clone https://github.com/HOPE-Model-Project/HOPEModelCases HOPE/ModelCases

This is the recommended setup — HOPE will find the cases automatically with no extra configuration. To update your model cases later, run git pull inside HOPE/ModelCases/.

Note

If you prefer to store model cases elsewhere, clone HOPEModelCases to any path and set the HOPE_MODELCASES_PATH environment variable to that path before running HOPE. See the HOPEModelCases README for details.

4. Install the HOPE Julia environment

From the HOPE repository root, activate the project and install the default dependencies:

import Pkg
Pkg.activate(".")
Pkg.instantiate()

This installs HOPE together with the default open-source solver stack used by the project, including HiGHS, GLPK, Clp, and Cbc.

Commercial solvers such as Gurobi, SCIP, and CPLEX are not installed by Pkg.instantiate() by default. They are only added if you explicitly run Pkg.add("Gurobi"), Pkg.add("SCIP"), or Pkg.add("CPLEX") while the HOPE project environment is active.

Run a Case in HOPE

Using VScode to Run a Case (Recommend)

Install Visual Studio Code: Download VScode and install it. A short video tutorial on how to install VScode and add Julia to it can be found here.

(1) Open the VScode, click the 'File' tab, select 'Open Folder...', and navigate to your home working directory:/yourpath/home

Note

The home directory could be any folder where you save your HOPE project. The home directory in the example below is named Maryland-Electric-Sector-Transition.

image

(2) In the VScode TERMINAL, type Julia and press the "Enter" button. Julia will be opened as below:

image

In Julia, you can use pwd() to check if your current working directory is your home directory, if it is not, you can use cd("/yourpath/home") to change your working directory, as the picture is shown below.

image

(3) Make sure you are in the right working directory. Then, type ] into the Julia package mode, and type activate HOPE (if you are in your home directory) or activate yourpath/home/HOPE (if you are not in your home directory), you will see prompt (HOPE) pkg>, which means the HOPE project is activated successfully.

image

(4) Type instantiate in the (HOPE) pkg prompt (make sure you are in your home directory, not the home/HOPE directory!).

This installs the default HOPE environment and the bundled open-source solvers. It does not install commercial solver packages automatically.

(5) Type st to check that the dependencies (packages that HOPE needs) have been installed. Type up to update the version of dependencies (packages). (This step may take some time when you install HOPE for the first time. After the HOPE is successfully installed, you can skip this step)

image

(6) If there is no error in the above processes, the HOPE model has been successfully installed! Then, press Backspace button to return to the Juila prompt. To run an example case (e.g., default Maryland 2035 100% clean case in GTEP mode), type using HOPE, and type HOPE.run_hope("HOPE/ModelCases/MD_GTEP_clean_case/"), you will see the HOPE is running: image The results will be saved in yourpath/home/HOPE/ModelCases/MD_GTEP_clean_case/output. An example of a successful run in Julia prompt can be seen below. image

(7) For your future new runs, you can skip steps 4 and 5, and just follow steps 1,2,3,6.

Using System Terminal to Run a Case

You can use a system terminal () either with a "Windows system" or a "Mac system" to run a test case. See details below.

Windows users

(1) Open Command Prompt from Windows Start and navigate to your home path:/yourpath/home.

(2) Type julia. Julia will be opened as below:

image

(3) Type ] into the Julia package mode, and type activate HOPE (if you are in your home directory), you will see prompt (HOPE) pkg>, which means the HOPE project is activated successfully.

(4) Type instantiate in the (HOPE) pkg prompt. ( After the HOPE is successfully installed, you can skip this step)

This installs the default HOPE environment and the bundled open-source solvers. It does not install commercial solver packages automatically.

(5) Type st to check that the dependencies (packages that HOPE needs) have been installed. Type up to update the version of dependencies (packages). (This step may take some time when you install HOPE for the first time. After the HOPE is successfully installed, you can skip this step) ccf1c53042925fcfb13ee232c13210e

(6) If there is no error in the above processes, the HOPE model has been successfully installed. Then, click Backspace to return to the Juila prompt. To run an example case (e.g., default Maryland 2035 100% clean case in GTEP mode), type using HOPE, and type HOPE.run_hope("HOPE/ModelCases/MD_GTEP_clean_case/"), you will see the HOPE is running:

image

The results will be saved in yourpath/home/HOPE/ModelCases/MD_GTEP_clean_case/output.

image

(7) For your future new runs, you can skip steps 4 and 5, and just follow steps 1,2,3,6.

Mac users

Run your case

Follow these steps: image

Solvers

Free Solvers

HOPE bundles the following open-source solvers and no extra installation is needed: HiGHS (default), GLPK, Clp, Cbc.

Set solver: highs (or any of the above) in ModelCases/<case>/Settings/HOPE_model_settings.yml.

Commercial Solvers

Gurobi, SCIP, and CPLEX are supported but are not installed by default. Because they require a separate license, they are optional dependencies that you add to your own Julia environment — HOPE does not pull them in automatically. HOPE uses Julia package extensions for these integrations, so commercial solver support requires Julia 1.9 or later.

Steps to enable a commercial solver

Step 1 — Obtain a license.

Step 2 — Install the Julia package in the HOPE project environment.

# start Julia in the HOPE repo root, then:
import Pkg
Pkg.activate(".")          # activate the HOPE environment
Pkg.add("Gurobi")          # or "SCIP" / "CPLEX"

If you activate HOPE first with Pkg.activate("."), then Pkg.add("Gurobi") installs Gurobi.jl into the HOPE project environment, not just the global default Julia environment.

Note

Gurobi.jl requires the Gurobi solver itself to be installed on your machine and a valid GRB_LICENSE_FILE environment variable. See the Gurobi.jl README for details.

Step 3 — Set the solver in the case settings file.

# ModelCases/<case>/Settings/HOPE_model_settings.yml
solver: gurobi    # or: scip / cplex

HOPE will load the commercial solver package automatically the first time it is requested. If the package is not installed, a clear error message is shown.

Documentation

Check online Documentation for HOPE.

For MCP / agent setup guidance, see:

Research & Publication

Energy Resilience and Efficiency in Maryland

Acknowledgement

This project is funded by Maryland Energy Administration

Program Sponsors



MIT CEEPR logo


PowerAgent logo

About

Holistic Optimization Program for Electricity

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages