## 5 Conclusions
The existence of a larger storage capacity with PAT significantly reduced dependence on the electricity grid, covering 8619 h annually. Energy was primarily stored during photovoltaic surpluses, while the PAT system was used consistently to manage peak demand. By integrating the hybrid energy system, grid dependency was significantly reduced, lowering grid consumption from 171.66 kWh to just 2.76 kWh. For the port's energy demand and usage patterns, the optimal storage capacity to enhance hybrid system performance was estimated to be 59 m\({}^{3}\) higher than the previous hybrid energy module's definition. This increased the hours covered by the system, reaching 4980 h per year (56.85%). However, some reliance on grid power remained necessary to meet demand beyond the hybrid system's capacity, covering 60% of energy needs. In Scenario 3, the system operated independently from the grid for 60%, relying on grid support for the remaining demand. It exported 2681.2 kWh of renewable energy while importing only 609.8 kWh, resulting in a positive grid balance. However, most of the generated renewable energy was not directly consumed but exported. Primary sources covered 57% (800.5 kWh) of the demand, with the grid supplying the remaining 43% (609.8 kWh). The configuration of Scenario 4 aimed to optimize the PAT (PHS) system, but the site's low head and small module scale limited its production potential, requiring grid assistance. The PHS subsystem was limited to a 0.523 kW pump, with 10 m\({}^{3}\) reservoir capacity and a maximum discharge flow of 11 L/s (39.6 m\({}^{3}\)/h). HY4 RES modeling utilized PHS for energy storage, but the limited PAT power (0.05 kW at max discharge) restricted production, necessitating grid support. The optimization results showed a 9.7 m\({}^{3}\)/h (2.7 L/s) maximum discharge flow, further constraining energy generation. Due to the low reservoir capacity, installed power, and head, the feasible amount of hydropower production from the PAT was substantially low: 5.5 kWh/year. This produced a total of 604.3 kWh of energy needs not ensured by the system, which required assistance from the external grid. This scenario benefited from grid connection as it could export more renewable excess than what it imported to ensure the remaining energy needs, in which the total renewable excess not consumed by the demand of pump operation of the PHS subsystem was equal to 2666.7 kWh. On the other hand, Scenario 5 integrated a 15 kWh battery storage system to store excess renewable energy and meet energy demands when the energy supply was insufficient. The required capacity was driven by peak consumption in the first three months of the year for peak loads, with an annual performance of stored renewable excess of 609.8 kWh, a discharged energy of 609.5 kWh (fully covering energy needs), and a non-stored renewable excess of 2071.4 kWh. In Scenario 6, HOMER modeling estimated 546 kWh of annual grid purchases to meet a total consumption of 1409 kWh, while 2385 kWh was sold back to the grid. Grid support was required during high-demand periods in cases without battery storage. The scenario resulted in an excess electricity of 40.4 kWh/year. Finally, in Scenario 7, the system produced 3450 kWh/year, covering the 1409 kWh annual consumption. This scenario resulted in 1834 kWh/year of excess electricity, an unmet load of 0.831 kWh/year, and a capacity shortage of 1.41 kWh/year. AI-based machine learning (ML) was applied to analyze five scenarios for which numerical data were available, predicting energy balances under current demand conditions and with an 80% demand increase. This approach helped optimize excess energy usage, reducing grid dependency with additional costs. Scenarios 1 to 5 were analyzed in MATLAB(r) R2024A, while Scenarios 6 and 7 (from HOMER(r) 3.16.2 Pro) followed similar patterns but lacked accessible data for ML modeling. Then, a data-driven AI framework was developed, using neural network time series (NNTS) to forecast energy surplus and deficits.