## 1 Introduction
In both models, key features are identified:  
* System flexibility supports off-grid, grid-connected, and hybrid configurations with multiple energy sources, including solar, wind, hydropower, and pumped storage, grid connection, and battery storage;
* Performance balances energy resource allocation based on load demand and renewable energy variability and seamlessly incorporates various renewable sources and storage solutions;
* Analysis evaluation assesses technical-operational assessments and cost-effectiveness by analyzing capital and operational expenses, along with key financial metrics, and examines the impact of parameter variations on system efficiency and performance;* User-friendly interfaces offer an intuitive graphical interface with visualization tools for data interpretation and presentation. In summary, the updated EMTv1 model, with environmentally friendly interactivity and report visualization, uses the MS Solver optimization toolkit to analyze the energy sector of the port's demand. On the other hand, the updated HY4 RES model uses Python for single- or multi-objective optimization functions. However, a simpler algorithm can also be conducted via a non-linear generalized reduced gradient (NL-GRG) method, with a multistart option, combining with the evolutionary method's accuracy based on genetic algorithms (GAs). These approaches aim for a global solution with a population size of 200 and a default convergence of 0.0001. Decision variables include hydropower, grid, wind, solar factors, pumped storage, and batteries (BESS). On the other hand, HOMER(r) 3.16.2 Pro is an influential commercial tool for designing and optimizing energy systems with renewable and distributed resources. In this research, the same scenarios with grid connection were used by the tree models and a standalone with a battery energy storage system (BESS) and were then compared using HY4 RES and HOMER(r) 3.16.2 Pro to show their ability to model complex energy port sectors, optimize different configurations, and perform detailed energy balance analyses, showing the invaluable contribution of the latter software in developing efficient, reliable, and sustainable microgrids. HOMER(r) 3.16.2 Pro applies a blend of non-linear programming, heuristic optimization, and mixed-integer linear programming, using tools such as Visual Studio C++ 2022, Python3, and MATLAB(r) R2024A. All models used in this study have interactive approaches, integrating simulation feedback and heuristic methods (e.g., genetic algorithms), effectively navigating non-linearities and discrete decision variables, and enhancing scenario analysis and component selection. EMTv1 is under development, as it does not allow one to simulate the integration of BESS yet. On the other hand, HOMER is not able to simulate PAT integration due to the very little power installed. The models present their own limitations depending on the system configuration and characteristic parameters. Hence, this research work is structured as follows: Section 1, as previously presented, includes a review of the recent literature on the subject of hybrid energy solutions and optimization models in the area of ports and marinas. Section 2 presents the materials and methods used in this research. A strategic energy operational management methodology is developed, as well as the fundamentals associated with each optimization model, and the developed machine learning tool for the prediction of energy surplus and deficit in different energy demands. Section 3 presents the case study of Port of Aviles, with a brief presentation of the system's characterization, main components of the hybrid energy system, simulation results, and discussion of all the models, including both developed models, namely the Energy Management Tool (EMTv1) and Hybrid for Renewable Energy Solutions (HY4 RES). Additionally, the model Hybrid Optimization of Multiple Energy Resources (HOMER(r) 3.16.2 Pro), a prevailing commercial energy tool, is used for comparisons.