Вы находитесь на странице: 1из 7

Optimization Methods: Dynamic Programming Applications Water Allocation

Module - 6 Lecture Notes 4 Water Allocation as a Sequential Process Numerical Example Introduction In the previous lecture, recursive equations for a basic water allocation problem were developed for both backward recursion and forward recursion. This lecture will further explain the water allocation problem by a numerical example. Numerical problem and solution Consider the example previously discussed with the maximum capacity of the canal as 4 units. The net benefits from producing the crops for each field are given by the functions below.
NB1 ( x1 ) = 5 x1 0.5 x1 NB3 ( x3 ) = 7 x3 x3
2 2 2

NB2 ( x2 ) = 8 x2 1.5 x2

The possible net benefits from each crop are calculated according to the functions given and are given below. Table 1 xi 0 1 2 3 4

NB1 ( x1 )
0.0 4.5 8.0 10.5 12.0

NB2 ( x2 )
0.0 6.5 10.0 10.5 8.0

NB3 ( x3 ) 0.0 6.0 10.0 12.0 12.0

The problem can be represented as a set of nodes and links as shown in the figure below. The nodes represent the state variables and the links represent the decision variables.

D Nagesh Kumar, IISc, Bangalore

M6L4

Optimization Methods: Dynamic Programming Applications Water Allocation

x1 4 0

x2 4 1

x3 0 1 3 2 3 4

0 1 4 2 3 4

1 1 0 0 Crop 2

1 1 0 0 Crop 3

Crop 1

The values inside the nodes show the value of possible state variables at each stage. Number of nodes for any stage corresponds to the number of discrete states possible for each stage. The values over the links show the different values taken by decision variables corresponding to the value taken by state variables. It may be noted that link values for all links are not shown in the above figure. Solution using Backward Recursion: Starting from the last stage, the suboptimization function for the 3rd crop is given as,
f 3 ( S 3 ) = max NB3 ( x3 ) with the range of S 3 from 0 to 4.
x3 0 x3 S 3

D Nagesh Kumar, IISc, Bangalore

M6L4

Optimization Methods: Dynamic Programming Applications Water Allocation

The calculations for this stage are shown in the table below. Table 2 State S3 0 1 2 3 4 x3 : 0 0 0 0 0 0 6 6 6 6 10 10 10 12 12 12 1 NB3 ( x3 ) 2 3 4 0 6 10 12 12 0 1 2 3 3,4 f 3 ( S3 )

x3

Next, by considering last two stages together, the suboptimization function is


f 2 ( S 2 ) = max[NB2 ( x2 ) + f1 ( S 2 x2 )] . This is solved for a range of S 2 values from 0 to 4.
x2 x2 S 2

The value of f 3 ( S 2 x2 ) is noted from the previous table. The calculations are shown below. Table 3 f 2 (S2 ) = State S 2 0 1

x2
0 0 1 0

NB2 ( x2 )
0 0 6.5 0 6.5 10 0 6.5 10

( S 2 x2 )
0 1 0 2 1 0 3 2 1

f 3 ( S 2 x2 ) 0 6 0 10 6 0 12 10 6

NB2 ( x2 ) + f 3 ( S 2 x2 ) 0 6 6.5 10 12.5 10 12 16.5 16

f 2 (S2 )

x2

0 6.5

0 1

1 2

12.5

0 1 2

16.5

D Nagesh Kumar, IISc, Bangalore

M6L4

Optimization Methods: Dynamic Programming Applications Water Allocation 3 10.5 0 0 10.5

Table contd. on next page 0 1 4 2 3 4 0 6.5 10 10.5 8 4 3 2 1 0 12 12 10 6 0 12 18.5 20 16.5 8 20 2

Finally, by considering all the three stages together, the sub-optimization function is f1 (Q) = max [NB1 ( x1 ) + f 2 (Q x1 )] . The value of S1 = Q = 4 . The calculations are shown in
x1 0 x1 Q

the table below. Table 4 State f1 ( S1 ) =

S1 = Q

x1
0 1

NB1 ( x1 )
0 4.5 8 10.5 12

(Q x1 )
4 3 2 1 0

f 2 (Q x1 )
20 16.5 12.5 6.5 0

NB1 ( x1 ) + f 2 (Q x1 ) 20 21 20.5 17 12

f1 ( S1 )

x1

2 3 4

21

Now, backtracking through each table to find the optimal values of decision variables, the
optimal allocation for crop 1, x1 = 1 for a S1 value of 4. This will give the value of S 2

as S 2 = S1 x1 = 3 . From Table 3, the optimal allocation for crop 2, x2 for S 2 = 3 is 1. Again, S3 = S 2 x2 = 2 . Thus, x3 * from Table 2 is 2. The maximum total net benefit from all the crops is 21. The optimal solution is given below

D Nagesh Kumar, IISc, Bangalore

M6L4

Optimization Methods: Dynamic Programming Applications Water Allocation

f = 21 x1 = 1 x2 = 1 x3 = 2 Solution using Forward Recursion: While starting to solve from the first stage and proceeding towards the final stage, the suboptimization function for the first stage is given as,
f1 ( S1 ) = max NB1 ( x1 ) . The range of values for S1 is from 0 to 4.
x1 x1 S1

Table 5

State S1 0 1

x1
0 0 1 0

NB1 ( x1 )
0 0 4.5 0 4.5 8 0 4.5 8 10.5 0 4.5 8 10.5 12

f 2 (S2 )

x1

0 4.5

0 1

1 2 0

1 2 3 0 1

10.5

2 3 4

12

D Nagesh Kumar, IISc, Bangalore

M6L4

Optimization Methods: Dynamic Programming Applications Water Allocation Now, considering the first two crops together, f 2 ( S 2 ) can be written as,

f 2 ( S 2 ) = max[NB2 ( x2 ) + f1 ( S 2 x2 )] with S 2 ranging from 0 to 4. The calculations for this


x2 x2 S 2

stage are shown below.


Table 6

f 2 (S2 ) = State S 2 0 1

x2
0 0 1 0

NB2 ( x2 )
0 0 6.5 0 6.5 10 0 6.5 10 10.5 0 6.5 10 10.5 8

( S 2 x2 )
0 1 0 2 1 0 3 2 1 0 4 3 2 1 0

f1 ( S 2 x2 )
0 4.5 0 8 4.5 0 10.5 8 4.5 0 12 10.5 8 4.5 0

NB2 ( x2 ) + f 2 ( S 2 x2 ) 0 4.5 6.5 8 11 10 10.5 14.5 14.5 10.5 12 17 18 15 8

f 2 (S2 )

x2

0 6.5

0 1

1 2 0

11

1 2 3 0 1

14.5

1,2

2 3 4

18

Now, considering the whole system i.e., crops 1, 2 and 3, f 3 ( S3 ) can be expressed as,
f 3 ( S 3 ) = max [NB3 ( x3 ) + f 2 ( S3 x3 )] with the value of S3 = 4 .
x3 x3 S 3 = Q

D Nagesh Kumar, IISc, Bangalore

M6L4

Optimization Methods: Dynamic Programming Applications Water Allocation The calculations are shown below.
Table 7

f 3 ( S3 ) = State S 3 x3 0 1 4 2 3 4 NB3 ( x3 ) 0 6 10 12 12 S3 x3 4 3 2 1 0 f 2 ( S3 x3 ) 18 14.5 11 6.5 0 NB3 ( x3 ) + f 2 ( S3 x3 ) 18 20.5 21 18.5 12 21 2

f 3 ( S3 )

x3

In order to find the optimal solution, a backtracking is done. From Table 7, the optimal value of x3 * is given as 2 for the S 3 value of 4. Therefore, S 2 = S3 x3 = 2 . Now, from Table 6,
the value of x2 = 1 . Then, S1 = S 2 x2 = 1 and from Table 5, for S1 = 1 , the value of x1 = 1 .

Thus, the optimal values determined are shown below.

f = 21 x1 = 1 x2 = 1 x3 = 2 These optimal values are same as those we got by solving using backward recursion method.

D Nagesh Kumar, IISc, Bangalore

M6L4

Вам также может понравиться