This project is funded by Maryland Energy Administration
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
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:
GTEP
mode: a generation & transmission expansion planning modelPCM
mode: a production cost modelOPF
mode: (under development): an optimal power flow modelDART
mode: (under development): a bilevel market model for simulating day-ahead and real-time markets
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 include Dr. Shen Wang, Dr. Mahdi Mehrtash and Zoe Song.
Install Julia language. A short video tutorial on how to download and install Julia is provided here.
Clone OR download the HOPE repository to your local directory - click the green "Code" button on the HOPE main page and choose "Download ZIP".
Then save the HOPE-master
project in your working folder/home directory (e.g., the path to the HOPE
project could be: /yourpath/home/HOPE
).
Note
Remember to change the folder name HOPE-master
to HOPE
after you decompress the zip file.
In your HOPE
project, the files should be something like below:
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
.
(2) In the VScode TERMINAL, type Julia
and press the "Enter" button. Julia will be opened as below:
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.
(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 (@v1.8) pkg>
changing to (HOPE) pkg>
, which means the HOPE project is activated successfully.
(4) Type instantiate
in the (HOPE) pkg prompt (make sure you are in your home
directory, not the home/HOPE
directory!).
(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)
(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:
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.
(7) For your future new runs, you can skip steps 4 and 5, and just follow steps 1,2,3,6.
You can use a system terminal () either with a "Windows system" or a "Mac system" to run a test case. See details below.
(1) Open Command Prompt from Windows Start and navigate to your home path:/yourpath/home
.
(2) Type julia
. Julia will be opened as below:
(3) Type ]
into the Julia package mode, and type activate HOPE
(if you are in your home
directory), you will see prompt (@v1.8) pkg>
changing to (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)
(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)
(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:
The results will be saved in yourpath/home/HOPE/ModelCases/MD_GTEP_clean_case/output
.
(7) For your future new runs, you can skip steps 4 and 5, and just follow steps 1,2,3,6.
Cbc
If you want to use commercial solvers, e.g., Gurobi and CPLEX
- You need to get the licenses from these solvers. Gurobi or CPLEX
- In the
(HOPE) pkg>
project package mode (type]
in the Julia package mode), install the Gurobi or CPLEX dependencies(HOPE) pkg> add Gurobi
or(HOPE) pkg> add CPLEX
- Uncomment the
using Gurobi
orusing CPLEX
in the fileHOPE/src/HOPE.jl
- Set the solver you want to use in the file
ModelCases/<the case folder you want to run>/Settings/HOPE_model_settings.yml
Note
You may need to re-activate HOPE if you have made modifications as above.
Check online Documentation for HOPE.