Project BlueSky is an EIA initiative to develop an open source, next generation energy systems model, which will eventually be used to produce the Annual Energy Outlook (AEO) and International Energy Outlook (IEO). Our outlooks are focused on projecting realistic outcomes under a given set of assumptions, accounting for rapid technological innovation, new policy, changing consumer preferences, shifting trade patterns, and the real-world friction associated with the adoption of novel or risky technology. To address these challenges, the next generation model is designed to be modular, flexible, transparent, and robust.
The BlueSky Prototype is the first step towards creating this next generation model. Our objective in releasing the prototype is to give the modeling community an early opportunity to experiment with the new framework and provide feedback. Feedback gathered from stakeholders will be used to develop a full-scale version of the model beginning in 2025. See the contribution file for information on how to give feedback.
There are four key features associated with the BlueSky Prototype:
A computationally efficient, modular structure that allows each sector to flexibly capture the underlying market behavior using different governing dynamics. The protype contains three test modules representing electricity, hydrogen, and residential demand. Both the electricity and hydrogen models employ least-cost linear optimization as a governing dynamic, while the residential sector model adjusts demand levels based on prices from the other two sectors. The prototype includes an 'integrator' module that can either execute an individual module or combine the modules into a single nonlinear optimization problem using two different methods. This feature will allow the next generation model to be modular and flexible.
Well-documented Python code. In the prototype, we have tried to write Python code that is easy to follow. We have included both detailed, high-level descriptions of each module in markdown, as well as code documentation using Sphinx, which we use to aggregate doc strings embedded in the code to create documentation. Most open-source models develop coding and documentation styles prior to their initial release. Even for models that are easy to apply, the underlying code and documentation are not always clear. We are inviting the community to provide feedback at this early stage so that code and documentation developed for the production version are as transparent as possible. This feature will allow the next generation model to be transparent.
An example data pipeline documented with Snakemake. Energy system models are data intensive and require a multitude of data transformations to convert raw data from a known source into formatted model input data. We are experimenting with Snakemake, a tool that allows us to create a well-documented data management framework to organize, pre-process, and post-process model data. In the prototype, Snakemake is used in a standalone application to create a geospatial crosswalk involving both electricity operations and weather data. We are considering the use of Snakemake across the model to comprehensively manage input data. This feature will allow the next generation model to be transparent.
Two methods to characterize model sensitivity. One method uses an efficient way to approximate derivatives of model outputs with respect to inputs for systems of nonlinear equations using complex variables (Lai et al., 2005). The method is broadly applicable to any module where the equations are continuously differentiable and has been implemented in applications beyond energy modeling. A second method is directly applicable to convex optimization problems and applies approximation methods for sensitivity analysis on optimization models (Castillo et al., 2006). These methods will allow us to ensure robust model results by testing model sensitivity. Additional methods to quantify model sensitivity and uncertainty will be implemented in the future.
The BlueSky Prototype is focused on demonstrating the four features above. The feedback gathered from community experimentation will be used to improve future versions of the next generation model. Given the prototype's limited scope, it does NOT provide results that are relevant to the real world. To emphasize this point, we have omitted any reference to a specific country, region, or timeframe in the input data.
Follow these steps to set up and run the BlueSky Prototype model.
To set up the appropriate Python environment, you will need to install the following:
Clone the BlueSky GitHub repository to your local computer. See the tabs below for instructions using Git or VS-Code.
Open Anaconda Prompt
Launch the Anaconda Prompt to begin the setup process.
Navigate to the Working Directory
Use the cd
command to navigate to the working directory for the BlueSky Prototype. For example:
cd path\to\your\BlueSkyPrototype
Run the Environment Creation Script
Run the batch file to set up the Conda environment:
envs\env-setup
This will create and set up the necessary Conda environment for the project.
The BlueSky Prototype can be executed either as a Dash app that provides a graphical user interface (GUI), or run from the command line. All scripts should be run from the top-level directory of the project via the app or main.py
file, as explained below.
Note that the Prototype can be run with different configuration options to indicate the modules, regionality, temporal resolution, solver options, and other module-specific settings. These options are encoded in run_config.toml
. When running the model from the command line, run_config.toml
must be modified directly and contains detailed descriptions of the configuration settings. When running the model from the GUI, the same configuration options can be set via the interface without accessing the file directly. For GUI users, the configuration options are described in detail here.
One of the key features of the BlueSky Prototype is the ability to run modules individually or select between two solve options for the integrated runs. The table below describes the different modes when running the model. More details on these methods can be found in the Integrator README.
Mode | Methods File | Demonstrates |
---|---|---|
standalone | runner.py |
Apply a unified (single optimization) method to one of the modules (Electricity, Hydrogen, Residential) |
gs-combo | gaussseidel.py |
Apply an iterative (Gauss-Seidel) method to 3-way combination of modules (Electricity, Hydrogen, Residential) |
unified-combo | unified.py |
Apply a unified (single optimization) method to 3-way combination of modules (Electricity, Hydrogen, Residential) |
Open Anaconda Prompt
Launch the Anaconda Prompt to begin the setup process.
Navigate to the Working Directory
Use the cd
command to navigate to the working directory for the BlueSky Prototype. For example:
cd path\to\your\BlueSky
Run the Dash App
To launch the BlueSky Prototype app, use the following command:
.\run_dash_app
This will start the Dash application.
Access the Web Interface
You're all set! The BlueSky Prototype model should now be running, and you can interact with it through the browser interface.
The Edit Configuration Settings section allows the user the ability to overide default settings, which are found in run_config_template.toml
. Make sure to select Save to save any changes to the default settings.
Save button allows users to save model configuration inputs for select model runs. This action overwrites the run_config.toml
file, which is used as the run file for model runs.
Configuration message This message notifies the user that they have successfully saved and updated the run_config.toml
file used for model runs.
Mode Selection and Run This is where the user selects which model mode they would like to try for a given run. After making the selection, they must click the Run button. A blue loading feature will let the user know that model is running. A blue bar will appear when the model is finished.
Output message This red message notifies the user that the model successfully ran the mode selected and created a time stamp log and model outputs folder in the outputs folder in the main directory.
Code Documentation Button When selected, this button opens the html
code documentation generated by Sphinx in a new browser tab.
To return to default settings, refresh the web browsers and click the save button to return to the template default settings.
See the tab below for instructions on how to run the model using the command prompt.
Documentation for each of the modules is available using the links below. We also include documentation for other products within the repository, including a sample data workflow tool, a sample unit test setup, and a sample output data viewer.
Users can access code documentation following these instructions for HTML, Markdown, and PDF documentation. Alternatively, code documentation can be generated by the user within the GUI by clicking the 'code documentation' button, which will run Sphinx locally and generate an html file in your open browser. See the instructions on working with the GUI for more details
See the contribution file for information on feedback. Please reach out to BlueSky team for assistance: nextgenerationmodel@eia.gov
U.S. Energy Information Administration
The BlueSky code, as distributed here, is governed by the Apache 2.0 license
Currently under development and review.