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. This guide suggests using venv in Python for creating virtual enviroments, but other tools should work as well.
  2. Install the prodrisk-shop-simulator Python package:
pip install prodrisk-shop-simulator
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Execute the script.

[!important] Prodrisk and SHOP information The simulator requires valid licenses for both Prodrisk and SHOP. Ensure you have access to these tools before running any simulations. For more information on obtaining licenses, or Prodrisk or SHOP specific setup, please refer to the official documentation of Prodrisk and SHOP.

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.1.tar.gz (40.0 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.1-py3-none-any.whl (41.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: prodrisk_shop_simulator-1.1.1.tar.gz
  • Upload date:
  • Size: 40.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.5 Linux/4.18.0-553.76.1.el8_10.x86_64

File hashes

Hashes for prodrisk_shop_simulator-1.1.1.tar.gz
Algorithm Hash digest
SHA256 fa1593e14c2f45f978c7c5745fd4ce8ac401828028f5c53e2f348341bdffc3b1
MD5 9d712a6db0df87a17f4bcca8fc65e215
BLAKE2b-256 10c3bfa117b2a110b73cb0aab232d4cad245869c16023dd33d43f8dccdc28f93

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prodrisk_shop_simulator-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 41.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.5 Linux/4.18.0-553.76.1.el8_10.x86_64

File hashes

Hashes for prodrisk_shop_simulator-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0230251fd45abfb3bce16a316bed943c33d4e680d76a7e2f49ef91f04d50de4b
MD5 678d9442ebb16c87736be1dde72fe8ce
BLAKE2b-256 31bf3f70f82c5303b88d195f7cd9013dc339cd669e3233b0117c6d6acf27ae08

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