Interacting with Prodrisk

Contents

Interacting with Prodrisk#

Prodrisk is a program for long- and mid-term hydropower optimization and simulation. Prodrisk is based on stochastic dual dynamic programming (SDDP), which enables stochastic optimization with many reservoirs. This section describes the available functionalities in the API version of Prodrisk, with the object types and their attributes used to communicate data to and from the model. For a more detailed description of the Prodrisk model, please consult the other sections of the Prodrisk refrence manual.

For users who are familiar with traditional CLI execution of Prodrisk[1], we would like to note that nomenclature and units of input attributes in the API may be different than what you are used to. We have included some references to the traditional nomenclature to make the transition to running the model through the API easier. Also note that not all Prodrisk functionality is available in the API version yet. If you come across missing functionality which you frequently use in your traditional Prodrisk runs, please report this to SINTEF.

API#

The current API provides functions to transfer data to and from Prodrisk. This allows the API to be used as a flexible integration with several programming languages.

The API interacts with Prodrisk by writing files and running Prodrisk as a separate process reading and writing from/to these files. As default, data files will be removed after the session with the client is closed, or after a given time of inactivity. An API call may be used for keeping the files for debugging purposes.

There are five object types that can be modified by the user: “module”, “pump”, “inflowSeries”, “area” and “setting”. The module object represents a reservoir-plant combination, and carries the attributes detailing the physics of the system. Pumps are modelled as separate objects which must be connected to a module[2]. The inflowSeries object holds inflow data, and the area object represents the total hydropower system. Finally, general model information is stored in the setting object. There can only be one setting and one area object in a Prodrisk simulation, whereas there can be several modules, inflowSeries and pumps. Every module must be connected to an inflowSeries through an id number, and a single inflowSeries can be connected to several modules.

The simulation interval in Prodrisk must be given as a whole number of weeks. The number of inflow and price scenarios should be the same, where the first price scenario corresponds to the first inflow scenario, and so on. The time spanned by each scenario must be at least the length of the simulation interval. The inflow scenarios must be at least 52 weeks, even though the simulation interval is shorter.

Python API#

For a basic example using pyprodrisk, see PyProdrisk: Basic example