skip to main content
Optimization : Technical Appendix : Optimization Units and Scaling
Optimization Units and Scaling
Optimization computations are carried out in the same RiverWare standard units used for Simulation computations with one difference. As with Simulation, values are converted automatically from display units to internal units for computations, but for Optimization, that internal conversion might also include scaling. For example, storage volumes in standard units are often on the order of 109m3, whereas elevation changes might be on the order of 10‑1m. Introducing variables with such a wide range of magnitudes can lead to instability in an Optimization solution. Storage and elevation values are therefore scaled when added to the Optimization problem so that they will tend to be of similar orders of magnitude.
RiverWare determines how to scale values based on their unit types, and all conversions are carried out internally. The unit scaling is specified in the Optimization Run Parameters. To modify the unit scaling, in the Run Control, set the controller to Optimization. Then select View then Optimization Run Parameters. In the Optimization Run Parameters dialog box, select Set CPLEX and Goal Parameters. In the Set Optimization Solver Parameters dialog box, select the tree-view arrow for RiverWare Units, and select the desired unit type. Table A.1 shows the default unit scaling for each unit type. Unit types not listed will always use the standard RiverWare internal units.
 
Table A.1  Optimization Units - Default Scaling Values
Unit Type
Parameter
Default Scale (with standard unit)
None (dimenisionless)
UNITS SCALE NOUNITS
1
Length
UNITS SCALE LENGTH
10 m
Area
UNITS SCALE AREA
1e7 m2
Volume
UNITS SCALE VOLUME
1e8 m3
Flow
UNITS SCALE FLOW
1000 cms
Power
UNITS SCALE POWER
1000 MW
Energy
UNITS SCALE ENERGY
1000 MWH
Time
UNITS SCALE TIME
1e5 s
Money
UNITS SCALE VALUE
1e5 $
PowerPerFlow
UNITS SCALE POWER PER FLOW
1 MW/cms
FlowPerTime
UNITS SCALE FLOW PER TIME
1e-2 cmss
Velocity
UNITS SCALE VELOCITY
1e-4 m/s
PowerPerTime
UNITS SCALE POWER PER TIME
1e-2 MW/s
FlowSquared
UNITS SCALE FLOW SQUARED
1e6 m6/s2
VolumeSquared
UNITS SCALE VOLUME SQUARED
1e16 m6
Ideally the scaling is such that coefficients on variables in the internal representation of the optimization problem are close to 1.0, within one or two orders of magnitude. Very small coefficients in particular can lead to numeric instability. The default unit scaling values generally result in reasonable scaling for most RiverWare optimization models with a timestep of 1 Hour or 6 Hour. The user, therefore, does not typically need to be concerned with scaling unless the timestep is larger or smaller. For example, for a model with a 5 Minute timestep, it may be necessary to decrease the Time unit scaling by a factor of 10 or 100. When the Time scaling is reduced by a factor of 10, other scaling adjustments are required for consistency.
• Area, Volume: Reduce by a factor of 10
• Volume Squared: Reduce by a factor of 100
• FlowPerTime, PowerPerTime, Velocity: Increase by a factor of 10
If Time scaling is increased, the direction of the other adjustments needs to be reversed.
Knowledge of the unit scaling may also be necessary when viewing the full LP problem generated for debugging purposes.Values in the LP text file will be the scaled values. For assistance with questions about scaling, contact RiverWare Support: riverware‑support@colorado.edu
Revised: 08/02/2021