Skip to main content

Package for simulating hydro power systems with Prodrisk first followed by SHOP using cuts from Prodrisk.

Project description

Prodrisk-SHOP simulator

The Prodrisk-SHOP simulator is a optimization framework for hydropower systems. It combines the stochastic mid-term model Prodrisk and the short-term model SHOP to run detailed analysis for long time horizons. The simulator first runs the mid-term model to generate a strategy described with cuts, that are state dependen water value functions. The corresponding SHOP model is then optimized for a limited time horizon, typically 7 days, using the cuts from Prodrisk. The end state from one SHOP optimization is used as initial condition for the following SHOP optimization allowing serial simulation with SHOP for multiple weather scenarios. The simulator has been developed in FME HydroCen.

This work was funded by The Research Council of Norway through project no. 257588.

Prerequisites

The simulator uses Prodrisk and SHOP, together with their python APIs pyprodrisk and pyshop.

Installation

It is recommended using virtual environment in Python when using the simulator to ensure the required Python packages are not conflicting with existing installations. The simulator comes with a basic example included that should be executed to verify that the installation is successful. Please follow the steps below to get started:

  1. Install Python (3.10 or newer is recommended). This guide suggests using venv in Python for creating virtual enviroments, but other tools should work as well.
  2. Clone this repository and open it with VSCode.
  3. Start the git bash terminal in VSCode.
  4. Create a virtual environment with the command python -m venv .venv. This will create a folder inside the project called .venv which is the name of the virtual environment.
  5. Activate the virtual environment. This will happen automatically if you restart the terminal, or you can do it with the command source ./.venv/Scripts/activate.
  6. Make sure pip is updated: pip install --upgrade pip.
  7. Install the simulator with pip install -e .. This will install the Prodrisk-SHOP simulator and all necessary dependencies.
  8. Create a file system_config.yaml in ./examples based on the template ./examples/system_config.yaml.tmp. Replace the values with the appropriate values for your system. See pyshop and pyprodrisk readme for details.
  9. Open ./examples/basecase/script.py in VSCode. Make sure the path to the pyprodrisk and pyshop installations are set correct. See https://github.com/sintef-energy/pyprodrisk and https://github.com/sintef-energy/pyshop for detailed instructions.
  10. Execute the script.

Results dashboard

The simulator has an integrated dashboard with various tables and plots. To launch the dashboard, please follow the steps below:

  1. Make sure the virtual environment is activated, if not run the command source ./.venv/Scripts/activate
  2. Install Streamlit with pip install streamlit
  3. Make sure the path to the file simulator_config.yaml is set correctly in dashboard/functions/functions.py. The path can also be set directly to the dashboard interface.
  4. Launch the dashboard with streamlit run dashboard/System_overview.py

The resume_week and resume_scen optional arguments in the function run_serial_simulation() can be used to resume the simulation from a given scenario and week number. If problems occur for resume_week=1, the resume week should be set to one of the last weeks of the previous scenario. Note that currently the simulator does not support more than one market (of type day-ahead or spot). The dashboard assumes that all models have corresponding Prodrisk modules.

Publications

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

prodrisk_shop_simulator-1.1.0.tar.gz (39.8 kB view details)

Uploaded Source

Built Distribution

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

prodrisk_shop_simulator-1.1.0-py3-none-any.whl (41.8 kB view details)

Uploaded Python 3

File details

Details for the file prodrisk_shop_simulator-1.1.0.tar.gz.

File metadata

  • Download URL: prodrisk_shop_simulator-1.1.0.tar.gz
  • Upload date:
  • Size: 39.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.9 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for prodrisk_shop_simulator-1.1.0.tar.gz
Algorithm Hash digest
SHA256 b072108fb9d19648109026c724b148f77ab7a36a1ba6b405ab2b43dbfa454f8c
MD5 866a120d0a5df5f71deae628445439a8
BLAKE2b-256 7b88d6ef8af0bc3474b91383e68cc3a6103ff6658ddda43301270cf8baea12f4

See more details on using hashes here.

File details

Details for the file prodrisk_shop_simulator-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: prodrisk_shop_simulator-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 41.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.9 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for prodrisk_shop_simulator-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5bcfbca10901724229f8db1f83ea3a13b48c67ff5e31ea5c7049d593c69b959
MD5 47677e4163b05895f2319215f916c94b
BLAKE2b-256 354e87891af87f8b1a37a747684352b5d1a9dd3f482f5803e8a55f186fcc39bd

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