**3. Water resources management as optimal control problem**

The water resources allocation problem is formulated as a discrete-time optimal control problem:

$$\min\_{\mathbf{u}^{k},\ k=1,\ldots,K} \left\{ F\left(\mathbf{x}^{K}\right) + \sum\_{k=0}^{K-1} \mathbf{f}\_{0}^{k}\left(\mathbf{x}^{k}, \mathbf{u}^{k}, \mathbf{z}^{k}\right) \right\} \tag{6}$$

subject to

$$\mathbf{x}^{0} = \mathbf{x}\begin{pmatrix} t\_{0} \\ \end{pmatrix} \tag{7}$$

Model Based Sustainable Management of Regional Water Supply Systems http://dx.doi.org/10.5772/51973 39

$$\mathbf{x}^{k+1} = \mathbf{f}^k \left( \mathbf{x}^k, \mathbf{u}^k, \mathbf{z}^k \right) \tag{8}$$

$$\mathbf{h}^{k}\left(\mathbf{x}^{k},\mathbf{u}^{k},\mathbf{z}^{k}\right) = \mathbf{0} \tag{9}$$

$$\mathbf{g}^{k}\left(\mathbf{x}^{k},\mathbf{u}^{k},\mathbf{z}^{k}\right)\leq\mathbf{0}\tag{10}$$

The state variables *x* are the volume content of the reservoirs and channels with small slope and the states of the reduced groundwater model. Control variables u are the discharge of the transport elements as well as the water demand of the customers. The uncontrollable in‐ puts z are the direct precipitation and the potential evaporation for the reservoirs and the flow of rivers entering the considered region, which is derived by means of rainfall-runoffmodels. The number of time steps within the optimization horizon is denoted by *K.*

The process equations (8) consist of the balance equations of the storage nodes and the re‐ duced groundwater model. The balance equations of the non-storage nodes are formulated as general equality constraints (9). The objective function (6) contains the goals of the water management, which are primarily the fulfillment of the customer demand, the compliance with targets for the reservoir and groundwater storage volume and the delivery of water with respect to environmental purposes. Therefore quadratic terms are formulated, which penalize the deviations from desired values, like e.g. for the demand deficit of the demand node j:

$$f\_0^k\left(\mu\_j^k\right) = \mathfrak{p}\_j^k \Delta t^k \frac{\left(\mu\_j^k - q\_{dem,ref,j}^k\right)^2}{\left(q\_{dem,ref,j}^k\right)^2} \tag{11}$$

where *qdem,ref,j* is the demand of and *uj* is the discharge delivered to the customer. While this term applies for every time step within the optimization horizon, other terms are formulated only for the final point of the horizon, like e.g. for the desired volume content of the reser‐ voirs.

The inequality constraints (10) follow from the technical capabilities of the water distribu‐ tion system and rules to guarantee safe operation, which are simple bounds for the control variables:

$$\mathbf{u}\_{\text{min}}^k \le \mathbf{u}^k \le \mathbf{u}\_{\text{max}}^k \tag{12}$$

as well as constraints for the reservoir volume *xv*:

sion process (cf. equation (4)) only nearby located input and output parameters (e.g. re‐ gions/wellfields and the corresponding observation wells) have some correlation and a SISO model with these input-/output combinations can be gained. Due to this physical reason the number of relevant SISO models is relatively small and hence the resulting MIMO model of relatively low dimension (n < 50) which is appropriate for the optimiza‐ tion problem. This proposed approach can be called trajectory and identification based model reduction. A similar approach (for a nonlinear large scale system) is found in [14].

**Figure 8.** Reduced groundwater model as a linear state space model in combination with a pre-simulated reference

The water resources allocation problem is formulated as a discrete-time optimal control

() ( ) <sup>1</sup>

<sup>0</sup> **x x** = *t* (7)

(6)

ì ü ï ï í ý +

**x fxuz**

**3. Water resources management as optimal control problem**

<sup>0</sup> , k 1, ,K <sup>0</sup>

= =

*F*

K

min , , *<sup>k</sup> K K k k kk*

ï ï î þ <sup>å</sup> **<sup>u</sup>**

( ) <sup>0</sup>

*k*


scenario.

38 Water Supply System Analysis - Selected Topics

problem:

subject to

$$\mathbf{x}\_{v,\min}^{k} \le \mathbf{x}\_{v}^{k} \le \mathbf{x}\_{v,\max}^{k} \tag{13}$$

One alternative approach consists of eliminating the state variables from the optimization problem. The reduced dimension of the according non-linear programming problem with (*K m*) optimization variables comes along with a loss of structure. The Hessian and Jacobian

trol variables (number of edges in the network description) this approach is not promising

For the numerical solution of large scale non-linear programming problems interior point (IP) solver have become popular during the last years because of their superior behavior for NLPs with many inequality constraints. In this approach the objective function is expanded

( ) ( ( )) ( ) <sup>g</sup> <sup>n</sup>

ì ü ï ï í ý +m - <sup>=</sup> ï ï î þ **<sup>y</sup>**

The solution of the original NLP (15) results from the subsequent solution of (17) with a de‐ caying sequence of *µ → 0*. The identification of right active set with its combinatorial com‐ plexity is avoided. The state of the art non-linear interior point solver IPOPT is used for the application at hand [15]. The interface for multistage optimal control problems of the opti‐ mization solver HQP [16], which provides an efficient way for problem formulation along with routines for the derivation of ∇ *J*, ∇*h* , ∇*g* by means of automatic differentiation

A typical water management problem (horizon of five years, discretization of one month) has about 8000 optimization variables, 5500 equality constraints and 7200 inequality con‐ straints. The numerical solution takes approximately 60 iterations and a calculation time of 10 seconds on an Intel Core 2 Duo CPU (2.5 GHz). Table 1 shows the linear depend‐ ency of the numerical solution effort from the number of time steps within the optimiza‐

30days 7898 56 52 9.6

10 days 23880 66 145 35.1

5 days 47853 56 286 61.7

**y g y hy 0** å (18)

Model Based Sustainable Management of Regional Water Supply Systems

**Numerical solution effort**

**Iterations main storage [MB] calculation time**

**[s]**

j 1 min ln *<sup>j</sup> J* =

> **optimization variables**

**Table 1.** Numerical solution effort in dependence on the optimization horizon

and the large amount of con‐

http://dx.doi.org/10.5772/51973

41

matrices are full. Because of the solution effort of order (*K m*)*<sup>3</sup>*

by adding barrier terms for the inequality constraints:

for this special field of application.

[17], is used and coupled to IPOPT.

tion horizon.

**optimization horizon**

and the hydraulic head *hhydr* of the observation wells:

$$\mathbf{h}\_{hydr,min}^{k} \le \mathbf{g}^{k} \left( \mathbf{x}\_{\mathcal{g}w}^{k} \right) \le \mathbf{h}\_{hydr,max}^{k} \tag{14}$$

With respect to the practical applicability selected parts of the inequality constraints (10) can be relaxed in order to avoid infeasible optimization problem with respect to unrealistic man‐ agement demands.
