# Discharge Discharge paths go from a hydraulic node (Reservoir, Junction) to another (including the sea). Discharge paths represent water flows that pass through a power plant in order to produce power, and is therefore associated with a power plant. While the efficiency of each power plant depends on the flow of water in a continuous manner the relation is simplified by using a piece-wise linear curve. Each of these linear segments are represented with a variable, whose sum is the total discharge through the plant. In the optimized module, the discharge segments are used directly. $$ \\{i \in reservoirs,\ k \in \\{0, 1, ..., timesteps - 1\\}\\}$$ $$ \textrm{RESBAL}(i,k): \textit{Volume}(i,k) - \textit{Volume}(i,k-1) = \textit{Inflow}(i,k) - \sum_{n = 0}^{segments} dis_{seg}(i,k,n) - \textit{Outflow}(i,k)$$ The segments are sorted by descending efficiency, ensuring that the first segment is used first. This is apparent in the power balance: $$ \\{a \in areas,i \in hydro\ plants\ in\ area,\ k \in \\{0, 1, ..., timesteps - 1\\}\\}$$ $$ \textrm{POWBAL}(a,k): \textit{Production}(a,k) + \sum_{i}^{plants} \sum_{n = 0}^{segments} \textrm{Efficiency}\_{seg}(i,n)*dis_{seg}(i,k,n) = \textrm{Load}(a,k)$$