Endvalue setting#

An important part of the hydro optimization problem is the valuation of the remaining water at the end of the simulation period. There are two possibilities to set end values in Prodrisk:

  1. as a table with aggregated end values

  2. with cuts from a previous (longer) Prodrisk run

Aggregated water value table#

The default method to set end values is via a set of tables that contain the marginal value of an aggregated energy equivalent of the remaining water, depending on the relative filling of the system and the price level. The unit is the same as the price unit. The aggregation of all reservoirs in the system follows a heuristic adopted from the long-term model EOPS. The number of price levels must be the same as the number of levels in the discrete model. The tables have a fixed layout and resolution:

  • exactly one table per price level (in ascending order) must be given

  • the tables contain water values in 2% intervals of the aggregated filling in descending order

Thus, one table looks like the following, where the first column is fixed while the second column contains arbitrary values for illustration:

Filling [%]

Water value [EUR/MWh]

100

20.234

98

20.875

96

21.040

2

32.323

0

34.506

To provide explicit end values in pyProdrisk, one has to pass the tables as a list of pandas series to the area object of the ProdriskSession:

import numpy as np
import pandas as pd
from pyprodrisk import ProdriskSession

ps = ProdriskSession( ... )
...

x = np.arange(100,0,2)  # Filling in %, with 2%-intervals, cannot be changed

end_values = []
for p in range(ps.n_price_levels.get()):
    # Add the 51 water values corresponding to the relative fillings in x for this price level
    # Example for illustration: simple linear scaling with filling. Water value rises with decreasing amount of water.
    y = np.linspace([10*(p+1), 20*(p+1), 51])

    # make a pandas series
    table = pd.Series(index=x, data=y)

    # add to the list
    end_values.append(table)

# add all end value tables to prodrisk
ps.model.area['area_name'].waterValue.set(end_values)

When Prodrisk is run from command line, it will look for a water value file from EOPS or EMPS to load end values. This requires that one of these long-term applications was run in the same directory prior to Prodrisk. Furthermore, the files must be compatible - EOPS must have been run with the same number of price levels and at least equally many weeks as Prodrisk.

End values from a Prodrisk run with longer horizon#

If Prodrisk has been run before with a longer horizon, the cuts per week represent water values in more detail (without aggregation) than the tables described above. Subsequent shorter Prodrisk runs can then use cuts from the longer simulation instead of water valuw tables. As Prodrisk by default looks for water value tables, using cuts must be activated by passing the command-line option “-STARTCUT”, or the setting cuts_as_endvalue_setting must be set to 1 in pyprodrisk. This option only works if cuts are given as input, at least for the final week. In the API, cuts are passed through the attributes cutRHS on the area object and cutCoeffs on each module and inflowSeries object. If run on command line, Prodrisk will look for an existing KUTT.SDDP file.

Unknown end values#

If no end values are available for some reason, there are two possibilities to obtain meaningful simulation results:

  1. Run Prodrisk with arbitrary end values, but with extended simulation period. For a sufficiently long simulation period, results in the period of interest (e.g., first year) will become approximately independent of the end value setting. As a rule of thumb, the surplus simulation period should correspond to the regulation level of the largest reservoir in the system. If, e.g., the largest reservoir can store inflow from up to two years, the surplus simulation period in addition to the period of interest should be at least two years. This requires that input data is available for the extended period and will significantly increase the computation time.

  2. Alternatively, one can set minimum and maximum reservoir constraints in the final week of the simulation to force Prodrisk to reach an end state in a pre-defined interval. Prodrisk will then try to reach this target independent of the end value setting. With such a calibration, the end reservoir levels may not be optimal. Therefore, end values should be used when available.