Price-Shaped Optimal Water Reflow in Prosumer Energy Cascade Hydro Plants

In the face of the recent surge in energy prices, intensified use of free renewable sources of energy (RSE) gains much importance. Unfortunately, the operation of RSE highly depends on weather conditions, which perturb the balance between the industrial and home energy dissipation patterns. This disparity induces price fluctuations or even destabilizes the energy supply system, yet can be alleviated by the installation of energy depots. While electrochemical depots are hardly cost-effective, they may be supplemented or replaced by small hydro plants with the ponds located above the plant recognized as energy reservoirs. However, inappropriate use of the plant is likely to cause floods or droughts down the river. In this paper, following a rigorous mathematical argument, a cost-optimal controller of a cascade of hydro plants is designed and its properties are formally proved. It is shown to flatten the price pattern, by reducing the load fluctuation of the legacy supply system, as well as provide a concrete revenue for prosumers.


I. INTRODUCTION
The energy demand grows day by day, including home users, industry, transportation, building cooling, heating, etc.Unfortunately, the price of electrical energy increases even faster, thwarting domestic budgets.The use of fossil fuels is more and more penalized in Europe, thus the only way to decrease operational costs is to generate energy from renewable sources (RSE), e.g., the sun, wind, waves, geothermal sources, and water flow [1].Unfortunately, RSEs are capricious in the sense that the amount of retrieved energy heavily depends on weather conditions, whereas the dissipation depends on human activities.These factors oppose each other which leads to substantial price fluctuations.In essence, an RSE generates inexpensive energy around noon and maximum demands (thus high prices) are in the evening when costly fuel-sourced plants need to be engaged.As a result, one obtains the energy price variation resembling the so-called 'duck curve', illustrated in Fig. 1 for a 2-week evolution of the Polish market in May 2023.On May 1 st the price in the evening was over 6 times higher than at noon on that day.Meanwhile, on May 8 th , this ratio was less than 2, and overall prices have been higher.
A typical business objective from the grid owner's viewpoint is to level the supply-demand disparity -to "behead the duck"' [2] -by decreasing the imbalance in the evening.The only practical way available today to achieve this goal is via energy depots.However, such systems, e.g., pumped hydroelectric storage, or chemical batteries, are expensive to install and later on to maintain.The business objective for plant owners is revenue, thus, despite the government stimulus, the energy depots are introduced infrequently.The problem can be mitigated if different kinds of power plants mutually cooperate [4].However, it is the domain of commercial plants rather than prosumer ones.Not all RCSs are susceptible to the influence of weather conditions.A good example is hydro plants [5].In Poland, there are numerous former mills, currently abandoned, that can be converted into small power plants without significant expenditures from prosumers, i.e., in the same way, the photovoltaic installations have been engaged.To increase the revenue and speed up the return on investment, instead of keeping a constant flow through generators, one may suppress the flow when energy is cheap and boost it when the price is high.Then, the water in the reservoirs located above the plant dams constitutes an energy store.Currently, in Poland, less than 5% of possible installations are used for energy production [6], thus the application area of research presented here is meaningful.
Contrary to broad and deep artificial lakes built on major rivers, the prosumer ponds are relatively small and can be filled up or drained quickly, yet the water supply from upstream reservoirs is subject to delay.To capture this effect, the dynamical model constructed in the work explicitly incorporates the information about different delays among the water flows on the links connecting the reservoirs.Using the system's dynamical representation, an optimization problem is stated and solved analytically.The optimal control law is expressed in an easy-to-implement closed form.The proposed solution brings profits not only to prosumers by increasing their economic gain, but also to the power grid operators by reducing the load changes of standard power plants.
The remaining part of the paper is organized as follows.In Section II, a discrete-time dynamic model of water flow in a multi-hydro-plant system is constructed.It explicitly takes into account different plant characteristics, e.g., capacity, and delays on the conduits linking the reservoirs.Based on the mathematical formulation of system dynamics, an optimization problem is defined and solved.The analytical solution is detailed in Section III and its properties are illustrated in a numerical example presented in Section IV. Conclusions are drawn in Section V. II.SYSTEM MODEL Usually, the modeling of hydropower plants concentrates on the optimization of the work of generators, leaving the supply system apart [7].Here, the generator is considered a black box, and the focus is placed on the hydrological aspects of the water plant operation.A key point to consider in a water reflow system is the nonnegligible time between issuing the control action at one reservoir before it influences the water level at a downstream one.Therefore, as opposed to the earlier models of storage networks, e.g., [8], in the approach advocated here, the control principles from timedelay storage systems [9,10], will be applied.However, the models proposed in [9,10] assume continuous-time control adjustment, which is difficult to realize in a water control system owing to the specifics of mechanical components steering the dam weirs.The model in this work explicitly covers the effects of finite sample time and will be constructed directly in the discrete-time domain.

A.
Single-plant system Let us consider the model of a single hydro plant illustrated in Fig. 2. The water budget dynamics at the plant will be described via the recursive relation where • sj(k) is the water volume (water level) of the reservoir near plant j, • fj(k) is the amount of water used to drive power generators installed at dam j between time instants k and k + 1, • rj(k) is the supply from external hydrological sources like rain (and its runoff), melting snow, uncontrolled tributaries, vaporization, etc.The values of rj(k) can be obtained from the weather forecast and hydrological models within the planning horizon of m periods.rj(k) is assumed known.
The tributaries supply the pond with water previously used by the plants upstream.The water from upstream plant i arrives at plant j with Tij > 0 delay.The period length ∆k, i.e., the time between instants k and k + 1, can be selected arbitrarily, but according to the pace of price changes, it is reasonable to choose 1 hour (or 15 minutes in the near future).Similarly, the planning horizon m usually covers a 24-hour window of known energy prices (the next-day market).The initial flow fj(k ≤ 0) and the initial water level sj(0) are assumed known.The terminal condition sj(m) can be selected arbitrarily.
The period income from the plant may be calculated as where • p(k) is the energy price at instant k.Usually, it reflects the duck curve, but the actual profile may be subjected to specific local demands.
• ηj is the efficiency of power generators, including the impact of the dam height.For prosumer generators in the lowlands, the flow of 1 m 3 /s corresponds to power generation of 5-7 kW.
s j (k) r j (k) s 4 (k) r 4 (k) Multi-plant system In the case of n power plants under common management (an example system with four plants illustrated in Fig. 3), it is convenient to describe the model in a vector form.Let ) denote the vector of reservoir water level, the water volume of inter-reservoir flows, and the water volume from exogenous sources, respectively.
The proposed state-state representation is given as Introducing x(k) as a controlled part of the flow, i.e., x(k) where f ref is the vector of natural flows, the system dynamics becomes 0 , where T is the maximum delay, matrix Θ0 = -I, I being the n×n identity matrix, and matrices Θ1, …, ΘT group the information about flow delays, with θij = 1, if the flow from reservoir j reaches reservoir i with delay t, and 0, otherwise.The entries on the main diagonal θii = 0. Contrary to [11], here, the distance between plants is nonnegligible.For the example from Fig. 3, the longest delay T = 3 (the flow between reservoirs 1 and 3) and 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ,,.0000 0100 1000 0010 0000 0000 The optimal values of x(k) can be obtained from numerical procedures, like [12][13][14][15][16].However, here, we present an analytical solution, based on the theory of optimal control systems.The obtained closed form is amenable to physical interpretation and can be directly and efficiently implemented in dam control systems.

A. Problem statement
With the initial water level s(0) and initial flow x(k ≤ 0), the task is to reach level s(m) within m periods so that imposed cost criteria are fulfilled.Formally, the optimization problem may be stated as x Nx (7) where N = diag{η1, η2, …, ηn} is a positive definite matrix of weighting coefficients that correspond to the efficiency of energy conversion at the plants.[]' denotes transposition.
The considered problem is difficult to treat analytically owing to the delays in water reflow.For that reason, an alternative, equivalent system description will be used.Let y(t) denote the overall system resource level, i.e., the sum of water volume accommodated in the reservoirs and the water flowing between them subjected to control x, Using a similar approach as in [17], it can be shown that the dynamics of y(t) follows

B. Solution
For the performance index in problem (7), the Hamiltonian can be defined as where λ'(t + 1) is a row vector of Lagrange multipliers.
The necessary conditions are as follows: • costate equation • stationarity condition .
Solving ( 13) for x, yields Note that since N is positive definite (a diagonal matrix with all positive entries), its inverse does exist.
Then, substituting (14) into (11), gives Equation ( 12) is a homogeneous difference equation.Its solution with the terminal condition λ(m) is ( ) Substituting ( 16) into (15), yields With the initial resource level y(0) the solution of ( 17) is The initial state y(0) and the final state y(m) are fixed, so their first derivatives are equal to zero.Using (18), the final resource level may be calculated as Hence, the terminal value of the Lagrange multiplier vector ( ) and, using Note that since ΘN -1 Θ' is symmetric and Using ( 14) and (21), the optimal control ( ) Since Θ is invertible and N -1 a diagonal matrix with non-zero entries ( ) ( ) Therefore, (22) simplifies to so the control system is noncausal.However, when m » T, then y(m) ≅ s(m), which results in the following control law

C.
System properties Looking at how the flow control signal in (26) is established, a few observations can be made: 1) The current flow value depends on the current price, yet not on the water level.Thus, prone-to-error water level measurements are not needed for control law implementation.2) Since -Θ is a positive matrix and the price is also positive, the flow control signal does not change the sign in the entire planning horizon.It either reduces the water inflow in the case of heavy rainfall and a risk of flood or magnifies the flow intensity for users to gain profit.
3) The flow intensity does not depend on the temporary rainfall intensity, but on its cumulative value 1 0 ( ) only.It improves the control system robustness to weather condition fluctuations.In fact, it is resistant to temporal changes of opposite polarity.4) With substituting (26) for x(k) in (5), one obtains 1 0 Therefore, the closed-loop system with control (26) does not lose the integrating property.For any k, one has The water level exhibits neither oscillations nor overshoots.It is confined to the interval determined by the initial s(0) and final value s(m).

IV. NUMERICAL EXAMPLE
In order to verify the analytic considerations from the previous sections, a series of tests for the topology from Fig. 3 and the price profile from May 1 st Fig. 1 has been conducted.The system is supplied with the precipitation and corresponding runoff depicted in Fig.In the considered example, one observes the accumulation of energy in the ponds.Each plant in the cascade 1-3-4 and 2-3-4 throttles the flow all the more it is located down the river, which is intuitively justified.All the propitious system properties described in Section III.C are evidenced in graphs from Fig. 5.

V. CONCLUSIONS
The paper's focus was to design an optimal control strategy to steer the system of connected hydro plants so that the power grid operators benefit from price profile flattening ("beheading the duck), and, at the same time, the plant owners gain monetary profit from their installations.In this way, the natural small rivers and reservoirs form a set of distributed, short-term energy depots deployable with low capital and operational expenditures.Additionally, the ponds, which slow down the precipitation runoff, elevate resilience to floods and droughts, whose risk grows as the climate changes.
A closed-form expression of the designed control law allows for a formal study of system properties.In particular, it has been shown that oscillations and overshoots are avoided so that the capacity constraints of reservoirs and riverbeds can be maintained.The control law is straightforward to implement and recompute for different system settings and weather conditions.No involving numerical treatment is required.

Fig.
Fig. Model of a single waterpower plant: fa(k), fb(k) -water inflow from reservoirs a and b to pond j with the current level sj(k); rj(k) -water supply from exogenous sources; fj(k) -outflow supplying the power generators.

Fig. 3 .
Fig. 3. Model of connected hydro plants.Different canal length inflicts different delay of water reflow between the plants.