• Stars
    star
    115
  • Rank 300,214 (Top 7 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created about 5 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ReEDS 2.0

Image of NREL Logo

Welcome to the Regional Energy Deployment System (ReEDS) Model!

This GitHub repository contains the source code for NREL's ReEDS model. The ReEDS model source code is available at no cost from the National Renewable Energy Laboratory. The ReEDS model can be downloaded or cloned from https://github.com/NREL/ReEDS-2.0.

A ReEDS training video (based on the 2020 version of ReEDS) is available on the NREL YouTube channel at https://youtu.be/aGj3Jnspk9M?si=iqCRNn5MbGZc8ZIO.

Contents

Introduction (https://www.nrel.gov/analysis/reeds/)

The Regional Energy Deployment System (ReEDS) is a capacity planning and dispatch model for the North American electricity system.

As NREL's flagship long-term power sector model, ReEDS has served as the primary analytic tool for many studies (https://www.nrel.gov/analysis/reeds/publications.html) of important energy sector research questions, including clean energy policy, renewable grid integration, technology innovation, and forward-looking issues of the generation and transmission infrastructure. Data from the most recent base case and a suite of Standard Scenarios are provided.

ReEDS uses high spatial resolution and high-fidelity modeling. Though it covers a broad geographic and technological scope, ReEDS is designed to reflect the regional attributes of energy production and consumption. Unique among long-term capacity expansion models, ReEDS possesses advanced algorithms and data to represent the cost and value of variable renewable energy; the full suite of other major generation technologies, including fossil and nuclear; and transmission and storage expansion options. Used in combination with other NREL tools, data, and expertise, ReEDS can provide objective and comprehensive electricity system futures.

Required Software

The ReEDS model is written primarily in GAMS with auxiliary modules written in Python. R is used for the demand module, which is not active by default, and therefore need not be installed unless you plan on working with that module. At present, NREL uses the following software versions: GAMS 30.3; Python 3.6.5; R 3.4.4. Other versions of these software may be compatible with ReEDS, but NREL has not tested other versions at this time.

GAMS is a mathematical programming software from the GAMS Development Corporation. "The use of GAMS beyond the limits of the free demo system requires the presence of a valid GAMS license file." [1] The ReEDS model requires the GAMS Base Module and a linear programming (LP) solver (e.g., CPLEX). The LP solver should be connected to GAMS with either a GAMS/Solver license or a GAMS/Solver-Link license. "A GAMS/Solver connects the GAMS Base module to a particular solver and includes a license for this solver to be used through GAMS. It is not necessary to install additional software. A GAMS/Solver-Link connects the GAMS Base Module to a particular solver, but does not include a license for the solver. It may be necessary to install additional software before the solver can be used." [2]

NREL subscribes to the GAMS/CPLEX license for the LP solver, but open-source solvers and free, internet-based services are also available.

  • The COIN-OR Optimization Suite includes open-source solvers that can be linked with GAMS through the GAMS Base Module. NREL has tested the use of the COIN-OR Linear Programming (CLP) solver for ReEDS. More information about using CLP for ReEDS can be found here.
  • The NEOS Server is a free, internet-based service for solving numerical optimization problems. Links with NEOS can be made through KESTREL which is included in GAMS Base Module. In its current form, ReEDS cannot be solved using NEOS due to the 16 MB limit on submissions to the server. However, modifications could be made to ReEDS to potentially reduce the data below to the required submission size. Note that some solvers available on the NEOS server are limited to non-commercial use.

Python is "an object-oriented programming language, comparable to Perl, Ruby, Scheme, or Java." [3] " Python is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use. Python's license is administered by the Python Software Foundation." [4]. NREL uses Conda to build the python environment necessary for ReEDS. Conda is a "package, dependency and environment management for any language." [5]

Git is a version-control tool used to manage code repositories. Included in Git is a unix style command line emulator called Git Bash, which is used by ReEDS to perform some initial setup tasks.

Computer Setup for Microsoft Windows 10

The setup and execution of the ReEDS model can be accomplished using a command-line interpreter application and launching a command line interface (referred to as a "terminal window" in this document). For example, initiating the Windows Command Prompt application, i.e., cmd.exe, will launch a terminal window (Figure 1). (Note: If you have issues using command prompt, try using anaconda prompt or a git bash window)

Image of Command Prompt

Figure 1. Screenshot of a Windows Command Prompt terminal window.

SUGGESTON: use a command line emulator such as ConEmu (https://conemu.github.io/) for a more user-friendly terminal. The screenshots of terminal windows shown in this document are taken using ConEmu.

IMPORTANT: Users should exercise Administrative Privileges when installing software. For example, right click on the installer executable for one of the required software (e.g., Anaconda3-2019.07-Windows-x86_64.exe) and click on "Run as administrator" (Figure 2). Alternatively, right click on the executable for the command line interface (e.g., Command Prompt) and click on "Run as administrator" (Figure 3). Then run the required software installer executables from the command line.

Image of Run as Admin

Figure 2. Screenshot of running an installer executable using "Run as administrator".

Image of Run as Admin 2

Figure 3. Screenshot of running "Command Prompt" with "Run as administrator".

ReEDS Repository Setup

The ReEDS source code is hosted on GitHub: https://github.com/NREL/ReEDS-2.0

  1. From the Git command line run the following command to enable large file storage.
git lfs install
  1. Clone the ReEDS-2.0 repository on your desktop. Alternatively, download a ZIP from GitHub (Figure 4).

Image of GitHub Download

Figure 4. Screenshot of GitHub links to clone the ReEDS repository or download ZIP of the ReEDS files.

Python Configuration

Install Anaconda: https://www.anaconda.com/download.

IMPORTANT : Be sure to download the Windows version of the installer.

Add Python to the "path" environment variable

  1. In the Windows start menu, search for "environment variables" and click "Edit the system environment variables" (Figure 5). This will open the "System Properties" window (Figure 6).

Image of Search Environment Variable

Figure 5. Screenshot of a search for "environment variables" in the Windows start menu.

Image of System Properties Window

Figure 6. Screenshot of the "System Properties" window.

  1. Click the "Environment Variables" button on the bottom right of the window (Figure 6). This will open the "Environment Variables" window (Figure 7).

Image of Environment Variables Window

Figure 7. Edit the Path environment variable.

  1. Highlight the Path variable and click "Edit" (Figure 7). This will open the "Edit environment variable" window (Figure 8).

Image of Edit Environment Variables Window

Figure 8. Append the Path environment.

  1. Click "New" (Figure 8) and add the directory locations for \Anaconda\ and \Anaconda\Scripts to the environment path.

IMPORTANT : Test the Python installation from the command line by typing "python" (no quotes) in the terminal window. The Python program should initiate (Figure 9).

Image of Test Python

Figure 9. Screenshot of a test of Python in the terminal window.

It is highly recommended to run ReEDS using the conda environment provided in the repository. This environment (named reeds2) is specified by the environment.yml and can be built with the following command:

conda env create -f environment.yml

You can verify that the environment was successfully created using the following (you should see reeds2 in the list):

conda env list

IMPORTANT: Prior to creating the conda environment on Windows, you'll need to comment out the line to install julia in environment.yml. If you're looking to run ReEDS with PRAS and stress periods, you'll need to install julia manually from https://julialang.org/downloads/.

GAMS Configuration

Install GAMS: https://www.gams.com/download/. NREL uses GAMS versions 45.2.0 and 34.3. Older versions might also work. A valid GAMS license must be installed. Please refer to the Required Software section above for more information.

Add GAMS to the "path" environment variable. Follow the same instructions as for adding Python to the path in the Python Configuration section above. Append the environment path with the directory location for the gams.exe application (e.g., C:\GAMS\win64\34).

IMPORTANT : Test the GAMS installation from the command line by typing "gams" (no quotes) in the terminal window. The GAMS program should initiate (Figure 10).

Image of Test GAMS

Figure 10. Screenshot of a test of GAMS from the terminal window.

Computer Setup for MacOS

Download GAMS

Install GAMS: https://www.gams.com/download/. A valid GAMS license must be installed. Please refer to the Required Software section above for more information.

IMPORTANT When installing on Mac, on the 'Installlation Type' page, click 'customize' and ensure the box to 'Add GAMS to PATH' is checked. Image of GAMS Install Mac

To validate GAMS was installed properly execute the following command from a new terminal (without quotes): "gams"

GAMS should initiate, you should see something similar to Figure 10.

Download Anaconda

Download the latest version of Anaconda: https://www.anaconda.com/download

During Installation, select to install Anaconda for your machine only.

Image of Anaconda Install Mac

To have the installer automatically add anaconda to PATH, ensure that you've selected the box to "Add conda initialization to the shell"

Image of Anaconda Install Mac - Customize Installation Type

To validate Python was installed properly execute the following command from a new terminal (without quotes): "python"

Python should initiate, looking similar to Figure 9.

Clone the ReEDS Code Repository

The ReEDS source code is hosted on GitHub: https://github.com/NREL/ReEDS-2.0

  1. From the Git command line run the following command to enable large file storage.
git lfs install
  1. Clone the ReEDS-2.0 repository on your desktop and use the repository with GitHub Desktop. Alternatively, download a ZIP from GitHub (Figure 4).

Set up the ReEDS conda environment

It is highly recommended to run ReEDS using the conda environment provided in the repository. This environment (named reeds2) is specified by the environment.yml and can be built with the following command - make sure you navigate to the ReEDS repository from terminal first:

conda env create -f environment.yml

You can verify that the environment was successfully created using the following (you should see reeds2 in the list):

conda env list

Executing the Model

A ReEDS case (also referred to as a "run", "scenario" or "instance") is executed through a python-based case batching program called runbatch.py after the repository was setup. The user can execute a single case or a batch of cases using this program.

Step 1 : Specify the ReEDS case name(s) and configuration(s) in the case configuration file. (Figure 11). The default case configuration file name is called "cases.csv", but the user may create custom case configuration files by using a suffix in the file name (e.g., "cases_test.csv"). The file "cases_test.csv" can be used to execute a "test" version of the model for the ERCOT system.

Within "cases.csv", The data in Column A are the model "switches" (also referred to as "options"). The data in Column B are brief descriptions of the switches. The data in Column C are the default values of the switches. The case configuration (or set of switches that define a case) begin with Column D. Each case configuration is represented by a single column. The case name is specified in Row 1. The value for each switch is specified beginning in Row 2. If a switch value is left blank, default value from Column C is used. A complete list of switches is provided in the Appendix of this document.

Image of Cases.csv

Figure 11. Screenshot of cases.csv.

Step 2 : Initiate the case batching program

  1. Navigate to the ReEDS model directory in the file explorer or command prompt/window.
  2. Activate the reeds2 conda environment: conda activate reeds2. For details on creating this environment, see the #ConfigPy section above.
  3. Enter python runbatch.py in a command prompt (be sure to be in the ReEDS directory) to run the ReEDS case batching program (Figure 12).
  4. Provide responses to the suite of prompts in the command line (Figure 13). Please refer to the Prompts for user input during runbatch.py section below for more information about the prompts.
  5. Once all responses have been received, the batching program will execute the case(s) specified in the case configuration file (e.g., "cases.csv"). A separate terminal window will be launched for each case (Figure 14).

Step 3 : Wait for each case to finish, check for successful completion, and view outputs. Once a case has finished (either from successful completion or from an error), the case-specific terminal window will close and a message in the main terminal window (i.e., where "runbatch.py" was initiated) will appear stating that the case has completed (Figure 15).

Image of Execute RunBatch.py

Figure 12. Screenshot of initiating "runbatch.py" from the command line.

Image of RunBatch.py Prompts

Figure 13. Screenshot of prompts for user input during "runbatch.py".

Image of Case Window

Figure 14. Screenshot of a separate terminal window being launched for a case.

Image of Case Finish Message

Figure 15. Screenshot of a message in the main terminal window stating when a case has finished.

Prompts for user input during "runbatch.py"

When a user initiates a batch of ReEDS cases through "runbatch.py", a suite of prompts will appear in the terminal window. Additional details about these prompts are provided below.

Batch Prefix [string] โ€“ Defines the prefix for files and directories that will be created for the batch of cases to be executed (as listed in a case configuration file, e.g., "cases.csv").

  • All files and directories related to a case will be named "{batch prefix}_{case}". For example, if batch prefix="test" and case="ref_seq", then all files and directories related to this case will be named test_ref_seq. All files and directories for ReEDS cases are stored in a directory called "\runs"
  • WARNING! A batch prefix cannot start with a number given incompatibility with GAMS. The GAMS model declaration statement is as follows:
model {batch prefix}_{case} /all/ ;

Therefore, "batch prefix" CANNOT begin with a numeric and SHOULD begin with an alpha character (e.g., a, A, b, B, โ€ฆ).

  • Entering a value of "0" (zero, no quotes) will assign the current date and time for the batch prefix in the form of v{YYYYMMDD}_{HHMM}. Note the preceding letter vee 'v' is necessary to ensure the batch prefix begins with an alpha character. For example, if batch prefix="0" and case="ref_seq" on September 30, 2019 at 3:00 PM (1500 hours military time), then all files and directories related to this case will be named v20190930_1500_ref_seq
  • WARNING! Avoid re-using a (batch prefix, case) pair. If a directory "\runs{batch prefix}_{case}" already exists, a warning will be issued in the case-specific terminal window, but "runbatch.py" will overwrite data in the existing case directory (Figure 16). In some instances, the case execution will pause, and a message will appear in the case-specific terminal window "mv: replace [โ€ฆ] overriding mode 0666?" (Figure 17). Pressing "Enter/Return" will continue the execution. NREL plans to address this overwriting issue in the future by requiring user approval to overwrite an existing case directory.

Image of Duplicate Case Warning

Figure 16. Screenshot of warning message that appears in the main terminal window when reusing a (batch prefix, case) pair.

Image of Duplicate Case Warning 2

Figure 17. Screenshot of warning message that occurs in the case-specific terminal window when reusing a (batch prefix, case) pair.

Case Suffix [string]โ€“ Indicates which case configuration fileโ€”in the form "cases_{case suffix}.csv"โ€”is ingested into "runbatch.py" for processing.

  • Entering an empty value (i.e., pressing "Enter/Return") will cause the default case configuration file "cases.csv" to be used.
  • SUGGESTION : Users may want to create a custom case configuration file ("cases_{โ€ฆ}.csv") when executing scenarios that vary from the default case configuration file ("case.csv").

Number of Simultaneous Runs [integer] โ€“ Indicates how many cases should be run simultaneously in parallel.

  • "runbatch.py" uses a queue to execute multiple cases.
  • If there are four (4) cases and the Number of Simultaneous Runs=1, then "runbatch.py" will execute the cases one at a time.
  • If there are four (4) cases and the Number of Simultaneous Runs=2, then "runbatch.py" will start two (2) cases simultaneously. Then as each case finishes a new one will start until all cases have been run.
  • WARNING! Be mindful about the amount of CPU and RAM usage needed for each case.
    • Table 4 in the What computer hardware is necessary to run ReEDS? section below provides some initial data points for CPU and RAM usage.
    • An Intertemporal solve will take significant resources unless simplified (through the case configuration).
    • A Sequential solve has default value of four (4) threads in "cplex.opt". The number of threads can be reduced, requiring less CPU resource usage.

Number of simultaneous CC/Curt runs [integer] โ€“ Indicates how many threads are to be used for the capacity credit (CC) and curtailment (curt) batching program ("reflowbatch.py").

  • This question is only asked when running intertemporal cases (i.e., timetype="int" in the case configuration file).
  • With the intertemporal case, the linear program is formulated and solved for all years at once. Then the capacity credit and curtailment calculations are executed in parallel based on the Number of simultaneous CC/Curt runs specified by the user.

How many iterations between the model and CC/Curt scripts [integer]โ€“ For an intertemporal case, the "runbatch.py" will execute an LP solve and then call the cc/curt scripts. The value assigned here determines how many of these iterations between the LP and the cc/curt scripts occur.

  • This question is only asked when running intertemporal cases (i.e., timetype="int" in the case configuration file).
  • SUGGESTION : When executing an intertemporal case, it is good practice to set "cc_curt_load = 1" in "cases.csv" to enable pre-computed starting values for capacity credit and curtailment.
  • Currently, there is no convergence criterion enforced. Typically, 5-6 iterations are enough for convergence, i.e., the capacity credit and curtailment values have "small" deviations since the prior iteration.

Runbatch.py Execution Protocol

Below are the key steps that occur when a user initiates "runbatch.py". Knowing these steps may help the user understand the source code of "runbatch.py" if modifications need to be made to the batching program.

  1. Request input from user though the command prompt.
  2. Ingest case names and case switches from the user-specified case configuration file (e.g., "cases.csv")
  3. Create a new directory for each case (\runs{batch_prefix}_{case}).
  4. Create a batch file of execution statements for each case: (\runs{batch_prefix}_{case}\call_{batch_prefix}_{case}.bat)
  5. All files from "runfiles.csv" are copied to "\runs{batch_prefix}_{case}\ "
    • Any files from the root of the repository will be copied to "\runs{batch_prefix}_{case}\ "
    • Any files from "\inputs\ " will be copied to "\runs{batch_prefix}_{case}\inputs_case\ "
  6. Execute the batch file for each case in a new, case-specific window. This window will close when the case is finished. GAMS will produced files unique to each case that can help the user with error debugging:
    • GAMS Log File
      • Path: "\runs{batch_prefix}_{case}\gamslog.txt "
      • Purpose: contains the log outputs for all execution statements from the case batch file
      • SUGGESTION : This is a good place to check in which execution step errors may have occurred.
    • GAMS listing files (*.lst)
      • Path: "\runs{batch_prefix}_{case}\lstfiles\ "
      • Purpose: contains the listing files for GAMS executions
      • SUGGESTION : This is a good place to check in which line of the source code errors may have occurred
    • GAMS workfile (*.g00)
      • Path: "\runs{batch_prefix}_{case}\g00files\ "
      • Purpose: stores a snapshot of all the model information available to GAMS at that point in the case execution.
      • For more information about GAMS work files: https://www.gams.com/latest/docs/UG_SaveRestart.html
      • SUGGESTION : A failed case can be restarted from this snapshot point. The user can rerun the batch file for the case (\runs{batch_prefix}_{case}\call_{batch_prefix}_{case}.bat) after commenting out execution statements that completed successfully.
  7. Build outputs and standard visualization reports for each case that completes successfully.
  • Following a successful run, a suite of .csv output files are created in: "\runs{batch_prefix}_{case}\outputs\ "
  • A standard .html visualization report is stored in: "\runs{batch prefix}_{case}\outputs\reeds-report\ "

Case-specific Batch File Execution Protocol

Execute CreateModel.gms:

  1. Execute B_Inputs.gms โ€“ ingest data from the files created by the input_processing scripts and format the data to be useful for the GAMS execution
  2. Execute C_SupplyModel.gms โ€“ declare the variables and constraints for the linear program
  3. Execute C_SupplyObjective.gms โ€“ declare the objective function for the linear program, broken into two parts (investment and operations)
  4. Execute D_SolvePrep.gms โ€“ initiate the LP solve and compute parameters based on switch values in the case configuration file (e.g., "cases.csv")
  5. Create a GAMS work file at the completion of CreateModel.gms
  6. Path: "\runs{batch_prefix}_{case}\g00files{batch_prefix}_{case}.g00"
  7. For more information about GAMS work files: https://www.gams.com/latest/docs/UG_SaveRestart.html

Execute the sequential solve structure (Figure 18)

For every year in the model horizon, execute d_solveoneyear.gms:

  1. Execute solve
  2. Execute d_callreflow.gms โ€“ Compute capacity credit and curtailment:
  3. Execute ReEDS_capacity_credit.gms - compute the parameters necessary for ReEDS_capacity_credit.py (which computes the capacity credit)
  4. Execute REflow_RTO_2_params.gms โ€“ translate the parameters from ReEDS 2.0 into their equivalents from ReEDS Heritage
  5. Execute REflow_RTO_3.gms โ€“ compute curtailment using the syntax and structure from ReEDS Heritage
  6. Execute d4_Translate_Variability.R โ€“ Translate the values from REflow_RTO_3.gms (ReEDS Heritage) back to the syntax and structure used in ReEDS 2.0

Image of Sequential Flow

Figure 18. Depiction of execution sequence for the "sequential" solve.

Execute the intertemporal solve structure (Figure 19)

For each iteration (specified via the runbatch.py prompt),

  1. Execute d_solveallyears.gms
  2. Execute reflowbatch.py
  3. Execute d_callreflow.gms โ€“ Compute capacity credit and curtailment; same process as for sequential, but for all years
  4. Once all cc/curt calculations are done, files are merged via the GAMS gdxmerge utility
  5. Execute d5_mergevariability.R โ€“ The resulting file from the gdxmerge execution is restructured for use in GAMS during the next iteration of the intertemporal solve.

Image of Intertemporal Flow

Figure 19. Depiction of execution sequence for the "intertemporal" solve.

Documentation

The ReEDS Version 2020 Documentation is available at no cost from the National Renewable Energy Laboratory: https://www.nrel.gov/docs/fy21osti/78195.pdf

Detailed documentation of ReEDS 2.0 input files are available here.

The source code in this repository is the ReEDS Version 2020 model.

Table 1 summarizes difference between Versions 2019 and 2020.

Table 1. differences between ReEDS Versions 2019 and 2020.

Inputs and Treatments 2019 Version (Julyย 2019) 2020 Version (Julyย 2020)
Fuel prices AEO2019 AEO2020
Demand growth AEO2019 AEO2020
Generator technology cost, performance, and financing ATB 2019 ATB 2020
Regional Greenhouse Gas Initiative (RGGI) Virginia not included in RGGI Virginia included in RGGI
Endogenous retirements Off by default; when turned on, plants retire when they cannot recover their fixed O&M On by default; when turned on, plants retire when they cannot recover at least half of their fixed O&M
Coal fixed O&M Escalate from online year Escalates from 2019 using assumptions from AEO2019
Nuclear fixed O&M Escalate from 2010 Escalates from 2019 using assumptions from AEO2019
Wind, solar, and loadย data Includes 2012 data only Includes data for 2007โ€“2013; dispatch is done using 2012 data and capacity credit calculations are done using 2007โ€“2013 data (W. Cole, Greer, et al. 2020)
Electrification Not included Includes three levels of electrification
Demand-side flexibility Not included Includes three levels of flexibility
Renewable fuel combustion turbine Not included Includes combustion turbine that runs on aย generic renewable fuel with a minimum 6% capacity factor
Upgrades Not included Thermal technologies can be upgraded (e.g., by adding CCS).
Storage curtailment recovery Assume that every 1 MWh of storage charging reduces curtailment in that region by 0.5 MWh Uses hourly net load profiles and a dispatch algorithm to determine the amount of curtailment that can be recovered by storage
Battery storage durations 4-hour batteries only Includes 2-, 4-, 6-, 8-, and 10-hour battery storage
Storage capacity credit Calculated using one year of hourly data, applies a linear approximation in the optimization model Calculated using seven years of hourly data; capacity credit bins by duration allow for nonlinear changes in the optimization model; one-hour buffer accounts for uncertainty in forecasts and ability to dispatch
Wind and solar capacity credit Calculated using one year of hourly resource and load data Calculated using seven years of hourly resource and load data
Wind supply curve Exclusions based on land-use land-cover categories as specified in Lopez et al. (2012) Spatially-explicit modeling of multiple exclusions and setbacks from buildings, roads, transmission rights-of-way, and radar along with other exclusion layers
Wind degradation Not included Annual degradation of 0.27% per year represented based on empirical data (Hamilton et al. 2020)
PV degradation 0.5%/yr 0.7%/yr per the ATB 2020
Wind and solar curtailment Modeled using convolutions of resource and load data at a time-slice resolution Modeled using a simplified hourly dispatch model
Pumped-hydro capital cost Static over time Declines over time per Hydropower Vision (DOE 2016)
Storage energy arbitrage value Calculated at the ReEDS 17-time-slice resolution Calculated using hourly prices
Minimum capacity factor for NGCT None 1% per PLEXOS runs of the 2019 Standard Scenarios
Tax credits Use a three-year safe harbor construction period; tax credits for CCS not represented Use a four-year safe harbor construction period; December 2019 production tax credit update represented; tax credits for CCS represented (use of captured carbon is not considered)
State policies Policies as of July 2019 Policies as of June 2020
Nuclear power plantย assistance Assistance for Illinois and New York represented Assistance for Connecticut, Illinois, New Jersey, New York, and Ohio represented
Outage rates Outage rates based on 2003โ€“2007 Generating Availability Data System data Outage rates based on 2014โ€“2018 Generating Availability Data System data

References

Model Architecture

Modules

The ReEDS model is comprised of several modules with one and two-way data exchange between the modules. Figure 20 depicts these modules, including linkages between the modules and directions of data exchange. The supply module is the core module for ReEDS. Within a ReEDS execution, the key data exchanges occur between (1) the Supply Module and the Variable Resource Renewable (VRR) Modules for estimating Capacity Credit and Curtailment; and (2) the Supply Module and the Demand Module. These module interactions are dictated by the model execution approach, i.e., sequential solves, sliding window solves, or intertemporal solves. Figure 21 illustrates the sequential approach; Figure 22 the sliding window and intertemporal approaches.

Image of ReEDS Modules

Figure 20. Depiction of ReEDS modules; arrows indicate directions of data exchange.

Image of Sequential Flow

Figure 21. Schematic illustrating the model structure with a sequential solve.

Image of Intertemporal Flow

Figure 22. Schematic illustrating the model structure with sliding window or intertemporal solves.

Tracking Capital Stock

Because ReEDS is a long-term capacity planning model, electricity generation capacity (capital stock) must be tracked over time, including initial capacity, new investments, refurbishment investments, lifetime retirements, and endogenous retirements. Figure 23 depicts time resolution terminology and capital stock terminology. "Historical" years are 2010-2018, inclusive. "Future" years are 2019 and beyond. "Pre-modeled" years are years prior to 2010 and are not represented in the model decision making. "Modeled" years are years beginning in 2010, the first year of the model to the end of the model horizon. Users can specify the frequency of modeled years as depicted in Figure 24 in "\inputs\user_input\modeledyears_default.csv" and the horizon is specified in "cases.csv".

Image of Time and Stock

Figure 23. Depiction of time resolution terminology and capital stock terminology

Image of Model Years

Figure 24. Depiction of user-specified model years.

Capital stock added during the model execution is tracked by a vintage classification based on the time frame when the capacity is installed (e.g., capacity installed between 2030 and 2035 could be defined as a vintage class). The user can specify the vintage class resolution by technology type to control the model size (see "\inputs\userinput\ivt.csv"). All capacity of a technology type (e.g., nuclear) within the same vintage class has the same operating characteristics. Regardless of the vintage class, new investments incur capital cost associated with the year that the investment occurs.

Distinction is made between vintage classes for capacity built during the pre-modeled years---i.e., the initial vintage classes---and vintage classes for capacity built during the modeled years, i.e., the added vintage classes, (Figure 23). The initial vintage classes are categorized based on plant performance, specifically, heat rate (Figure 25). Whereas, added vintage classes are categorized based on when the capacity is installed.

Initial capacity is tracked based on the capacity remaining in each model year after planned retirements have been removed. Planned capacity additions made during historical modeled years, i.e., 2010-2018, are prescribed exactly, thus the model must build exactly the prescribed amount. Planned capacity built during future modeled years, i.e., 2019-2050, are prescribed as a lower bound for new investments, thus the model must build at least the prescribed amount (Figure 23).

Image of Historical Bins

Figure 25. Example of categorizing model plants for the existing fleet based on heat rate.

Frequently Asked Questions

How much are the GAMS licensing fees?

Please contact GAMS for more information.

Is there a trial version of the GAMS license so that I can test ReEDS?

We have created a reduced size version of the ReEDS model that has less than 5,000 rows and columns, and therefore should be compatible with the GAMS community license (https://www.gams.com/try_gams/ -- Please contact GAMS if you need additional information regarding the community license). You can run this reduced model version by using the cases_small.csv input file. This reduced model uses a smaller technology subset, smaller geographic extent, and simplifies several model constraints.

What computer hardware is necessary to run ReEDS?

NREL uses Windows servers to execute the ReEDS model. These servers have Intel(R) Xeon(R) CPUs at 2-2.4GHz and 10-14 cores with 160-320GB of RAM. These servers can execute multiple ReEDS cases in parallel.

Table 4 summarizes RAM usage and total clock time necessary to execute the default ReEDS configuration for the three different solve structures (sequential, window, and intertemporal) using one of these servers.

Table 4. Ballpark RAM usage and clock time for select model configurations executed on NREL servers.

Solve Structure Solve Steps Approximate LP size
per instance (after presolve)
Threads RAM(GB per instance) Total Clock Time (hours)
Sequential 2010-2030: 2 yr
2031-2050: 5 yr
Rows: 461k
Columns: 384k
Non-Zeros: 2,042k
4 4-7GB 3-5
Window 2010-2030: 2 yr
2031-2050: 5 yr
Rows: 1,143k
Columns:869k
Non-Zeros: 5,087k
8 14-18GB 18-22
Intertemporal 2010-2030: 2 yr
2031-2050: 5 yr
Rows:12,789k
Columns: 9,890k
Non-Zeros: 61,076k
12 57GB+ 48-72

Table Notes:

  • Default solve window configuration: 11 windows and 5 iterations per window (see "\inputs\userinput\windows_default.csv"). The problem size is taken from last iteration. The problem size varies by about 5% across iterations.
  • Intertemporal: 8-12 hours per iteration, 5-7 iterations total

Can I configure a ReEDS case to run as an isolated interconnect?

Yes, you can configure ReEDS as a single interconnect. Limiting the spatial extent may be beneficial for modeling more difficult instances.

WARNING!: The default case configurations were designed for modeling the lower 48 United States. Therefore, the user should be aware of possible issues with executing an interconnect in isolation, including but not limited to the following:

  • Natural gas prices are based on either national or census division supply curves. The natural gas prices are computed as a function of the quantity consumed relative to a reference quantity. Consuming less than the reference quantity drives the price downward; consuming more drives the price upward. When modeling a single interconnection, the user should either modify the reference gas quantity to account for a smaller spatial extent or use fixed gas prices in every census division (i.e., case configuration option GSw_GasCurve = 2). For example, if we execute ERCOT in isolation using census division supply curves, we may want to reduce the reference gas quantity for the West South Central (WSC) census division which includes Texas, Oklahoma, Arkansas, and Louisiana. Or we could assume the gas price in the WSC region is fixed.

  • Infeasibilities may arise in state-level constraints when only part of a state is represented in an interconnect. For example, the Western interconnection includes a small portion of Texas (El Paso). State-level constraints will be enforced for Texas, but El Paso may not be able to meet the requirement for all of Texas.

  • Certain constraints may not apply in every interconnect. Some examples include:

    • California State RPS REC trading constraints only apply to the West
    • CAIR and CSAPR only apply to certain states, so the emission limits may need to be adjusted
    • RGGI only applies to a subset of states in the northeast
    • California policies (e.g., SB32, California Storage Mandate) only apply to California

Contact Us:

If you have comments and/or questions, please contacts the ReEDS team:

[email protected]

Appendix:

ReEDS Model Switches (specified by user in "cases.csv")

ReEDS model switches are set in the cases.csv file. The "Choices" column lists allowable options for that switch, with N/A meaning that no error checking is performed for the options selected.

Tips for reducing solve time

If you'd like to reduce the model solve time, consider making some of the following changes:

  • yearset_suffix = 4yr or yearset_suffix = 5yr
    • Solve in 4- or 5-year steps
  • GSw_OpRes = 0
    • Turn off operating reserves
  • GSw_MinLoading = 0
    • Turn off the sliding-window representation of minimum-generation limits
  • GSw_HourlyNumClusters = 25 (or lower)
    • Reduce the number of representative periods
  • GSw_RegionResolution = aggreg and GSw_HierarchyFile = default, or agg2
    • Aggregate the native 134 zones into fewer, larger zones. GSw_HierarchyFile = default aggregates the 134 zones into 69 zones (obeying state, interconnect, NERC, and FERC region boundaries); GSw_HierarchyFile = agg2 aggregates the 134 zones into 54 zones (obeying state boundaries).

More Repositories

1

api-umbrella

Open source API management platform
Ruby
1,944
star
2

EnergyPlus

EnergyPlusโ„ข is a whole building energy simulation program that engineers, architects, and researchers use to model both energy consumption and water use in buildings.
C++
1,044
star
3

OpenStudio

OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
C++
484
star
4

SAM

System Advisor Model (SAM)
C++
318
star
5

floris

A controls-oriented engineering wake model.
Python
197
star
6

OpenOA

This library provides a framework for assessing wind plant performance using operational assessment (OA) methodologies that consume time series data from wind plants. The goal of the project is to provide an open source implementation of common data structures, analysis methods, and utility functions relevant to wind plant OA.
Jupyter Notebook
180
star
7

Radiance

This repo has been archived. Please refer to https://github.com/LBNL-ETA/Radiance/tree/master for the latest updates.
C
156
star
8

vagrant-boxes

Shell
146
star
9

rdtools

PV Analysis Tools in Python
Python
144
star
10

SOWFA

Roff
127
star
11

resstock

Highly granular modeling of residential building stocks at national, regional, and local scales using OpenStudio/EnergyPlus.
Ruby
103
star
12

HPC

A collection of various resources, examples, and executables for the general NREL HPC user community's benefit. Use the following website for accessing documentation.
Jupyter Notebook
103
star
13

pysam

Python Wrapper for the System Advisor Model
C
99
star
14

ROSCO

A Reference Open Source Controller for Wind Turbines
Python
96
star
15

PowerGridworld

PowerGridworld provides users with a lightweight, modular, and customizable framework for creating power-systems-focused, multi-agent Gym environments that readily integrate with existing training frameworks for reinforcement learning (RL). https://arxiv.org/abs/2111.05969
Python
95
star
16

reV

Renewable Energy Potential (reV) Model
Python
92
star
17

hsds-examples

Examples of using the HSDS Service to Access NREL WIND Toolkit data
Jupyter Notebook
85
star
18

REopt_API

The model for the REopt API, which is used as the back-end for the REopt Webtool (reopt.nrel.gov/tool), and can be accessed directly via the NREL Developer Network (https://developer.nrel.gov/docs/energy-optimization/reopt)
Python
82
star
19

bifacial_radiance

Toolkit for working with RADIANCE for the ray-trace modeling of Bifacial Photovoltaics
Python
81
star
20

openstudio-standards

Ruby
78
star
21

ssc

SAM Simulation Core (SSC) contains the underlying performance and financial models for SAM
C++
78
star
22

sup3r

The Super-Resolution for Renewable Resource Data (sup3r) software uses generative adversarial networks to create synthetic high-resolution wind and solar spatiotemporal data from coarse low-resolution inputs.
Python
68
star
23

phygnn

physics-guided neural networks (phygnn)
Python
68
star
24

floorspace.js

JavaScript
66
star
25

ditto

DiTTo is a Distribution Transformation Tool that aims at providing an open source framework to convert various distribution systems modeling formats.
Python
66
star
26

dgen

The Distributed Generation Market Demand (dGen) model simulates customer adoption of distributed energy resources (DERs) for residential, commercial, and industrial entities in the United States and other countries.
Python
57
star
27

mappymatch

Pure-python package for map matching
Python
54
star
28

PhIRE

Python
54
star
29

wex

WEX, which is short for WxWidgets Extensions, is a cross-platform library of graphical user interface tools that extends the popular open-source project WxWidgets. WEX includes many features including the powerful DView program (https://github.com/NREL/wex/wiki/DView), which provides an easy-to-use way to visualize complex time series data.
C
54
star
30

nfp

Keras layers for end-to-end learning with rdkit and pymatgen
Python
52
star
31

alfabet

Machine learning predictions of bond dissociation energy
Python
52
star
32

turbine-models

Documentation for the turbine models in this repository is available below.
Python
51
star
33

WindSE

Python
48
star
34

SolarPILOT

SolarPILOT power tower layout and optimization tool
C++
43
star
35

developer.nrel.gov

An issue tracker for NREL's APIs available at https://developer.nrel.gov
HTML
43
star
36

OpenStudio-server

The OpenStudio Server is a docker or Helm deployable instance which allows for large-scale parametric analyses of building energy models using the OpenStudio or URBANopt CLIs.
Ruby
43
star
37

gdx-pandas

Python interface to read and write GAMS GDX files using pandas.DataFrames as the intermediate data format.
Python
43
star
38

EvoProtGrad

Directed evolution of proteins in sequence space with gradients
Jupyter Notebook
43
star
39

BuildingsBench

Large-scale pretraining and benchmarking for short-term load forecasting.
Jupyter Notebook
42
star
40

BuildingMOTIF

Building Metadata OnTology Interoperability Framework (BuildingMOTIF)
Jupyter Notebook
42
star
41

dynamo

A modular MATLAB toolkit for Dynamic programming (DP) and Approximate Dynamic Programming (ADP) for Adaptive Modeling and Optimization
MATLAB
41
star
42

PRAS

NREL's Probabilistic Resource Adequacy Suite (PRAS)
Julia
40
star
43

OpenStudio-HPXML

Modeling of residential buildings in EnergyPlus using OpenStudio/HPXML.
Ruby
38
star
44

alfalfa

Alfalfa is a web service that enables runtime interaction with building energy models (OpenStudio/EnergyPlus and FMUs compiled from Modelica or Spawn) over REST APIs.
Python
38
star
45

PyPSCAD

36
star
46

OPFLearn.jl

A Julia package that efficiently creates representative datasets for machine learning approaches to AC optimal power flow
Julia
36
star
47

ParaEMT_public

Python
35
star
48

graph-env

Reinforcement learning for combinatorial optimization over directed graphs
Python
34
star
49

SolTrace

SolTrace
C++
33
star
50

elm

ELM is a collection of utilities to apply Large Language Models (LLMs) to energy research.
Python
33
star
51

windtools

Python tools for wind simulation setup, data processing, and analysis
Python
33
star
52

MATBOX_Microstructure_analysis_toolbox

MATBOX is an open-source MATLAB toolbox dedicated to microstructure analsyis of porous/heterogeneous materials
MATLAB
32
star
53

PyDSS

Python
32
star
54

PV_ICE

An open-source tool to quantify Solar Photovoltaics (PV) Energy and Mass Flows in the Circular Economy, from a Reliability and Lifetime approach
HTML
32
star
55

REopt-Analysis-Scripts

Jupyter Notebook
31
star
56

OpenStudio-analysis-spreadsheet

The OpenStudio Analysis Spreadsheet is a front-end for the OpenStudio Server, allowing for users to create large-scale cloud analyses using OpenStudio measures.
Ruby
31
star
57

SOWFA-6

30
star
58

lk

LK (Language Kit) is a simple but powerful scripting language that is designed to be small, fast, and easily embedded in other applications. The core LK engine, including lexical analyzer, parser, compiler, and virtual machine is only dependent on the Standard C++ Library (STL), making it extremely lightweight and portable.
C
30
star
59

GEOPHIRES-v2

GEOPHIRES v2.0: a free and open-source geothermal techno-economic simulator
Python
30
star
60

flasc

A rich floris-driven suite for SCADA analysis
Jupyter Notebook
28
star
61

bifacialvf

Bifacial PV View Factor model for system performance calculation
Python
28
star
62

OCHRE

A Python-based building energy modeling (BEM) tool designed to model flexible loads in residential buildings
Python
28
star
63

rlmolecule

A reinforcement learning library for material and molecule optimization
Python
27
star
64

MoorPy

Python
27
star
65

EnergyPlusRelease

Fortran
27
star
66

ComStock

National scale modeling of the U.S. commercial building stock supported by U.S. DOE, LADWP, and others and maintained by NREL
Ruby
25
star
67

openfast-turbine-models

A repository of OpenFAST turbine models developed by NREL researchers.
Jupyter Notebook
25
star
68

BACnet

Java
24
star
69

api-umbrella-gatekeeper

See the https://github.com/NREL/api-umbrella repository instead.
JavaScript
23
star
70

m2p

Python
23
star
71

ROSCO_toolbox

A repository for generating ROSCO controller input files and more.
Python
23
star
72

OpenStudio-PAT

The Parametric Analysis Tool (PAT) is part of the OpenStudio collection of software tools.
Ruby
23
star
73

api-umbrella-web

See the https://github.com/NREL/api-umbrella repository instead.
Ruby
22
star
74

OpenWARP

Please visit http://nrel.github.io/OpenWARP/ for more information.
Python
22
star
75

REopt.jl

Julia
22
star
76

ATB-calc

Python files and Jupyter notebooks for processing the Annual Technology Baseline (ATB) electricity data and determining LCOE and other metrics.
Python
22
star
77

HOPP

Jupyter Notebook
21
star
78

PyPSSE

Python
21
star
79

reVX

The Renewable Energy Potential(V) eXchange Tool: reVX
Python
21
star
80

OpenStudio-Prototype-Buildings

Ruby
20
star
81

buildstockbatch

Python
20
star
82

docker-openstudio

Repository for managing the builds of OpenStudio Docker images.
Dockerfile
20
star
83

Panel-Segmentation

This open-source package provides a framework for automatically detecting and extracting metadata from solar array installations in satellite images.
Jupyter Notebook
20
star
84

ProgressiveHedging.jl

Basic progressive hedging implementation in Julia
Julia
20
star
85

powerscenarios

Realistic renewable energy scenarios for stochastic grid optimization problems
MATLAB
20
star
86

electrolyzer

Python
19
star
87

hive

HIVEโ„ข is a mobility services research platform
Python
19
star
88

hescore-hpxml

HPXML to Home Energy Score Translator
Python
18
star
89

OpenStudio-fault-measure-gem

OpenStudio measures for modeling building faults
Ruby
18
star
90

CampusEnergyModeling

MATLAB
18
star
91

latex_editing

TeX
18
star
92

OpenStudio-resources

HTML
18
star
93

rex

REsource eXtraction Tool (rex)
Python
18
star
94

OpenStudio-ERI

Energy Rating Index (ERI) calculation via OpenStudio/EnergyPlus.
Ruby
17
star
95

NRWAL

The National Renewable Energy Laboratory Wind Analysis Libray (NRWAL)
Python
17
star
96

fastsim

Python
17
star
97

DSS-SimPy-RL

This repository is an Reinforcement Learning Platform for learning agents to control cyber-physical Power Distribution Systems resiliently. The cyber environment in based on SimPy Discrete Event Simulator, while the distribution system is backened by Open-DSS.
Python
17
star
98

rplexos

C++
16
star
99

hsds-viz

Interactive Visualization of WIND Toolkit Data using HSDS Data Service
JavaScript
16
star
100

PIDG

R
15
star