/HOPE

Holistic Optimization Program for Electricity

Primary LanguageJuliaMIT LicenseMIT

HOPE - Holistic Optimization Program for Electricity

Stable Dev Build Status

image

Acknowledgement

This project is funded by Maryland Energy Administration

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. OPF mode: (under development): an optimal power flow model
  4. DART 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.

Preparation Phase

1. Install Julia

Install Julia language. 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 "Download ZIP". image 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: image

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 (@v1.8) pkg> changing to (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!).

(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 (@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) 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

Cbc

Commercial Solvers

If you want to use commercial solvers, e.g., Gurobi and CPLEX

  1. You need to get the licenses from these solvers. Gurobi or CPLEX
  2. 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
  3. Uncomment the using Gurobi or using CPLEX in the file HOPE/src/HOPE.jl
  4. 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.

Documentation

Check online Documentation for HOPE.

Program Sponsors