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.3.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.3-py3-none-any.whl (99.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hydropt-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 14e66506eeab57d6e4a6017f0ff4313e9deafd35c0dfd6a772c1b55eba811426
MD5 73cdae063393a3cec02810db18120abb
BLAKE2b-256 0a7dd4a423e03ad20eaf8f90898a51d8d4b8595a77fec92fb1d0982fb37d56a4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hydropt-0.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6b75c9c69777b3b0d4c04239edbebdd722b24be4ae3d470dcde571eadeae26b8
MD5 907f1afbc215bb4fcbb05b53811f3b9b
BLAKE2b-256 0ebaf40941cd3da2dafe0470d39d1ebbd8df740cb2646ac5ff1dbb0b7051bfad

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