Background

Scheduling reservoir water releases is tricky, because if you release too much then if no precipitation comes the reservoir will run dry, and if you hold too much then it won’t hold back storm surges (flood control). This problem considers the perfect-knowledge optimization of reservoir releases in order to identify the maximum firm yield amount that can be counted on each year.

Input Data

A two-season inflows table (note that flood season flows are lower than irrigation season flows because this data is from a high elevation where most precipitation is snow-pack):

Table 1. Inflows
WaterYear Flood Irrigation
1913 72.60000 233.60000
1914 170.90000 591.40000
1915 118.40000 406.10000
1916 288.50000 878.70000
1917 169.10000 499.80000
1918 101.70000 343.30000
1919 120.00000 326.90000
1920 92.50000 393.70000
1921 119.70000 322.00000
1922 108.60000 574.10000
1923 116.60000 316.60000
1924 68.90000 93.70000
1925 85.70000 312.10000
1926 77.50000 221.60000
1927 149.50000 466.50000
1928 108.50000 194.20000
1929 71.40000 215.70000
1930 73.90000 225.10000
1931 62.00000 114.60000
1932 112.40000 472.80000
1933 89.40000 301.10000
1934 89.70000 130.10000
1935 78.70000 342.50000
1936 122.30000 511.90000
1937 179.50000 679.00000
1938 195.60000 819.10000
1939 133.90000 254.20000
1940 149.80000 458.70000
1941 161.40000 784.80000
1942 156.30000 462.20000
1943 233.90000 568.60000
1944 113.40000 330.10000
1945 128.50000 537.10000
1946 179.40000 348.70000
1947 121.90000 233.60000
1948 67.10000 234.50000
1949 57.50000 214.20000
1950 92.70000 298.50000
1951 204.60000 260.00000
1952 139.10000 894.90000
1953 149.80000 306.60000
1954 109.10000 336.30000
1955 92.80000 238.40000
1956 239.10000 526.80000
1957 102.20000 285.10000
1958 116.40000 694.30000
1959 106.40000 139.50000
1960 75.70000 170.60000
1961 60.00000 105.30000
1962 90.40000 459.20000
1963 159.30000 469.30000
1964 101.20000 172.70000
1965 140.10000 434.70000
1966 116.20000 218.80000
1967 324.70000 883.60000
1968 154.50000 233.70000
1969 254.50000 1322.30000
1970 174.90000 316.70000
1971 114.70000 244.80000
1972 93.80000 141.20000
1973 103.70000 636.60000
1974 150.00000 488.20000
1975 104.90000 357.60000
1976 80.00000 129.00000
1977 67.20000 103.70000
1978 184.10000 953.90000
1979 158.00000 378.80000
1980 302.70000 852.40000
1981 127.40000 239.50000
1982 144.50000 743.90000
1983 365.00000 1273.90000
1984 268.20000 408.30000
1985 145.40000 381.40000
1986 288.10000 806.10000
1987 123.30000 208.80000
1988 93.70000 169.50000
1989 108.40000 230.10000
1990 69.30000 120.20000
1991 77.90000 282.80000
1992 80.10000 176.90000
1993 158.10000 562.50000
1994 89.90000 189.20000
1995 167.90000 796.10000
1996 254.84489 527.01052
1997 499.15263 546.19684
1998 296.83843 1018.57166
1999 174.78533 236.55260
2000 114.60458 285.02829
2001 89.61137 232.62507
2002 107.64183 201.58210
2003 186.83664 312.72942
2004 134.31974 212.17436
2005 218.25514 728.45998
2006 194.95353 870.46940
2007 114.47883 125.03148
2008 127.85309 309.11540
2009 117.37280 279.38677
2010 150.64137 539.88179
2011 377.52502 891.34387
2012 159.87278 173.95504
2013 85.81821 105.28187
2014 56.17743 98.28294
2015 55.15593 57.62958

A seasonal information table with columns:

Table 2. Seasonal Information
Season Dist EndCap Evap PumpCoef PumpExp StartMo DurationMo CalendarYrOffset
Flood 0.1 550 8 3 1.2 10 7 0
Irrigation 0.9 250 26 10 1.5 5 5 1
Figure 1. Per-Season Inflows

Figure 1. Per-Season Inflows

Solution

We can pre-compute cumulative sums to fill in the equations:

If we were to solve the first four seasons, the equations would look like:

\[\begin{array}{ccccccccccl} w_1 & + & & & & + & & + & \mathit{CumDist}_1 \cdot q & \leq & \mathit{CumStgMax}_1 \\ w_1 & + & w_2 & + & & + & & + & \mathit{CumDist}_2 \cdot q & \leq & \mathit{CumStgMax}_2 \\ w_1 & + & w_2 & + & w_3 & + & & + & \mathit{CumDist}_3 \cdot q & \leq & \mathit{CumStgMax}_3 \\ w_1 & + & w_2 & + & w_3 & + & w_4 & + & \mathit{CumDist}_4 \cdot q & \leq & \mathit{CumStgMax}_4 \\ w_1 & + & & & & + & & + & \mathit{CumDist}_1 \cdot q & \geq & \mathit{CumStgMin}_1 \\ w_1 & + & w_2 & + & & + & & + & \mathit{CumDist}_2 \cdot q & \geq & \mathit{CumStgMin}_2 \\ w_1 & + & w_2 & + & w_3 & + & & + & \mathit{CumDist}_3 \cdot q & \geq & \mathit{CumStgMin}_3 \\ w_1 & + & w_2 & + & w_3 & + & w_4 & + & \mathit{CumDist}_4 \cdot q & \geq & \mathit{CumStgMin}_4 \\ w_1 & + & w_2 & + & w_3 & + & w_4 & + & \mathit{CumDist}_4 \cdot q & \geq & \mathit{CumInflow}_4 \end{array}\]

where the first four equations capture the constraint that the amount of water that can be in the reservoir at the end of interval \(k\) must be less than \(c_k\), the next four capture the fact that the minimum amount of water that can be in the reservoir at the end of interval \(k\) cannot be less than zero, and the last equation captures the fact that the total amount of inflows over the analysis period cannot be more than the total outflows over the analysis period.

The actual problem has 413 equations and 207 variables. The equations are typically represented as a matrix of left-hand-side coefficients and a vector of inequality limits on the right-hand side. The linear programming functions help build the large matrix programmatically, and the solve function handles the heavy lifting of finding a solution.

Figure 3 shows how the data flows through the R file to be presented in this file.

Figure 3. Data flow diagram of analysis

Firm yield

The firm yield is 202.1153209 TAF, solved by linear programming.

Figure 4. Cumulative Inflow and Outflow

Figure 4. Cumulative Inflow and Outflow

Storage is drained at the end of the dry season in 2015.

Figure 5. Storage at Season End

Figure 5. Storage at Season End

Spilling by the end of the irrigation season in order to prepare for flood control is quite common.

Figure 6. Spills

Figure 6. Spills