Skip to main content

Temperature regulation optimization for hydropower operations

Project description

TempRegPy

Temperature-constrained hydropower dispatch optimization using Mixed-Integer Linear Programming (MILP).

Overview

TempRegPy optimizes hydropower release schedules to maximize energy revenue while maintaining downstream water temperatures within ecological limits. It uses selective withdrawal from thermally stratified reservoirs, market-based dispatch, and configurable operational constraints within a MILP framework solved via HiGHS (OR-Tools MathOpt).

Installation

uv pip install:

uv pip install tempregpy

Or with pip:

pip install tempregpy

For development:

git clone https://github.com/energy-modelling-hub/TempRegPy.git
cd TempRegPy
uv pip install -e ".[dev]"

Quick Start

Generate a synthetic configuration file:

python examples/generate_config.py

Run the optimizer:

python -m tempregpy run -c examples/config.xlsx

See examples/README.md for details on the synthetic test case.

Features

  • MILP-based temperature-constrained hydropower dispatch
  • Selective withdrawal from thermally stratified reservoirs
  • Multiple bilinear term linearization methods (McCormick, triangles, polygons, sum-of-convex)
  • Configurable ramping, cycling, and operating range constraints
  • Market-based dispatch with locational marginal prices
  • HiGHS solver via OR-Tools MathOpt (open-source)
  • Excel-based configuration input
  • CLI interface

Citation

If you use TempRegPy in your research, please cite:

@article{pavicevic2025tempregpy,
  title={TempRegPy: An Open-Source MILP Framework for Temperature-Constrained Hydropower Dispatch with Application to Glen Canyon Dam},
  author={Pavicevic, Matija and Usis, Maris Andris and Yu, Ao and Henriquez, Walter Antonio and Wilhite, Jerry and Ploussard, Quentin},
  journal={Environmental Modelling \& Software},
  year={2025},
  doi={DOI_PLACEHOLDER}
}

License

MIT License. See LICENSE for details.

Developers guide (compile .exe file)

python -m venv ./env
./env/scripts/activate
pip install -r requirements2.txt
pyinstaller runwapasim.spec

RunWAPASim.exe can be found in the /dist folder

Project details


Download files

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

Source Distribution

tempregpy-0.3.0.post0.tar.gz (38.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tempregpy-0.3.0.post0-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file tempregpy-0.3.0.post0.tar.gz.

File metadata

  • Download URL: tempregpy-0.3.0.post0.tar.gz
  • Upload date:
  • Size: 38.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tempregpy-0.3.0.post0.tar.gz
Algorithm Hash digest
SHA256 277783506feb2d062916883d38b940ef74451bf22220734100794070c2fcbdca
MD5 c8b3a6b0ea64891ce5338999b621b2a1
BLAKE2b-256 5ca9ec67b17d8c97c52520409d3422cfc42ca99cf555018c896cd14c42dee9f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for tempregpy-0.3.0.post0.tar.gz:

Publisher: ci.yml on energy-modelling-hub/TempRegPy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tempregpy-0.3.0.post0-py3-none-any.whl.

File metadata

File hashes

Hashes for tempregpy-0.3.0.post0-py3-none-any.whl
Algorithm Hash digest
SHA256 0083712fd9c1596b7f93bf7915e773b2acebc49900f986b27074e164bc211d43
MD5 11cf970b32ed5eb3460bd920144a2f52
BLAKE2b-256 2f466c6f4ad77edf000f26cf5beb1fa704d990fa7dcb0a69bf31fd8566386c2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for tempregpy-0.3.0.post0-py3-none-any.whl:

Publisher: ci.yml on energy-modelling-hub/TempRegPy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page