Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Reservoir dynamic level limit

Open in vLab iLab Assistant

This example illustrates how the reservoir dynamic level limit constraint works. The dynamic level constraints imposes a maximum deviation between the lowest and highest reservoir level within predefined time periods (e.g. max 15 cm deviation within each 24 hours in the optimization period). The constraints are similar to the reservoir limit level period ramping (limit_level_period_ramping_up and limit_level_period_ramping_down), except the constraint is on the maximum level difference within each time period instead of the maximum difference between consecutive time periods.

The model setup for this example is available in the following format:

Create SHOP session and import basic model

Our example model consists of one reservoir and one plant.

Loading...

Run model without dynamic level constraints

We ultimately want to impose a maximum of 40 cm deviation between min and max reservoir level within every consecutive four hour period of the optimization. In addition, the first four hour period started two hours before the start of our SHOP optimization. The reservoir level in the two hours before start is known to be 94.6 and 95 masl:

We start by running our model without any dynamic level limit constraints.

We then plot the resulting reservoir level, and we see that the level variation is more than 0.4 m within all of the time periods. Note that the historical_level attribute is ignored in this initial run but is used for plotting purposes.

Loading...

Add dynamic level limit constraints

We will now create a new SHOP instance and add the dynamic_level_limit constraints. We define our fixed time periods to be four hours long, with an offset of two hours. The offset means that the first whole time period will start two hours after the start of the optimization period. The two initial hours are therefore part of a partially historic period that includes the two hours before optimization start. To ensure that the constraint is enforced correctly for this first period, historical reservoir level data must be provided through the reservoir attribute historical_level.

It is possible to define multiple dynamic reservoir limits with different period lengths (e.g. 40 cm over four hours and 100 cm over 168 hours) by adding more entries into each XY table in the dynamic_level_limit XYT. The time stamps in the XYT also makes it possible to change the constraint limits inside the optimization period, such as changing the four hour limit from 40 cm to 20 cm after 12 hours. This type of modelling is not shown in this example.

Again we plot the resulting reservoir levels. We see that now the level variation is equal to the maximum allowed value of 0.4 m within all of the time periods, including the very first time period for which the historical data is used.

Loading...

Note that the final constraint period only contains two time steps within the optimization, since the total horizon is 24 hours long and an offset of two hours is used. The dynamic level limit constraint is still enforced on this final two hour long period.