## Fourth Midterm—Take Home part

Paper companies usually operate hydroelectric generating stations on bodies of water, preferably rivers. Water is piped from a dam to the power station, the rates at which the water flows through the different pipes varying depending on external conditions.

Let us design a power station with three different hydroelectric turbines, each with a known power function that gives the amount of electric power generated, as a function of the water flow arriving at the turbine. The incoming water can be apportioned in different volumes to each turbine, so the goal is to determine how to distribute water among the turbines to give the maximum total energy production for any rate of flow.

Let us denote $Q_j$ the flow through turbine $j$ in cubic feet per second; $K_j,$ the power generated by turbine $j$ in kilowatts; $Q_T,$ the total flow through the station in cubic feet per second. Using experimental evidence, the following models are determined for the power output of each turbine:

$\begin{array}{rcl} K_1 &=& \big( -18.89 + 0.1277 Q_1 - 4.08 \cdot 10^{-5} Q_1^2 \big) \big( 170 - 1.6 \cdot 10^{-6} Q_T^2 \big) \\ K_2 &=& \big( -24.51 + 0.1358 Q_2 - 4.69 \cdot 10^{-5} Q_2^2 \big) \big( 170 - 1.6 \cdot 10^{-6} Q_T^2 \big) \\ K_3 &=& \big( -27.02 +0.138 Q_3 - 3.84 \cdot 10^{-5} Q_3^2 \big) \big( 170 - 1.6 \cdot 10^{-6} Q_T^2 \big). \end{array}$

These are the allowable flows of operation:

$250 \leq Q_1 \leq 1110, \quad 250 \leq Q_2 \leq 1110, \quad 250 \leq Q_3 \leq 1225.$

Problem 1. If all three turbines are being used, we wish to determine the flow $Q_j$ to each turbine that will give the maximum total energy production. Our limitations are that the flows must sum to the total incoming flow and the given domain restrictions must be observed: Maximize the total energy production $K_1 + K_2 + K_3$ subject to the constraint $Q_1 + Q_2 + Q_3 = Q_T$ and the domain restrictions on each $Q_j.$

Problem 2. For which values of $Q_T$ is your result valid?

Problem 3. Is it possible in some situations that more power could be produced by using only one turbine? Make a graph of the three power functions, and use it to help decide if an incoming flow of 1000 ft3/s should be distributed to all three turbines, or routed to just one. If you determine that only one turbine should be used, which one would it be?

Problem 4. For some flow levels it would be advantageous to use two turbines. If the incoming flow is 1500 ft3/2, which two turbines would you recommend using? For this flow, is using two turbines more efficient than using all three?

Problem 5. If the incoming flow is 3400 ft3/s, what would you recommend to the company?

## Solution

As we discussed in class, the best way to approach the solution of the first problem is with Lagrange multipliers. Take first the function to be maximized:

$\begin{array}{rcl} f(Q_1,Q_2,Q_3,Q_T) &=& \big( -60.42 + 0.1277 Q_1 - 4.08 \cdot 10^{-5} Q_1^2 + 0.1358 Q_2 - 4.69 \cdot 10^{-5} Q_2^2 \\ && \hspace{0.25cm}+0.138 Q_3 - 3.84 \cdot 10^{-5} Q_3^2 \big) \big( 170 - 1.6 \cdot 10^{-6} Q_T^2 \big) \end{array}$

$g(Q_1,Q_2,Q_3,Q_T)=Q_1+Q_2+Q_3-Q_T.$

We need to solve the system

$\big\{ \nabla f = \lambda \nabla g, \quad g=0 \big\},$

which gives us five equations:

 (1) $\big( 0.1277-8.16\cdot 10^{-5}Q_1 \big) \big( 170 - 1.6 \cdot 10^{-6} Q_T^2 \big) = \lambda$ (2) $\big( 0.1358-9.38\cdot 10^{-5}Q_2 \big) \big( 170 - 1.6 \cdot 10^{-6} Q_T^2 \big) = \lambda$ (3) $\big( 0.138-7.68\cdot 10^{-5}Q_3 \big) \big( 170 - 1.6 \cdot 10^{-6} Q_T^2 \big) = \lambda$ (4) $3.2\cdot10^{-6}Q_T \big( -60.42 + 0.1277 Q_1 - 4.08 \cdot 10^{-5} Q_1^2 + 0.1358 Q_2 - 4.69 \cdot 10^{-5} Q_2^2 +0.138 Q_3 - 3.84 \cdot 10^{-5} Q_3^2 \big) = \lambda$ (5) $Q_1+Q_2+Q_3=Q_T$

Equations (1) and (2) allow us to write $Q_2$ in terms of $Q_1$ (rounding here and there to two decimal places):

 (6) $Q_2= 0.87 Q_1 + 83.35.$

Equations (1) and (3) allow us to write $Q_3$ in terms of $Q_1$:

 (7) $Q_3= 1.06 Q_1 + 134.11.$

Equations (5), (6) and (7) allow us to write $Q_T$ in terms of $Q_1$:

 (8) $Q_T = 2.93 Q_1+220.47$

Rewriting equations (1) and (4) in terms of $Q_1$ alone, setting them equal to each other and solving for $Q_1$ gives us all the values of $Q_1$ that maximize/minimize the energy function. There are only three solutions: two complex and one real.

$Q_1=-2300, Q_1=1300-0.25i, Q_1=3240+0.125i$

A quick check tells us that the solution we obtain with the only real value, $Q_1=-2300,$ can only offer a minimum of the energy function. Besides, the value is obviously outside of the allowed interval. That leaves us with a function that has no absolute maximum!

Note how at no point have we used the constraints on the Q’s: we do so now, since this guarantees us the existence of an actual absolute maximum in the closed set formed with the constraints. A quick check is enough to conclude that the maximum of our energy function will happen precisely when all the variables attain their maximum possible values; that is: $Q_1=1110, Q_2=1110,$ and $Q_3=1225$ (all of them in cubic feet per second) with a total flow of $Q_T=3445$ cubic feet per second. The power in this case is 33987.50 kilowatts.

On with the second part. If we decide to use only one turbine and a total flow of 1000 cubic feet per second, then we have only three possibilities:

• $Q_1=Q_T=1000, Q_2=Q_3=0$: In this case, $f=K_1=11452.884$ kilowatts.
• $Q_2=Q_T=1000, Q_1=Q_3=0$: In this case, $f=K_2=10843.276$ kilowatts.
• $Q_3=Q_T=1000, Q_1=Q_2=0$: In this case, $f=K_3=12222.472$ kilowatts.

If only one turbine is to be used, the one offering more power is the third. Let us now compare with the maximum power using the three turbines. For this task, we have another optimization by means of Lagrange multipliers, but now the functions change to simpler expressions:

$\begin{array}{rcl} f(Q_1,Q_2,Q_3) &=& 168.4 \big( -60.42 + 0.1277 Q_1 - 4.08 \cdot 10^{-5} Q_1^2 + 0.1358 Q_2 \\ && \hspace{1.25cm}- 4.69 \cdot 10^{-5} Q_2^2+0.138 Q_3 - 3.84 \cdot 10^{-5} Q_3^2 \big)\\ g(Q_1,Q_2,Q_3)&=&Q_1+Q_2+Q_3 \end{array}$

Note the absence of $Q_T$. Now our Lagrange multipliers looks like this:

 (9) $168.4 \big( 0.1277-8.16\cdot 10^{-5}Q_1 \big) = \lambda$ (10) $168.4 \big( 0.1358-9.38\cdot 10^{-5}Q_2 \big) = \lambda$ (11) $168.4 \big( 0.138-7.68\cdot 10^{-5}Q_3 \big) = \lambda$ (12) $Q_1+Q_2+Q_3=1000$

The solution of this one is much simpler, and yields $Q_1=265.83, Q_2=317.61, Q_3=416.56,$ all of them in cubic feet per second. The maximum attained is then 8397.39 kilowatts, clearly smaller than what we can obtain with any single turbine.

Problem 4 is more complicated, since we need to perform four different optimizations with Lagrange multipliers! In all four cases, $Q_T=1500:$

• $Q_3=0$: We have then $f=K_1+K_2$ and $g(Q_1,Q_2)=Q_1+Q_2.$
• $Q_2=0$: We have then $f=K_1+K_3$ and $g(Q_1,Q_3)=Q_1+Q_3.$
• $Q_1=0$: We have then $f=K_2+K_3$ and $g(Q_2,Q_3)=Q_2+Q_3.$
• $f=K_1+K2+K_3$ and $g(Q_1,Q_2,Q_3)=Q_1+Q_2+Q_3$ as before, but with constraint $g=1500.$

Note that in this case it does not make sense to restrict the flow to a single turbine, because none of them can withstand by themselves that large a quantity of cubic feet per second.

Problem 5, it is a bit easier, since the constraint $Q_T=3400$ clearly indicates that the three turbines must be used simultaneously (note how one or two turbines together could never reach this flow). It is just a matter of finding the maximum with the same technique.