Skip to main content

Easy-to-use multi-area power market model

Project description

License: MIT Python 3.6 Python 3.7 Python 3.8

gerd

Essentially, all models are wrong, but some are useful.

  • George E. P. Box

Hopefully, gerd can be of use for someone.

What is gerd?

gerd.Dispatch is an easy-to-use multi-area power market model that applies mixed-integer programming (MIP) and relaxed MIP (RMIP) for solving. The full mathematical formulation of gerd.Dispatch can be found here.

gerd.Dispatch allows you to model:

  • Power prices
  • Power plant dispatch:
    • Minimum up-time of generators
    • Minimum down-time of generators
  • Storages (batteries, pump storages etc.)
  • Must-run production
  • Cross-border flows

Main features:

  • Relies on the google package ortools:
    • Fast, memory efficient and numerically stable solvers that do not require any cumbersome third-party installations
  • Input-driven modeling to reduce needless parameter settings:
    • The input handed over to the model defines what is modeled
    • Options to switch on and off model features still exist
  • Rolling horizon optimization for cutting down run-time can be chosen
  • Different solving options available:
    • MIP if only the dispatch is needed
    • MIP followed by a RMIP if the dispatch and the prices are important

How to use it?

Installation

pip install gerd

Read input from CSV or use pandas DataFrames directly

Example input files can be found in examples.

from gerd import models
import pandas as pd

# Generators
input_gens = pd.read_csv('input_generators.csv', index_col='name')
# Load
input_load = pd.read_csv(
    'input_load.csv', index_col='time', parse_dates=True)
# Variable costs
input_var_costs = pd.read_csv(
    'input_var_costs.csv', index_col='time', parse_dates=True)

Define what to model and optimize

Going with the default and what is defined by the input, i.e. the minimum up-time of generators is modeled if it is defined in the input data.

my_model = models.Dispatch(input_data)
my_model.optimize()

Have a look at the results

my_model.solution['prices'].plot()

More examples as Jupyter notebooks:

Current limitations

  • The rolling horizon optimization works currently only for hourly input data and the index needs to be a pandas DatetimeIndex.

What is next?

Possible extension of gerd.Dispatch:

  • Definition of dynamic power plant (un)availabilities
  • Modeling of spinning reserves
  • Advanced time series input checking
  • Further options for linearization

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gerd, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size gerd-0.1.0-py3-none-any.whl (16.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size gerd-0.1.0.tar.gz (16.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page