Optimization

• User defined subbasins can now have "types" such as No optimization, preferred customer, etc. Previously, these basins had to have special names. Now they can be named anything, but they need to have the appropriate type associated with them.

• Objectives can now be relaxed for later priorities. For example, objective must be within 5% of optimality, or within $100,000 of optimality. This feature is accessed by selecting Objective Min (or Max) w/ Flexibility instead of Objective Min (or Max). This selection will introduce an additional line in to the constraint editor where the user may create an expression representing the flexibility. The expression must evaluate to a constant. In addition, this line has a button to select if this value should be interpreted as a fraction of the optimal objective or an absolute quantity to relax the objective.

• Kentucky and Barkley have always been assumed to be connected to the adjoining canal using particular ends of the canal: Barkley to the "1" side and Kentucky to the "2" side. This requirement is because the canal flow equation is not symmetric with respect to these reservoirs. This requirement has been noted in the online documentation, but nothing in the code prevented a user from making incorrect links. With this release the connections are enforced and an incorrect connection will result in an error message.

• Previously the optimization formulation treated the canal symmetrically. The formulation now uses the same asymmetric formula as in simulation. (Because of linearization error, the representation remains approximate.)

• Diversion objects can now be included in optimization. The Diversion slot is a CPLEX variable, while the following slots are linearized as specified:

– Available for Diversion: a function of head using the Gravity Head Flow Table,

– Head: Diversion Intake Elevation - Diversion Base Elevation, and

– Diversion Intake Elevation: substitute with linked slot.

– All other slots are expected to be constant.

– The only physical constraint is that Diversion <= Available for Diversion.

• Optimization computes both spill and canal flows based on the average of the current and past elevation. Previously, simulation did this, but optimization used only the current time step’s elevation.

• The preferred customers modeling has been revised as previously planned. Users select the preferred customer method and specify a set of reservoirs to be in a preferred customer subbasin. The reservoirs may be a mixture of optimized reservoirs and reservoirs with energy that is allocated each day but the total is fixed rather than optimized. The Preferred Customer Energy is a CPLEX variable on the thermal object with lower bound of zero and upper bound equal to the sum of maximum energy generation for each of the subbasin members. A physical constraint is added that requires the sum of energy produced by the subbasin to be greater than or equal to the Preferred Customer Energy variable. The existing equations referencing system energy generation have been modified to subtract the preferred customer energy variable from the total generation. The modeling is completed when the user adds a policy constraint on the preferred customer energy, e.g. Thermal Object.Preferred Customer Energy >= Data Object.Energy Request

• Many model files contain extra optimization columns on slots that are no longer in use. These columns will be removed automatically.

• The use of the inflow2 slot has been modified. If the inflow2 slot on a reservoir is not linked, the optimization will expect values should be put in the simulation column. If the inflow2 slot is linked then the values will come from the linked slot. This was related to bug 2578.

• Turbine ramping is now modeled for each power reservoir when the trackRamping method is selected. This method creates two CPLEX variables to track increases and decreases in turbine ramping with the following physical constraint:

– Turbine Increase - Turbine Decrease = Turbine Release - Turbine Release(-1).

– In addition, each power reservoir has a table slot to hold the Unit Ramping Cost and a series slot that combines the costs:

– Ramping Cost = Unit Ramping Cost * (Turbine Increase + Turbine Decrease)

– After selecting methods, users can link corresponding MultiSlots on the thermal object to the individual reservoir slots: Turbine Increase, Turbine Decrease, and Ramping Cost. By referencing Thermal Object.Ramping Cost in an objective function users can minimize the total system ramping cost.

• The potential approximation error for piecewise approximations has been reduced by automatically adding a set of cuts. The worst possible error now is along a line connecting the first and last approximation points.

• "Hole cuts" are now added to the model when the appropriate method is selected on power reservoirs. When selected, cuts are added as physical constraints that reduce the incidence of holes in the schedule. The cuts constrain the segments of the piecewise linearization of power:

segment(i,t) <= segment(i,t-1) + segment(i,t+1) - segment length(i) for all i

• Both optimization and simulation now model fractional timesteps in expressions. These expressions are modelled in a way that is similar to the existing modelling of fractional time lags in reaches.e.g.

outflow[5.2] translates to: 0.8 outflow[5] + 0.2 outflow[6]

This had been filed as bug 803.

• Users can now define optimization variables without a change in the RiverWare code. Any Series Slot on a Data Object that starts with a name of "RW" will be treated as a CPLEX variable. The user can then add whatever policy constraints are necessary for the variable to have the desired behavior.

• A new method has been added to initialize turbine release to zero if it is missing (NaN). The method was added in part because of automatic generation of piecewise segments for period zero required by other enhancements.

• Code has been added to the table slot which will automatically eliminate piecewise segments during creation if the curvature is incorrect. A warning is still issued and the table is not changed.

• The automation of power linearization worked only in limited circumstances and has been repaired to work more generally. In addition, we added diagnostics for inconsistent power tables.

• When CPLEX terminates with a status hinting at numerical instability we automatically reset the CPLEX parameters to be exceedingly tolerant of numerical difficulty. We issue a warning and re-optimize.

• Automatic restart for objective functions has been turned off because of evolution of the models. Restarting at any time seems to do more harm than good. If the model is regularly restarting, we recommend increasing the time limit as necessary: under "Goal Parameters", change "Initial Time Limit".

• We increased the maximum number of pieces in a piecewise approximation from 20 to 30 to facilitate using every operating point of the power curve in the "many pieces" model.

• We added functionality to identify rows that are forcing a slot (or even an expression) to a single value. Use this fact to identify additional fixed variables both for reporting in the OptAnalyst as well as improving the speed and numerical stability of the optimization.

• We added a similar check on cuts that were forcing lambda variables to zero.

• Extrapolation of spill tables was improved by basing the extrapolation on storage for Level Power Reservoirs.

• Cut constraints have been improved to make them more useful by

– a. allowing cuts on constraints where the right hand side varies,

– b. generating additional cuts after splitting equations, and

– c. removing automatic generation of initial BWL point when the method to "reduce" cut constraints is activated. The initial point is both less useful and interferes with reducing in this case.

• Patrick Lynn improved the performance of Optimization runs which involve constraint sets with disabled constraints. During these runs, if the user had selected the option to write the CPLEX problem description to log files, then considerable time was spent doing this for disabled constraints. We don’t now bother to write anything out in this situation because no new optimization is done for disabled goals and so the problem contains no new information.

• We made the following enhancements to diagnostics:

– Missing applicability limits for initial inflow.

– Min and max inconsistent with approximation points.

– Constraints that attempt to force slots beyond bounds.

– Moved an infeasibility warning that was misplaced.

– Preferred customer warnings

– Numerical instability: problems that go from feasible to infeasible.

– Improved the context of many diagnostic messages.

– Made curvature checking less finicky for power data.

– Warning if the initial value is greater than a slot’s upper bound.

– No longer issue certain warnings for cut constraints.

– Prevent LHS >= RHS type warnings for constraints with frozen variables.

– Abbreviated some very long names for cuts.

– Updates of objective function values for MiniMax constraints whenever the objective value improves.

• The following bug fixes were made for code related at least partially to optimization. Some bugs were fixed immediately and do not have bug numbers.

– 2834: Optimization cannot be rerun.

– 2850: When saving a constraint set, model core dumps.

– CPLEX bug: writing files changes pivots.

– Incorrect cplex parameters.

– Incomplete detection of constraints inactive by Nan.

– The value -0.0 being returned by optimization.

– Incomplete detection of out of order piecewise variables.

– Inadvertent deactivation of curvature checks.

– An error message causing core dumps.

– We invalidated rows that contain only a Z variable.

– Changes in optComputeFixedOutflows to accommodate a bug fix for the problem of variable days in the month.

– Incorrect arguments in a call to notifyAddRowToProblem.

Revised: 08/02/2021