Skip to main content

Solves dynamical programming problems for the optimization of hydro power plants.

Project description

Hydropt

Hydropt is a dynamic prgrogramming tool for the optimization of hydro power plants. It includes classes to model power plants, their basins and turbines as well as to define scenarios with constraints.

Different scenarios can easily be compared with each other to compute and evalutate opportunity costs. A typical use case would be to price constraints due to ancillary services commitments or machine outages.

Installation

Run the following to install:

pip install hydropt

Usage

The following example shows how hydropt can be used for the optimization of a simple hydro power plant with only one basin and a single turbine.

import numpy as np
import hydropt as ho

# Define basin
basin = ho.Basin(
    'basin_1', 
    volume=75e6, #m3 
    num_states=101, 
    levels=(1700, 1792), #m ü. M
    start_volume=60e6, #m3
)

# Define outflow
outflow = ho.Outflow(outflow_level=1090)

# Connect basin and outlow via a turbine
turbine = ho.Turbine(
    'turbine_1', 
    max_power = 45e6, #Watt
    base_load =  1e6, #Watt
    efficiency=0.8, 
    upper_basin=basin, 
    lower_basin=outflow,
    actions=[
        ho.Standing(), 
        ho.MinPower(),
        ho.MaxPower(),
    ],
)

# Define power plant model
power_plant = ho.PowerPlant([basin,], [turbine,]) 

# Load spot prices
spot_2019 = ho.load_spot_data()

# Set optimization time frame and assign price curve
time = spot_2019.index.to_numpy().astype('datetime64[h]')
spot = spot_2019['Switzerland[EUR/MWh]'].to_numpy()

# Compute inflow rate
inflow_rate = 5*np.ones((len(spot),1))

# Define a scenario
underlyings = ho.Underlyings(time, spot, inflow_rate)
scenario = ho.Scenario(power_plant, underlyings, name='base case')

# Run optimization
scenario.run()

# ... wait about 30 seconds ...

# Plot results
scenario.results_.plot()

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

hydropt-0.0.2.tar.gz (101.9 kB view details)

Uploaded Source

Built Distribution

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

hydropt-0.0.2-py3-none-any.whl (99.2 kB view details)

Uploaded Python 3

File details

Details for the file hydropt-0.0.2.tar.gz.

File metadata

  • Download URL: hydropt-0.0.2.tar.gz
  • Upload date:
  • Size: 101.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.6

File hashes

Hashes for hydropt-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c5b379d1f7e155dc8310febb36b27ca7eb3c8945570c180bbaad705d35bd315e
MD5 605b77c8fee077e54781f077ec9f2858
BLAKE2b-256 03828cf80ea69627f556c788eb16f26b0355076d17a24d2c99885ae8a2d13335

See more details on using hashes here.

File details

Details for the file hydropt-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: hydropt-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 99.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.6

File hashes

Hashes for hydropt-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 59a83d1af46da5ac5903b0571ab918395cc58cdbf295de64c05665e31ec48e54
MD5 58e946312dac61026233241fe7f850e6
BLAKE2b-256 df29fd8d36862ab9edef00d99a5f8afb62bf95b818a4224e6a5e371a81c6cb70

See more details on using hashes here.

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