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.

Including generated scenarios in the optimization

Licenseyes
Release version10.8

This functionality allows Prodrisk to include additional generated scenarios in the optimization. The scenarios are redrawn each iteration, and are only included in the beginning of each main iteration. At the end of each main iteration, Prodrisk optimizes only on the historical scenarios. This mechanic is controlled by the attributes last_iteration_generated_scenarios and min_iterations_without_generated_scenarios (see Attribute list below).

The number of additional generated scenarios are controlled by the attribute n_generated_scenarios. For each of the scenarios, inflow and price series are drawn from the chosen inflow model and price model used during backwards recursion. Correlation between inflow and price is not considered, since these are sampled independently.

For the inflow sampling, there exists three configurations, controlled by the attribute generated_inflow_type:

For the configurations “Percentiles” and “Extremes”, the number of samples to choose from is controlled by the attribute n_sample_scenarios. The different types of inflow sampling are illustrated in the figure below:

Output to the log file

When using the functionality, Prodrisk will write a descriptive message to the log file prior to the optimization:

Using 6 generated scenarios until iteration 30
Using extreme inflow scenarios
Total: 64 scenarios

In the above example, 58 historical scenarios are used during the entire optimization, and 6 additional generated scenarios are used until iteration 30. Prodrisk writes to the log file when the generated scenarios are removed:

Max Limit: Remaining iterations without generated scenarios

If convergence is achieved before iteration 30, the generated scenarios will be removed and Prodrisk will write the following message to the log file:

Convergence: Remaining iterations without generated scenarios

Attribute list

prodrisk.CPARAPI attributeDefault valueExplanation
n_gen_forwardn_generated_scenarios0Number of generated scenarios to include in the optimization
n_sample_forwardn_sample_scenarios1000Number of sampled inflow scenarios to generate percentiles or extremes from
gen_inflow_forw_typegenerated_inflow_type0Type of generated inflow sampling (0: Random, 1: Percentiles, 2: Extremes)
last_iter_gen_forwlast_iteration_generated_scenarios1000Last iteration where generated scenarios are included in the optimization
min_iter_no_gen_forwmin_iterations_without_generated_scenarios10Minimum number of iterations without generated scenarios at the end of the optimization