Download PDF
Download page Optimization Methods.
Optimization Methods
HEC-ResSim has the capability to optimize the distribution of flows through a set of withdrawal points - spaced vertically through a reservoir - in order to meet a water quality objective. A common example of this is the need to optimize flows through a temperature control tower in order to meet a downstream temperature target (shown below).
The optimization is accomplished by formulating an objective function and a series of linear constraints on the withdrawals, and then solving an optimization problem using the simplex method. The variables to solved for are the unknown flows out of each outlet (Q_i). Known values include the water quality constituent concentration associated with each outlet (C_i), the total flow out of all of the outlets (Q_\textrm{out}) and the target concentration (C_\textrm{target}).
The flows are subject to minimum constraints, maximum constraints, and an equality constraint:
Q_i \ge Q_{\textrm{min},i} \hspace{0.5cm} i = 1,..n \\ Q_i \le Q_{\textrm{max},i} \hspace{0.5cm} i = 1,..n \\ \sum_{i=1}^n Q_i = Q_{\textrm{out}} |
Minimum flow constraints may be set at zero or may be given positive values to account for leakage through closed gates. Leakage is common in many gated intake systems, and may be specified as a function of gate submergence depth, total outlet flow rate, or operation state (Deas et al., 2020).
We seek to minimize the difference between the target water quality concentration and the combined outlet concentration:
\textrm{Minimize} \hspace{0.2cm} | C_\textrm{target} - C_\textrm{out} | \textrm{,} \hspace{0.2cm} \textrm{where} \hspace{0.1cm} C_\textrm{out} = \sum_{i=1}^n Q_i C_i |
The simplex method of optimization requires an objective function to be maximized, so this minimization problem is reformulated:
\textrm{Maximize} \hspace{0.2cm} \textrm{--}| C_\textrm{target} - C_\textrm{out} | |
This is equivalent to introducing a new unknown variable, z = C_\textrm{out} - C_\textrm{target} and adding the constraints:
z \le -( C_\textrm{out} - C_\textrm{target} ) \\ z \le C_\textrm{out} - C_\textrm{target} |
The resulting set of inequalities and equations are rearranged, collected and organized in tableau form:
\begin{tabular}{c||c|c|c|c|c|c|l} & & z & Q_1 & Q_2 & Q_3 & Q_4 & \\ \hline \hline \tilde{z} & 0 & 1 & 0 & 0 & 0 & 0 & \textrm{objective function} \\ \hline z_1 & C_\textrm{target} & -1 & \frac{-C_1}{Q_\textrm{out}} & \frac{-C_2}{Q_\textrm{out}} & \frac{-C_3}{Q_\textrm{out}} & \frac{-C_4}{Q_\textrm{out}} & \textrm{less than/equal to constraints} \\ z_2 & -C_\textrm{target} & -1 & \frac{C_1}{Q_\textrm{out}} & \frac{C_2}{Q_\textrm{out}} & \frac{C_3}{Q_\textrm{out}} & \frac{C_4}{Q_\textrm{out}} & \\ z_3 & Q_{\textrm{max},1} & 0 & -1 & 0 & 0 & 0 & \\ z_4 & Q_{\textrm{max},2} & 0 & 0 & -1 & 0 & 0 & \\ z_5 & Q_{\textrm{max},3} & 0 & 0 & 0 & -1 & 0 & \\ z_6 & Q_{\textrm{max},4} & 0 & 0 & 0 & 0 & -1 & \\ \hline z_7 & Q_{\textrm{min},1} & 0 & -1 & 0 & 0 & 0 & \textrm{greater than/equal to constraints} \\ z_8 & Q_{\textrm{min},2} & 0 & 0 & -1 & 0 & 0 & \\ z_9 & Q_{\textrm{min},3} & 0 & 0 & 0 & -1 & 0 & \\ z_{10} & Q_{\textrm{min},4} & 0 & 0 & 0 & 0 & -1 & \\ \hline z_{11} & Q_\textrm{out} & 0 & -1 & -1 & -1 & -1 & \textrm{equality constraint} \\ \hline \end{tabular} |
and solved using the simplex method algorithm given in Numerical Recipes in Fortran (Press et al., 1992).
The water quality constituent concentration at each outlet is dependent upon the flow through the outlet (see Reservoir Outflow section). Initially, the outlet constituent concentrations are taken as the current concentration at the withdrawal centerlines. Once the optimization is solved, the outlet flows are used to determine withdrawal envelopes and new outlet concentrations. These are fed back into the optimization method, and iterated on until convergence is reached.
In the objective function setup, a very small penalty value is added to each outlet, with the penalty being dependent on either the outlet depth or outlet elevation. By doing this, the user-input release preference (top of pool or bottom of pool) can be honored in the event of well-mixed water column conditions.