Gurobi Modeling Examples

Explore our modeling examples for the Gurobi Python API

Modeling Session 2 - Renewable Energy and Storage Optimization

Problem

A univeristy building is going to hold classes for a week, which requires electricity to run. and the demand for electricity changes due to the course load. There is a solar panel to provide energy and two batteries that can store it. Additionally, electricity can be purchased from the gird. The goal of the problem is to find the battery charge and discharge schedule that will:

  1. Minimize the total electrity purchased from the grid.
  2. Given electrity prices for each period, minimize the total cost of purchasing electricity from the grid.

Markdown Monster icon

Along with the modeling example, an exercice is provided.

Beware Spoilers!

We also put completed versions of the modeling1 notebook and the exercise in the repo. If you want to work through the notebooks without everything filled in make sure not to open the completed versions.

View the notebook

Google Colab Link - Modeling Session without answers

Google Colab Link - Exercise without answers

Google Colab Link - Modeling Session with answers

Google Colab Link - Exercise with answers


For details on licensing or on running the notebooks, see the overview on Modeling Examples