PowNet: A Network-Constrained Unit Commitment/Economic Dispatch Model for Large-Scale Power Systems Analysis

PowNet is a free modelling tool for simulating the Unit Commitment/Economic Dispatch of large-scale power systems. PowNet is specifically conceived for systems characterized by the presence of variable renewable resources (e.g., hydropower, solar, and wind), whose penetration on the grid is strongly influenced by climatic variability and constrained by the availability of transmission capacity. To help users effectively capture the nuances of power system dynamics, PowNet is equipped with features that enable accuracy, transferability, and computational efficiency over large spatial and temporal domains. Specifically, the model (i) accounts for the techno-economic constraints of both generating units and transmission networks, (ii) can be easily coupled with models that estimate the status of generating units as a function of the climatic conditions, and (iii) explicitly includes import/export nodes, which are useful in representing cross-border systems. PowNet is implemented in Python and is compatible with any standard optimization solver (e.g., Gurobi, CPLEX). Its functionality is demonstrated on the Cambodian power system.


Introduction
Fuelled by economic expansion and population growth, electricity demand is rapidly increasing in many parts of the world. At the same time, several countries are cutting carbon dioxide emissions by enhancing their reliance on variable renewable resources (e.g., hydro, wind and solar) in addition to fuel switching (coal to gas) [1]. Yet, itermittency in electricity supply from variable resources over multiple temporal scales-from hourly to seasonal and inter-annual-is increasing the need for flexible power grids, as well as the sources of uncertainty that must be accounted for in long term planning [2,3]. These challenges have prompted the development of several modelling tools for energy and electricity systems; see [4] for a comprehensive review. Broadly speaking, existing models have been used for two main tasks: (1) long-term planning (e.g., capacity expansion, investment optimization); and (2) short-term management (e.g., power flow analysis, unit commitment). Hereafter, we refer to these two groups as energy and power systems analysis models, respectively [5].
Increasingly, there is a need for modelling tools that can perform 'traditional' tasks in the energy and power domains, such as investment optimization and grid analysis, while also facilitating interdisciplinary research across multiple engineering domains. For example, models are now being used in studies of the "water-energy nexus", aiming to characterize the interdependencies between these two critical sectors and introduce planning and management solutions that improve performance and/or balance tradeoffs across coupled systems [6]. The strategic importance of energy and power models that can be used to address this class of problem is thus likely to increase in the near future, especially as climatic changes are expected to transform both supply of and demand for electricity [7,8,9].
A subset of power systems models are referred to as Unit Commitment/Economic Dispatch (UC/ED). In these models, optimization is used to schedule the operations of power generating units. More precisely, UC determines when and which generating units to start-up and shutdown, while ED establishes the amount of power supplied by each unit [10]. The correct simulation of the UC/ED decision-making process is indeed a critical step if one seeks to understand the effects of hydroclimatic variability on the electricity supplies of hydro, solar, and wind power plants, and, in turn, on the performance of power systems. Previous research efforts in this area has relied almost exclusively on power systems models that account for the techno-economic constraints of the generating units, but often adopt simplified representations of the transmission networks (see Table 1). This assumption may lead to a misrepresentation of power systems' performance [11,12]. To explicitly account for electricity transmission in a UC/ED exercise, one can only rely on a handful of models, namely PSAT [13], PyPSA [5], and PLEXOS [14]. Yet, the latter is a proprietary software product, and thereby not freely available to researchers.
In this paper, we contribute to this growing field by introducing PowNet, a UC/ED modelling tool specifically designed for studying large-scale systems characterized by the presence of variable renewable resources. PowNet builds on the UC/ED model first presented by [21], and complements it with a comprehensive representation of the high-voltage transmission lines. PowNet has several desirable features. First, it bases the power flow calculation on a Direct Current (DC) network; this choice strikes a reasonable balance between modelling accuracy, data availability, and computational requirements. This is particularly important for model simulations carried out over extensive spatial and temporal domains. Moreover, it should be noted that the errors introduced by DC flow approximation of AC systems is generally negligible, except for high load periods with increased reactive power flow [26,27]. To address the effects of these periods in the model, PowNet incorporates an N-1 criterion, which leaves part of the transmission lines' capacity unused, allowing for any hypothetical reactive power flows [27,28]. Second, PowNet accounts for the potential effects of hydroclimatic variability on system dynamics in the UC/ED model. Users can soft link PowNet with any model able to process hydroclimatic data and provide information on the status of renewable and non-renewable resources. Third, PowNet explicitly models export/import nodes as substations and generators, which are key components of crossborder interconnections. Fourth, PowNet is fully written in Python, a programming language that should enhance its dissemination and transferability to other systems of interest.
The next section describes the mathematical formulation of PowNet, while its Python implementation and architecture are described in Section 3. Section 4 discusses quality control and presents a sample implementation for the Cambodian power system. Concluding remarks are outlined in Section 5.

Functionality
In PowNet, a power system is represented by a set of nodes (n ∈ N) that include power plants and high-voltage substations. Given a pre-defined planning horizon (e.g., 24 hours), the model (1) schedules the (' on/off') operating status of the dispatchable power plant units (e.g., coal, gas, oil, and biomass), and (2) determines the hourly dispatch of electricity from the committed dispatchable units and variable renewable resources (e.g., hydro, solar, wind) in a manner that meets the system's demand at a minimum cost. As illustrated in Figure 1, the electricity available from variable renewable resources is a model input that can be obtained from existing data or simulated by a separate model (e.g., a hydrological-hydraulic model that estimates available hydropower). PowNet can also include import substations as dispatchable units. The scheduling and dispatch of hourly electricity is constrained by the design features of the power plants as well as the capacity and susceptance of the transmission lines. The UC/ED formulation is structured as a Mixed Integer Linear Program (MILP), whose objective function, decision variables, and constraints are described next (the notation used in the following sections is summarized in Table 2).

Objective function and decision variables
The mathematical objective of the UC/ED function in PowNet is to meet hourly electricity demand at each node (substation) while minimizing production costs over a user defined operating horizon, e.g. 24 hours (t ∈ T). The production costs of the dispatchable units (g ∈ G) depend on their fixed operation and maintenance (O&M) costs (FixedCost g ), start-up costs (StartCost g ), variable costs from fuel consumption (a product of a plant's heat rate (HeatRate g ) and fuel price (FuelPrice g )), and variable O&M costs (VarCost g ). The shut-down costs of the units are generally negligible when compared to the other costs [29], and are thus not considered in our model. The cost of imported electricity Table 1: A list of power/energy systems modelling tools, including PowNet. These tools are categorized based on their operational coverage and representation of the transmission networks. The tools under the first group are generally suitable for short-term grid operations; they do not consider the unit commitment problem. Commercial software is indicated in italic.

Parameters of the import nodes (i)
MaxCap i maximum allowable import (MW) depends on the import price (ImportPrice i ), which is prespecified for each import source (i ∈ I). The production costs of the rn-th variable renewable resource (rn ∈ RN) depend on the unit production cost (UnitCost rn ), which is typically smaller than the one of the dispatchable unit [21]. The objective function is thus formulated as follows: where ON g,t and Switch g,t are two decision variables describing the operational status (i.e., on/off, and whether a unit is started-up or shut-down) of the g-th dispatchable unit at hour t. Elec g,t , Elec i,t , and Elec rn,t denote the hourly electricity production of the g-th dispatchable unit, i-th import source, and rn-th variable renewable resource, respectively. At each hour t, PowNet optimizes a few additional decision variables, namely, the voltage angle VoltAngle n,t at each node n of the network (needed to estimate power flows through each transmission line), and the provision of spinning and non-spinning reserves SpinRes g,t and NonSpinRes g,t .

Constraints
The scheduling of hourly electricity production at each power plant is subject to multiple constraints, which collectively account for the technical specifications of generating units (i.e., capacity, minimum up/down time, ramping limit), energy balance at each node (approximation of Kirchoff's Current Law), capacity and susceptance of the transmission lines, transmission line losses and N-1 criterion, and minimum requirements of spinning and non-spinning reserves.

Logical constraints
Similar to [21], we adopt a set of logical constraints to bind the operational status of the various power plant units. First, we introduce a constraint (equation (2)) on the operational status of the dispatchable units, which uses the on/off status of a generator in consecutive hours to determine the value of the Switch variable (i.e., whether a plant is started in hour t): , , The binary variable ON g,t determines whether the g-th dispatchable unit is on-or off-line in hour t, while Switch g,t indicates whether an off-line unit must be started up.
The operational status of each unit is also constrained by the minimum up and down times (MinUpTime g and MinDownTime g ) as follows: , Over a planning horizon T, equations (3) and (4) thus force PowNet to account for the minimum number of hours necessary to start the g-th unit up (or to shut it down) at hour j.

Ramping limits
After a plant has been started, its ability to ramp (increase or decrease) power production on an hour-to-hour basis is constrained by pre-specified limits. Ramping limits on the g-th unit (Ramp g ) are constrained by equations (5) and (6): , 1 , In other words, equations (5) and (6) ensure that the increase or decrease of the power generation during

Parameters of the transmission network
LineSus n,k susceptance (Siemens) of the transmission line between nodes n and k LineCap n,k capacity (MW) of the transmission line between nodes n and k

Input time series (hourly)
RenewAvail rn,t available electricity (MWh) from the rn-th renewable resource Demand n,t electricity demand (MWh) (or export) at any node n Decision variables (at each hour t) Switch g,t binary (0,1) variable indicating if unit g must be started-up (Switch g,t =1 only when ON g,t-1 = 0 is followed by ON g,t = 1) Elec g*,t electricity (MWh) generated by dispatchable unit g (*or any other powerplant) VoltAngle n,t voltage angle (radian) at any node n SpinRes g,t spinning reserve (MWh) at unit g NonSpinRes g,t non-spinning reserve (MWh) at unit g two consecutive hours (Elec g,t and Elec g,t-1 ) is below the ramping limit (Ramp g ) of the g-th unit.
Capacity constraints Equation (7) accounts for the minimum and maximum capacity of the generating units. In particular, equation (7) indicates that the hourly electricity production Elec g,t from the g-th dispatchable unit is bounded by its minimum and maximum capacity (MinCap g and MaxCap g ): The term DerateF g,t is used to account for the impact of droughts on freshwater-dependent dispatchable unitsduring a prolonged dry spell, for example, a thermo-power unit may not be able to run at full capacity because of its limited cooling capability. The default value of DerateF g,t is one, but it can be modified to a smaller value if water availability becomes a limiting factor. Note that the values of DerateF g,t must be supplied by the user; a variety of methods can be used to calculate these values [30,31]. Similarly, the hourly electricity import Elec i,t from the i-th import source is constrained by the maximum allowable import (MaxCap i ), as indicated by equation (8): Finally, the amount of electricity Elec rn,t dispatched from the rn-th renewable resource (e.g., hydro, wind, and solar) is bounded by its availability (RenewAvail rn,t ): , , 0 ; , .
rn t rn t rn t Elec RenewAvail The value of RenewAvail rn,t is generally modelled through the use of hydroclimatic data. For example, the available hydro-electricity can be estimated by feeding a hydrologicalhydraulic model with rainfall and air temperature data [32]. Similarly, the electricity available at wind and solar power plants can be simulated by harnessing data on wind speed [33] and solar radiation [34].

Energy balance
Equation (10) applies the energy balance at each node n connected to any other node k of the power system [10]. The left-hand side of equation (10) accounts for (1) the electricity inputs (Elec n,t ) from the available power plants and/or import-sources connected to n, and (2) the electricity used to meet domestic demand or export (Demand n,t or Export n,t ) at the node. The right-hand side indicates that the electricity transferred (in or out) between n and k is proportional to the difference of the voltage angles at these nodes (VoltAngle n,t and VoltAngle k,t ), where the susceptance of the transmission line (LineSus n,k ) is the proportionality constant [35]. Note that the voltage angles are decision variables that are optimized by PowNet for each node and hour. The voltage angle at an arbitrary reference node (usually, the node with highest demand) is set to zero, while the voltage angle at any other node can be positive or negative [10]. The parameter TransLoss is used to discount the energy production, or import, by a given percentage, so as to account for the transmission losses (similar to [36]). Equation (10) is formulated as: The hourly demand (and export) time series at the substations are direct inputs to the model. These data can be obtained from observed records (see Section 4.1) or modelled as a function of relevant factors, such as population and temperature [3].

Transmission capacity constraints
With equation (11), known as the N-1 criterion, PowNet limits the electricity transfer between any node-pair (n and k) below a certain percentage (N1Criterion) of the line-capacity (LineCap n,k ), thereby leaving the remaining fraction as a safety margin: ; , , .
A common value for the parameter N1Criterion is 75% (c.f., [28]). As illustrated in Appendix A, the parameters LineCap n,k and LineSus n,k are estimated from design specifications of the transmission lines (e.g., size and length, voltage level, number of circuits and conductors, and capacity per circuit), which can be easily obtained from technical reports.

Electricity reserve
The last two equations ensure that (1) the hourly electri city reserve is larger than a predefined percentage of the system's demand at time t (e.g., ResMargin = 15%, [36]), and (2) the minimum spinning reserve is a predefined percentage of the total reserve (e.g., SpinMargin = 50%, [ Two additional constraints are used to ensure that spinning and non-spinning reserves are served by on-line and off-line generators, respectively. Furthermore, users can allocate all or some specific generators (e.g., oil-fired units) for the minimum reserve requirements.

Implementation and architecture
PowNet is implemented in three Python scripts, namely 'PowNetModel.py', 'PowNetDataSetup.py', and 'PowNet-Solver.ipynb'. 'PowNetModel.py' contains the main model structure, with the objective function and constraints described in Section 2. The model structure is based on the Pyomo optimization package [37]. 'PowNetDataSetup. py' prepares the data required to execute the model. Specifically, it outlines the input data into several .csv files that are read as DataFrame objects. Then, the script generates a .dat file in which all data are specified in a format that is executable by Pyomo. Finally, 'PowNetSolver. ipynb' executes the model and solves the optimization problem using a standard solver, such as Gurobi or CPLEX. The script also generates .csv files containing the value of each decision variable.
PowNet input data are categorized as: (i) parameters of the dispatchable units, (ii) parameters of the transmission lines, (iii) hourly time series of electricity demand at the substations, and (iv) hourly time series of electricity available from variable renewable resources. The techno-economic parameters of the dispatchable units are provided in a .csv file that also includes identification data, such as the name and type of each unit and the node to which they belong. The type of unit depends on fuel and turbine (e.g., ' coal_ st' stands for a coal-fired unit with steam turbine). The techno-economic parameters are considered constant over the simulation period. In addition, the .csv file contains the value of the derating factor (see Section 2.2). The data concerning the parameters of the transmission lines (i.e., susceptance and capacity), hourly electricity demand, and electricity available from renewable resources are provided in separate .csv files. The data regarding the length of the simulation period, planning horizon, transmission loss, N-1 criterion, and hourly reserve margins are provided directly by the user in the script 'PowNetDataSetup.py'.

Quality control
Thus far, PowNet has been tested on the Laotian and Thai power systems [38,39,40]. In both cases, the model output was validated against observed statistics, such as the seasonal or annual generation mix. Here, we present an implementation of PowNet for the Cambodian power system. The data and code used for this demonstration are available in GitHub along with step-by-step instructions on how to customize them. The next section presents an overview of the model setup, followed by an evaluation of its performance.

Setup
Our implementation is based on the infrastructure built and operated in 2016. The system consists of 30 nodesincluding power plants and substations-connected by high-voltage transmission lines (Figure 2) [41]. The   [29,41,42]. (Further details about the estimation of the transmission parameters are given in Appendix A.) We also added a hypothetical 'slack' generator to the substation with the highest demand. Its role is to account for the shortage of electricity generation in the system by dispatching electricity as needed to prevent a shortfall (program crash), but with a very high production cost [21]. Thus, the 'slack' generator was arbitrarily assigned large values of capacity, ramping limits, and cost parameters, and small values of up/down time.
We also extracted data on monthly peak electricity demand by province from [41]. Then, the province peak demand data were disaggregated to substations based on their voltage-levels. For the disaggregation of monthly data to hourly resolution we used a week-daily and a clockhourly demand profile to incorporate the variability of demand over days in a week and hours in a day, respectively. The time series of available hydropower was simulated by a conceptual hydrologic model (see Appendix B).
The model was run with a 24 hour planning horizon, a threshold for the N-1 criterion equal to 75% of the line's capacity, and a reserve margin equivalent to 15% of the system's demand. The model was calibrated against the 2016 (observed) annual generation mix by tuning the fuel price value in Equation (1). Specifically, we used the price of imported electricity from Vietnam and Thailand [41] and slightly adjusted the price of coal and oil, so that the model could reproduce the 2016 annual generation mix with an error of about 5%. For each day (24 hours) of simulation, PowNet optimizes around 2,600 variables (continuous and binary). The model was tested with two solvers (Gurobi and CPLEX) on an Intel(R) Core(TM) i7-8700 CPU @ 3.20 GHz with 8 GB RAM running Microsoft Windows 10. They both yield the same output, with slightly different computational requirements-~3.5 and ~3 .0 seconds per day of simulation, respectively. Further tests on a Linux operating system show similar performance.

Performance
The simulation for the year of 2016 provides the following hourly time series: (1) operational status of dispatchable units, (2) generation provided by dispatchable units and variable renewable resources, (3) voltage angles at each node, and (4) spinning and non-spinning reserves. These variables collectively represent information useful in the planning, operation, and management of power systems. For example, detailed information on plants' operational statuses can support the unit commitment and economic dispatch over the planning horizon, while statistics on the generation mix provide an overview of the system's dependance on the various energy sources. These concepts are further exemplified in Figure 3, which illustrates the energy generation mix. Here, we can notice the 'signature' of wet and dry seasons: during the monsoon (May to November), the system heavily relies on hydropower production, while during the pre-and post-monsoon months system-wide electricity generation is largely sourced from coal-fired power plants and imports. The use of these two resources is not only controlled by economic factors-coal is cheaper than imported electricity-but also by the several techno-economic constraints described in Section 2.2. For example, there are a few days in August in which the concomitance of limited load and high fixed and start-up costs make imported electricity preferable over coal. The above analyses could be readily extended to longer simulation periods or multiple demand patterns, so as to explore the effect of different drivers on the performance of the power system (e.g., [3,30]).
Apart from the detailed representation of the aforementioned variables, another feature of PowNet is the explicit representation of the hourly transmission of electricity through the lines (estimated from the voltage angle at each node). This information is synthesized in Figure 4, which depicts the annual average usage of each line. Results indicate that line usage is limited, with only a few lines showing values larger than 40% of their capacity. Unsurprisingly, these lines connect the coal plants in the Southwestern coast and import station from Vietnam to the capital (Phnom Penh), namely the area with the highest load. The radar chart indicates that the average usage of these lines is higher during the dry months, when the system heavily relies on the coal units due to the low hydropower availability. Despite the limited average usage, the maximum usage of the lines during wet months is high (~70%), mainly because of the peak-hour supply from the import station. Note that the transmission of electricity through the lines can also be used to calculate the number of N-1 violations (not observed in this example), a proxy of the network's stress conditions. To further demonstrate the importance of a detailed representation of the high-voltage transmission lines, we run PowNet using a slightly altered network. In the ' altered' network, we assume that the capacity of the two lines transferring electricity from the Southwestern coast and Vietnam to the capital (see Figure 4) is halved-these are double circuit transmission lines, so such scenario represents an instance in which one of the two circuits fails to operate. (All other parameters and input variables remain unchanged.) Figure 5 compares the system's performance obtained with the ' existing' and ' altered' transmission networks. Looking at the generation mix (left panel), we note that the model with altered network dispatches less electricity from coal plants and Vietnam's import station. That is because the two lines with reduced capacity are frequently stressed (about 18% of the time), so they do not allow the coal plants and import station to run at their full capacity. The reduced dispatch from the coal plants and Vietnam's import station is partially offset by higher production from the oil-fired units and Thai import station (we also observe a shortage of electricity supply of about 25 GWh). In turn, such higher reliance on oil affects operating costs and CO 2 emissions. The former are estimated from the hourly operating status and production of the generating units (simulated by PowNet), as well as the economic parameters and fuel prices. The latter are calculated by applying the rates of 1.04 tonne/MWh and 0.73 tonne/MWh to the production time series of the coal and oil units [43]. Overall, these results indicate that the altered functioning of just a few lines can influence the behaviour of an entire power system. Capturing such dynamics is therefore paramount to supporting effectively the operations and planning of large-scale energy systems.

Limitations and suggested future work
In the current version of PowNet, information about the amount of electricity available from hydropower reservoirs must be retrieved from a separate model, such as a hydrological-hydraulic model (e.g., VIC-ResOpt [44]). In these models, release decisions from dams-and, therefore, hydropower availability-are determined by bespoke operating rules that optimize long-term energy production. Such rules generally depend on water availability and environmental constraints, but do not consider external, yet potentially important, factors, such as the cost of coal and gas or the status of other generating units. Our future work will focus on coupling hydrologic-hydraulic models and PowNet, so as to condition dam operations on the entire state of the power system. This is also important for systems characterized by the presence of other renewables: for example, release from hydropower reservoirs could be informed by the real-time dispatch of wind and solar power.

Conclusions
PowNet is a least-cost optimization model for simulating the operations of national and regional power systems. The model formulates grid operations as a UC/ED, which accounts for the techno-economic constraints of generating units and DC transmission network, thereby providing functionalities for both grid and economic analyses. In particular, PowNet was conceived for studying large-scale systems characterized by the presence of variable renewable resources, and can easily incorporate information on the effect of hydroclimate variability on renewable and non-renewable resources. The data requirements for the DC transmission network are limited, thereby making PowNet applicable to data-scarce regions, particularly developing countries.

Operating system
Windows 10, Linux, and any other operating systems running Python and a standard solver (e.g., Gurobi, CPLEX).

Programming language
Python 3.5

Additional system requirements
None.

Dependencies
PowNet is written in Python 3.5. The following Python packages are required for PowNet: (i) Pyomo, (ii) NumPy, (iii) Pandas, and (iv) Matplotlib (optional for plotting). The Jupyter Notebook (freely available as part of Anaconda Python with the aforementioned packages) is required to run the script 'PowNetSolver.ipynb', which also requires an optimization solver (e.g., Gurobi, CPLEX).

(3) Reuse potential
PowNet is available on GitHub with step-by-step instructions on how to formulate and implement the model of a given power system. While the data and scripts demonstrate its use for the Cambodian power system, the user can easily build a new model or customize an existing one by modifying (or adding) dispatchable generators, renewable resources, substations, and transmission lines. The GitHub repository also includes a few additional scripts that help users perform some standard analyses on PowNet's output. Note that Pyomo is free, and that academic users can obtain a free license of state-of-the-art standard solvers (e.g., Gurobi, CPLEX) to solve the model. We also note that PowNet has been tested on Windows and Linux operating systems. Overall, the availability of a dedicated repository, instructions, and extensive examples should make PowNet easy and straightforward to reuse.

A. Estimation of transmission parameters
PowNet uses two parameters for each transmission line, namely susceptance (LineSus) and capacity (LineCap). For each transmission line, LineCap is estimated as the product between the capacity per circuit and number of circuits in the line. LineSus is estimated as the reciprocal of line reactance X, which is calculated as follows [35]: where, f and L are the line frequency (Hz) and length (km), D m the geometric mean distance between phases, and GMR the geometric mean radius of line per phase.
Assuming that the lines are in a three-phase system with symmetrically arranged conductors, the geometric mean distance D m can be considered equal to the centre-tocentre distance D (m) between any two conductors [10]. D is calculated as a function of the voltage level (kV), as recommended by [45,46] where, r j is the radius of any conductor j, and d c,j is the centre-to-centre distance between j and each of the other conductors of a phase of C conductors. For the Cambodian power system, we obtained data on voltage level (kV), number of circuits, line length (km), size (mm 2 ) and number of conductors, and capacity (MW) per circuit from [41,47]. Table B1 shows the design specifications of the Cambodian hydropower reservoirs (collected from [48,49]). To calculate the hydropower available in each dam, we adopted the following procedure. First, we estimated the inflow to the reservoirs (Q t ) through the use of the rational method, that is:

B. Simulation of hydropower availability
where c is a runoff coefficient, I t the rainfall intensity (mm/day), and A the drainage area of each dam (km 2 ). The runoff coefficient was estimated as a function of the soil type and slope of the drainage basins, while the rainfall intensity was extracted from the APHRODITE gridded rainfall dataset. Then, we calculated the mass balance of each reservoir, namely: where S t , Q t , and R t represent the water storage, inflow, and release at time t. S cap is the capacity of the reservoir. To calculate the release R t , we adopted rule curves balancing hydropower production [50] and environmental flows [51]. Finally, we used the hydropower equation to estimate the power available at each hydropower plant: where hydropower t is the available hydropower (MW), η a non-dimensional turbine efficiency term, ρ the water density (1,000 kg/m 3 ), g the gravitational acceleration (9.81 m/s 2 ), and H t the hydraulic head at time t (calculated from the storage S t ). The daily time series of available hydropower was transformed into an hourly time series by assuming equal water availability throughout a single day.