## 2 Materials and Methods
### Strategic Energy Management Optimization
#### 2.1.1 EMTv1 Model  
This study defined the hybrid module's generation capacity and identified demand profiles that best matched its output. Two scenarios were evaluated to determine optimal system operation [29]. The focus of this model was on analyzing the operating limits of a single module. In this model, key assumptions included a tank starting at 50% capacity and a 60% efficiency factor to account for energy losses. A basic energy management approach was tested, where generation and demand operated independently without any interaction. This method prioritized selling all the energy produced by the hybrid module to the grid, with the selected demands being entirely met by the electricity grid. The primary advantage of this model is the benefit of selling all the energy generated to the grid, as this offset a significant portion of energy-related charges. This distinction is critical because power charges are typically fixed and determined by a contractual agreement, regardless of energy consumption (Figure 2a). Figure 1: Strategic energy management methodology. Figure 2: EMT model with flow distribution for the on-grid without self-consumption (**a**) and on-grid with self-consumption (**b**). In a grid-connected generation system designed to meet load demand, energy allocation becomes more complex. A priority framework is essential to coordinate generation and consumption, with the key objective being utilizing all available energy to cover as much demand as possible. If solar PV, wind, or tidal energy is being generated, it is prioritized for real-time consumption. Unlike the previous case, the PAT system plays a crucial role as energy storage, supplying power when generation is insufficient. Excess energy is primarily used for self-consumption, with the surplus directed towards pumping water into storage tanks for future use. Since the project's initial design lacked a defined tank capacity, an optimized volume was determined to maximize benefits (Figure 2b). For higher consumption levels, larger water reserves are required to ensure optimal performance. It should be noted that the PAT system is always used to cover demand and never injects energy into the grid. The only scenario when energy can be sold is when there is a surplus and, at the same time, the storage tank is full. The key to an effective operation lies in achieving an optimal balance: sizing the storage system to be sufficiently large to support generation technologies, while avoiding unnecessary oversizing which could compromise economic and operational efficiency. To determine the optimal tank capacity maximizing system performance, the Solver optimization tool can be utilized, specifically employing its evolutionary mode. The optimization process begins with the definition of the objective variable to be maximized or minimized. In this case, the selected parameter was energy savings, calculated as the sum of the revenue from energy sales and the cost reduction achieved through self-consumption during a year. These components are defined by Equations (1) to (3). \[\%Cov_{Demand}=\frac{\text{\it{Covered demand}}}{\text{\it{Total demand}}}\cdot 100 \tag{1}\]  
\[E_{\text{\it{revenues}}}=\sum_{h=1}^{8760}\Delta t_{h}\cdot P_{h} \tag{2}\]  
\[V=\frac{E}{\textit{\it{S}}\cdot\textit{\it{P}}_{\textit{\it{water}}}\cdot H} \tag{3}\]  
where \(\%Cov\)_Demand_ is the percentage of demand met by the hybrid module, \(E_{\text{\it{revenues}}}\) corresponds to energy savings (kWh), \(\Delta t\) is the time step (h), \(P\) is the installed power (kW), and the calculation of the storage water volume, depending on the energy demand or surplus at a given hour, is determined by Equation (3), where \(E\) represents the energy required (W), \(g\) denotes gravitational acceleration (9.81 m/s\({}^{2}\)), \(\rho\) is the fluid density (1000 kg/m\({}^{3}\)), \(H\) refers to a head of maximum 5 m, and \(V\) is the volume in m\({}^{3}\).