Overview of Energy Hub modelling on BESOS¶
The Energy Hub model implemented in Python in the PyEHub repository optimizes operational energy balancing and desig selection and sizing of an energy system given technical, economical and environmental constraints . The module is provided as part of BESOS, where a Jupyter Notebook can be used to set up a basic model, customise it, run it and plot the results. A series of examples are given below.
The figure below shows the original EHub workflow to run a model defined in an Excel file which describes the system layout, convertors, storage system(s), energy streams and timeseries. Several tutorials and examples are available through GitLab on how to setup up this input file. This gets parsed into model data, which is used to set up the problem constraints, which are passed to a solver like CPlex or GLPK to find the least cost solution. This solution is printed to the terminal and to an output Excel file.
Simple PyEHub workflow.
Using PyEHub features via Jupyter Notebooks¶
The figure below shows the workflow on BESOS. We make use of Jupyter
Notebooks to make changes to the model definition file, extend the base
PyEHub code, run model variations, read the outputs into a pandas
DataFrame and plot them.
Jupyter Notebook based workflow for Energy Hub modelling on BESOS.
The following notebooks give examples of interacting with Energy Hub model from a notebook. The core model is customised in various ways, then applied to an Excel-based model file.
- Adding custom constraints shows how to add three different types of custom constraints.
- Modify existing constraint edits an existing constraint of the base model to add a subsidy for certain renewable technologies.
- Remove existing constraint turns off an existing constraint.
- Rooftop Constraint adds a constraint which limits roof size on which solar technologies can be installed.
- Time Varying Grid Price adds a time series which represents grid price.
- Time Resolved Carbon Factors combines Energy Hub modelling in BESOS with analysis of the wider power system using SILVER.
- Storage plots gives graphical results showing how a storage device is operated.
- Overriding Input Data gets load data
for some typical days from a separate file, overwrites the time
series and solves the model for each time series. Outputs are stored
in a single
DataFrameand key items are printed.
- Workshop - Remote Communities outlines the process of modelling energy systems for remote communities. This includes reading data, optimizing parameters, and visualizing the results
The Energy Hub model can provide useful results for just one hub, but the real power of the model is when multiple hubs are linked together. - Multiple Hubs gives an overview of how hubs are linked together. - Linear Powerflow adds linear powerflow constraints to the Energy Hub model.
EHEvaluator and Parameter Editor¶
Several functions are provided for integration with the rest of BESOS.
EHEvaluator allows an Energy Hub model to be called via the
Evaluator class. This is useful for integration with the
EnergyPlus and Surrogate Modelling Evaluators. -
EHEvaluator demonstrates the EHEvaulator. - EP
to EH Evaluators shows how to combine an
Energy Hub and and EnergyPlus Evaluator.
pyehub_parameter_editor function is used by the
Parameters. - PyEHub Parameter
Editor shows how to define BESOS Parameters
for PyEHub models.