skip to main content
Initialization Rules
Initialization Rules can be used for preprocessing of data for Optimization runs. See Initialization Rules Set in RiverWare Policy Language (RPL) for general information on initialization rules.
Usage
One use of Initialization Rules that is particular to Optimization is setting approximation points. Approximation points allow the user to control how non-linear processes are linearized. See Linearization, Approximation, and Replacement for general information on linearization. See Provide Approximation Points for guidelines on setting approximation points.
In some cases, it might make sense to set the approximation points based on the specific run conditions. For example, for a reservoir that has a large seasonal variation in Pool Elevation, it might not be possible to set Tangent and Line approximation points in the Pool Elevation LP Param table or an Operating Head point in the Power LP Param table (when using the Independent Linearizations method in the Optimization Power category) that will result in sufficiently small approximation error across all conditions. In these cases, initialization rules can be used to set the approximation points such that the approximation error will be small for the expected operating range of the given run but would be large if operating in a different range in another season. Figure 3.3 is an example initialization rule that sets the Pool Elevation LP Param Tangent point equal to the initial Storage for the run.
Figure 3.3  Sample Initialization Rules setting LP Param approximation points
A second rule could set the two Line points to the Tangent point plus or minus some expected delta. In this manner, the approximations will be updated automatically when the model runs, rather than needing to adjust the values manually at the start of each run.
Enable or Disable Initialization Rules based on Controller
Initialization rules can execute at the beginning of the Simulation controller run, the Optimization run, and/or at the beginning of the post-optimization Rulebased Simulation. The execution is controlled by the separate toggles/settings on the Run Control as shown in Figure 3.4 and Figure 3.5.
Figure 3.4  Run Control showing Execute Initialization Rules for Sim/Rule controller
Figure 3.5  Run Control showing Execute Initialization Rules before Optimization run
You can use scripts to turn on or off these toggles/flags. See Set Init. Rules Exec. Flag in Automation Tools.
Timing
Initialization rules execute before prerun expression slots. These execution times should be kept in mind when formulating the logic of initialization rules used for Optimization and which slot values they can reference.
Revised: 01/10/2022