Next Article in Journal
A Helping Hand: A Survey About AI-Driven Experimental Design for Accelerating Scientific Research
Next Article in Special Issue
Artificial Intelligence and Digital Twins for Sustainable Waste Management: A Bibliometric and Thematic Review
Previous Article in Journal
The Link Between Physical Function, β-Amyloid, and Cognitive Aging in Women
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Optimization and Machine Learning in Modeling Approaches to Hybrid Energy Balance to Improve Ports’ Efficiency

1
Civil Engineering Research and Innovation for Sustainability (CERIS), Instituto Superior Técnico, Department of Civil Engineering, Architecture and Environment, University of Lisbon, 1049-001 Lisbon, Portugal
2
Instituto de Hidráulica y Saneamiento Ambiental, Universidad de Cartagena, Cartagena 130001, Colombia
3
Hydraulic Engineering and Environmental Department, Universitat Politècnica de València, 46022 Valencia, Spain
4
Department of Mechanical Engineering, Abdullah Gul University, 38080 Kayseri, Turkey
5
School of Engineering, RMIT University, 124 La Trobe St., Melbourne, VIC 3000, Australia
6
Department of Energy, University of Oviedo, CUIDA, 33007 Oviedo, Spain
*
Authors to whom correspondence should be addressed.
Appl. Sci. 2025, 15(9), 5211; https://doi.org/10.3390/app15095211
Submission received: 28 March 2025 / Revised: 29 April 2025 / Accepted: 30 April 2025 / Published: 7 May 2025
(This article belongs to the Special Issue Holistic Approaches in Artificial Intelligence and Renewable Energy)

Abstract

This research provides a comprehensive review of hybrid energy solutions and optimization models for ports and marine environments. It details new methodologies, including strategic energy management and a machine learning (ML) tool for predicting energy surplus and deficits. The hybrid energy module solution for the Port of Avilés was further developed to evaluate the performance of new tools such as the Energy Management Tool (EMTv1), HYbrid for Renewable Energy Solutions (HY4RES), and a commercial model (Hybrid Optimization of Multiple Energy Resources—HOMER) in optimizing renewable energy and storage management. Seven scenarios were analyzed, integrating different energy sources and storage solutions. Using EMTv1, Scenario 1 showed high surplus energy, while Scenario 2 demonstrated grid independence with Pump-as-Turbine (PAT) storage. The HY4RES model was used to analyze Scenario 3, which achieved a positive grid balance, exporting more than imported, and Scenario 4 revealed limitations of the PAT system due to the low power installed. Scenario 5 introduced a 15 kWh battery, efficiently storing and discharging energy, reducing grid reliance, and fully covering energy needs. Using HOMER modeling, Scenario 6 required 546 kWh of grid energy but sold 2385 kWh back. Scenario 7 produced 3450 kWh/year, covering demand, resulting in 1834 kWh of surplus energy and a small capacity shortage (1.41 kWh/year). AI-based ML analysis was applied to five scenarios (the ones with access to numerical results), accurately predicting energy balances and optimizing grid interactions. A neural network time series (NNTS) model trained on average year data achieved high accuracy (R2: 0.9253–0.9695). The ANN model proved effective in making rapid energy balance predictions, reducing the need for complex simulations. A second case analyzed an increase of 80% in demand, confirming the model’s reliability, with Scenario 3 having the highest MSE (0.0166 kWh), Scenario 2 the lowest R2 (0.9289), and Scenario 5 the highest R2 (0.9693) during the validation process. This study highlights AI-driven forecasting as a valuable tool for ports to optimize energy management, minimize grid dependency, and enhance their efficiency.

1. Introduction

Europe is undergoing a major energy transition, aiming for climate neutrality by 2050 through the widespread adoption of renewable energy. To support this goal, various national and international initiatives have been launched to foster collaboration and accelerate progress [1,2]. Shared energy production systems utilizing hybrid energy systems (HESs) are widely recognized as essential for achieving a more sustainable society [1]. One such initiative, the HY4RES project, led by the EU Interreg Atlantic Area program, focuses on developing hybrid energy technologies by integrating solar, wind, and hydropower with advanced storage solutions. These micro-scale energy systems support key sectors, including agriculture, aquaculture, ports, and small energy communities, enhancing sustainability and efficiency [3]. Unlike conventional energy models focused on financial profits, HESs prioritize port community-wide benefits, fostering a more inclusive and sustainable energy system that serves all stakeholders rather than a select few [4].
This project aims to install a hybrid energy module in the city’s port, combining solar, wind, and tidal energy with a Pump-as-Turbine (PAT) system for energy storage [5]. The PAT system ensures energy reliability by storing surplus electricity and supplying it when renewable generation is insufficient. The initiative seeks to improve the port’s energy autonomy [6], supporting infrastructure such as lighting, vehicle charging stations, and small-scale operations with Hybrid for Renewable Energy Network [7]. “Energy Management for a Port Integrated Energy System Based on Distributed Dual Decomposition Mixed Integer Linear Programming” was instead investigated by [8].
Effective energy management is crucial for optimizing the use of generated and stored energy [9], particularly in transitioning from conventional grids to hybrid renewable systems. This report analyzes different operational modes of the hybrid module and identifies optimal energy demand scenarios. Various storage capacities will be tested to determine the most efficient solution, ensuring maximum energy, economic, and environmental benefits [10].
The rapid expansion of maritime transport has intensified concerns about sustainability, prompting efforts to develop effective solutions for the sector [11]. While electrification strategies for vessels are still evolving, significant advancements have already been made in supplying clean energy to shore-based port facilities, supporting a more sustainable future [12,13]. The integration of hybrid energy systems in ports is becoming increasingly prevalent, with renewable energy sources serving as a foundation for sustainability [14]. Equally crucial is the digitization and implementation of energy management systems, which enhance operational efficiency by optimizing intermittent renewable energy generation. Successful examples across Europe, such as the Port of Anzio in Italy, highlight the effectiveness of hybrid energy systems in reducing reliance on conventional power grids [15,16].
The effective deployment of hybrid systems relies on advanced control mechanisms that manage both energy generation and demand. Technologies such as digital twin (DT) and geographic information systems (GISs) facilitate energy planning and decision making [17]. Additionally, the integration of artificial intelligence (AI) and the Internet of Things (IoT) has been shown to significantly reduce energy waste in ports [18]. The joint energy scheduling approach, as explored in various studies, further emphasizes the importance of aligning renewable energy generation with port facility demands, particularly leveraging predictable sources like tidal energy [19].
A shift towards distributed energy technologies enhances resilience by preventing localized failures from disrupting the entire infrastructure. This modular approach, as implemented in this project, ensures greater flexibility, scalability, and reliability in port energy systems. Research has demonstrated that effective energy management through digitalized systems can reduce costs by approximately 21.7%, while optimized payback periods make renewable energy investments more financially viable. These findings underscore the importance of integrating digitalization and hybrid technologies to drive sustainability and efficiency in port operations [20,21].
Ports have made significant efforts to enhance energy efficiency through operational strategies and the adoption of low- and zero-carbon fuels [22]. Many also participate in environmental management protocols, including Port Environmental Review System (PERS), ISO 50001, and EN 16001 [23]. As an alternative to conventional energy sources, marine renewable energy (MRE)—such as tidal energy, marine currents, and wave energy—offers a sustainable solution for electricity generation [24].
The adoption of hydrogen is considered a crucial strategy for decarbonizing port areas and the shipping sector [25], positioning ports as key players in the transition to a renewable energy-based economy [26]. While this strategy has been implemented in various ports, challenges remain in optimizing its operation [27] and ensuring a reliable and clean power supply for its effective deployment.
A new methodology is proposed [28] to transform urban waterfronts (UWFs) into positive energy districts (PEDs), highlighting coastal cities, ports, and urban waterfronts as ideal locations for such developments through community collaboration. Similarly, [29] advocates for the establishment of HESs in ports, recognizing their potential as central hubs for clean energy. Their analysis of Italian ports demonstrated that they can enhance renewable energy adoption, positioning them as a key strategy for port sector decarbonization.
As part of the ongoing HY4RES project, advanced energy management models are being developed and implemented across various regions, including Spain, Portugal, France, and Ireland. This paper presents one of the key pilot case studies conducted at the Port of Avilés, Asturias, Spain. The study applied a range of modeling approaches and integrated various energy management components to assess their performance. In this context, newly developed tools such as the Energy Management Tool (EMTv1) [30], an interactive model created using MS 365 Excel® Solver, as well as the Hybrid for Renewable Energy Solutions (HY4RES) model [31,32], also implemented in Python, were explored. These models were specifically tested for their performance, flexibility, adaptability, and reliability and benchmarked against the widely recognized commercial software, Hybrid Optimization of Multiple Energy Resources (HOMER® 3.16.2 Pro) [32,33]. Both were designed to assist in the planning and optimization of microgrids and distributed energy systems in different energy sectors, namely for a port. Widely used in the energy sector, HOMER® 3.16.2 Pro aids in planning, designing, and analyzing microgrid projects, especially those incorporating renewable energy sources. HY4RES and EMT are tailored developed models, where the combination of elements and the flexibility of operation are added values, requiring knowledge of mathematical languages and optimization algorithms [34]. 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 HY4RES 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® 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 HY4RES and HOMER® 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® 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® 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 (HY4RES). Additionally, the model Hybrid Optimization of Multiple Energy Resources (HOMER® 3.16.2 Pro), a prevailing commercial energy tool, is used for comparisons. Section 4 enhances the modeling skills and system reliability of each optimized energy management model, using machine learning to predict energy balance analysis results. Lastly, Section 5 presents the main conclusions and limitations of this study.

2. Materials and Methods

2.1. Strategic Energy Management Optimization

The methodology developed (Figure 1) included essentially two steps: The first one consisted in the (i) optimization of the strategy for renewable sources and storage system management via three different mathematical models, namelyEMTv1 and HY4RES, both developed under the HY4RES research project, and HOMER® 3.16.2 Pro, a widely used commercial energy tool. Seven scenarios (no. 1 to 7) were created and analyzed in terms of the models’ capabilities in combining energy components and storage management. The second step was developed around (ii) machine learning and its use in the prediction of energy balance, i.e., energy surplus and deficit, over five scenarios obtained by the developed optimization models.
The following section presents the main hybrid energy optimization models and the characteristics of the different scenarios used by each model in this research.

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).
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).
% C o v D e m a n d = C o v e r e d   d e m a n d T o t a l   d e m a n d · 100
E r e v e n u e s = h = 1 8760 t h · P h
V = E g · ρ w a t e r · H
where %Cov Demand is the percentage of demand met by the hybrid module, Erevenues corresponds to energy savings (kWh), Δ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/s2), ρ is the fluid density (1000 kg/m3), H refers to a head of maximum 5 m, and V is the volume in m3.
A strategic operational scheme is used to effectively govern the hybrid energy module, ensuring that all the conditions are comprehensively addressed and incorporated.

2.1.2. HY4RES Model

Hybrid energy solution models were developed using Solver and Python to optimize hybrid energy systems (HESs) with pumped hydro storage (PHS). These models integrate intermittent renewable sources to create a sustainable technical–operational energy solution.
The goal when using them is to analyze each system’s adaptability, including storing excess wind and solar energy, pumping to an upper reservoir when demand is low, and generating hydropower when demand exceeds production (Figure 3).
Briefly, the main equations used in the model were the following:
S s + w i = S i + W i E c i , I f > 0
P S i = S s + w i , I f > 0
V R i 1 V t i V m i n
V R i 1 + V p i V m a x
E + i = S s + w i P F s + w i
E i = [ E c i S i W i H i ] + P G i
B e i + B p i = E c i S i W i H i , I f > 0 B e i B i + P F A / B i
where S s + w i is the total intermittent renewables in kWh, P s i is the available renewable energy for pumps in kWh, V R i 1 corresponds to the reservoir volume and V t i to the turbine volume, both in m3, V p i corresponds to the pumped volume in m3, E + i is the energy surplus in kWh, E i energy is the deficit in kWh, a condition during which the solar energy S i   k W h and the hydropower generated H i   k W h cannot satisfy the energy needs E c i   k W h of the system and there is the option to buy from the grid the energy that is in debt, P G i is the grid energy for the pump (kWh), B e i represents the energy needed from the batteries for the energy needs in kWh, and B p i is the feasible battery energy to be used for pump operation, in kWh.
This model allowed us to decrease the number of decision variables from 20 k to 0.2 k, using a GRG non-linear model, as explained in [31,32], permitting a better manipulation of the energy balance, keeping a similar degree of accuracy.

2.1.3. HOMER Model

HOMER® 3.16.2 Pro is extensively utilized in the energy industry to assist with planning, designing, and evaluating microgrid projects, particularly those which integrate renewable energy sources [32,33].
This research aimed to evaluate the technical and performance viability of the system to be implemented by optimizing components towards the best combination that would minimize the energy derived from the grid and meet water–energy nexus requirements (Figure 4).
The model used solar radiation to generate electricity. Solar PV will be one of most important renewables in the future. The electricity generated by solar PV is calculated as follows:
P P V = Y P V f P V ( G T G T , S T C ) [ 1 + α P T c T c , S T C ]
where
Y P V = power output during standard test conditions in kW.
f P V = derating factor of solar PV.
G T = incident solar irradiance in kW/m2
G T , S T C = incident solar irradiance under standard test conditions, which is 1 kW/m2.
α P = temperature coefficient of power.
T c = cell temperature of solar PV in °C.
T c , S T C = cell temperature under standard test conditions, which is 25 °C.
In ports, another renewable energy system is wind energy. Many innovative wind turbine models are on the rise to harness wind energy on a micro scale. The wind turbine considered for our case study simulation was a generic micro wind turbine predefined by the model. It first calculated the wind speed at hub height using Equation (12):
U h u b = U a n e m . ln ( Z h u b Z 0 ) ln ( Z a n e m Z 0 )
where
U h u b = wind speed at the hub height of the wind turbine in m/s.
U a n e m = wind speed at the anemometer height in m/s.
Z h u b = hub height of the wind turbine in m.
Z 0 = surface roughness length in m.
Z a n e m = anemometer height in m.
The model considered the wind turbine’s power curve to calculate the power generated by the wind turbine. To obtain the power generated under real conditions, the model used the following equation:
P W T G = ρ ρ 0 . P W T G , S T P
where
P W T G = output power of wind turbine in kW.
P W T G , S T P = output power of wind turbine under standard conditions, in kW.
ρ = actual air density in kg/ m 3 .
ρ 0 = air density at STP, which is 1.225 kg/ m 3 .
Hydropower is one of the oldest techniques of energy generation. For this research, this power was too small, meaning that it was impossible to consider this element. However, these turbines were represented by PATs. The calculation for the water turbines was conducted as follows:
P h y d = ŋ h y d . ρ w a t e r . g . h n e t . Q ˙ t u r b i n e
where
P h y d = hydro turbine power output in kW.
ŋ h y d = efficiency of hydro turbine in %.
ρ w a t e r = water density, which is 1000 kg/ m 3 .
g = acceleration due to gravity, which is 9.81 m/ s 2 .
h n e t = effective head in m.
Q ˙ t u r b i n e = hydro turbine flow rate in m 3 / s .
After the definition of the hybrid solution and the respective restrictions imposed for each operational model, the obtained results first showed the influence of the behavior and functioning of the system in terms of energy (production/need) and, secondly, surplus and deficit aspects.

2.2. Machine Learning Methodology

Machine learning was applied in this research following the flowchart presented in Figure 5. The proposed methodology was divided into three stages: (I) pre-processing of energy consumption data ( E c ), (II) implementation of the neural network time series (NNTS), and (III) evaluation of statistical measures (Figure 5).
(I)
Pre-Processing Data
A series of primary energy sources and needs were the dataset used to create different scenarios after the optimization step (Figure 6).
(II)
Implementation of the Neural Network Time Series (NNTS)
For the ML analysis, an NNTS was applied in this research, considering a non-linear autoregressive exogenous model (NARX) which related the energy surplus/deficit ( E s d ) and the consumption energy ( E c ). The NARX considered previous values of E s d for each time step and the current and past values of the function E c . This model can be explained considering the following formulation:
E s d , t = F E s d , t 1 , E s d , t 2 , E s d , t 3 , , E c , t ,   E c , t 1 ,   E c , t 2 ,   E c t 3 , + ε t  
where ε t = error term.
Figure 5 illustrates the structure of the neural network time series (NNTS), which consists of a hidden layer and an output layer. Simulations were performed using MATLAB® R2024A.
(III)
Evaluation of Statistical Measures
To assess the performance of the implemented NNTS, two statistical measures were considered in the analysis, as outlined below:
  • Mean square error
M S E = 1 N i = 1 N ( E s d , t E s d , t ^ ) 2  
where E s d , t ^ is the predicted value of E s d , t .
  • Coefficient of determination ( R 2 )
R 2 = 1 i = 1 N ( E s d , t E s d , t ^ ) 2 i = 1 N ( E s d , t E s d , t ¯ ) 2  
where E s d , t ¯ is the mean of the E s d , t .

3. Case Study of the Port of Avilés

3.1. Brief System Characterization

The pilot site is located on land, managed by the Port Authority of Avilés (Principality of Asturias, Spain). Specifically, it is a hybrid renewable energy installation consisting of wind, PV solar, hydrokinetic turbines and a pump-as-turbine (PAT) storage system. Figure 7 and Table 1 show the location and system components’ characteristics.
The hybrid energy system comprised the following key components:
  • Sea Hybrid Module: This was a storage unit for all electrical components, control electronics, and batteries, along with other essential elements required for the analysis of the pilot site, such as sensors. Additionally, it housed a water tank and a Pump-as-Turbine (PAT) unit.
  • Solar Panels: A metal support structure, located near the sea Hybrid module, accommodated multiple solar panels to generate electricity during daylight hours.
  • Wind Turbines: Three vertical-axis wind turbines were installed on top of the sea hybrid module to harness the wind energy available at the site.
  • Hydrokinetic Turbines: Given the presence of a small tidal river near the pilot site, a floating platform equipped with two vertical-axis hydrokinetic turbines was developed to capture energy from the kinetic movement of the water current.
  • PHS (based on Pump-as-Turbine (PAT)) Unit: This unit, located within the sea hybrid module, included a water tank, a pump operating as a turbine, and all necessary plumbing components, such as pipes and control valves.
Then, the system under analysis was one hybrid energy module based on a sea hybrid module of 6 m length, which, inside the tank for the pump hydro storage (PHS) system, on top, included micro wind turbines, PV panels beside of the hybrid module, and a bouncy solution with hydrokinetic turbines, to be installed in the Port of Aviles. This module could be replicated with more parallel installations.
Out of the different energy sectors in the Port of Aviles, this research study selected the ones that better suited the energy module set to be developed (Figure 8).

3.2. Different Modeling Approaches

Three models and two different types of analyses are hereby presented: (i) EMT outlines on-grid without and with self-consumption and storage; (ii) analysis of HY4RES and HOMER® 3.16.2 in grid connection or as a standalone, with and without different storage solutions.

3.2.1. EMT Modeling

This section presents the results of two selected consumption profiles after outlining different operational modes. It details the initial energy contributions from generation sources, the energy supplied by the PAT system, and the grid’s role in energy provision. The findings support conclusions and guide future improvements by addressing system limitations and developing adaptable operating strategies for enhanced energy performance in port operations.
  • Scenario 1EMT Modeling: On-Grid Without Self-Consumption and PAT: A comparison of generated and consumed energy revealed a significant surplus, with the hybrid module producing 1449 kWh/year while demand was only 171 kWh/year. This underscored the technology’s impact, even without direct interaction between generation and demand. Figure 9 shows the energy balance with substantial surplus energy and the deficit in terms of strategic operation for two sample months.
The energy profiles for these two representative months of the year were analyzed to evaluate how seasonal variations impacted renewable energy generation and tanked charging and discharging patterns. This analysis was essential for assessing the adequacy of system sizing and understanding how demand distribution affected the overall utilization of energy resources.
After analyzing the energy profiles throughout the year and conducting an hourly calculation for more accurate results, it was found that a single hybrid energy module covered 60.26% of the current demand, which corresponded to 5506 h out of the 8760 h. A significant amount of energy, totaling 558,431 kWh, had to be imported from the grid.
  • Scenario 2EMT Modeling: On-Grid with Self-Consumption and PAT: This scenario focused on the interaction between generation and demand, integrating both the energy-generating components and the storage capabilities of one module. A first optimization was focused on the storage capacity that maximized economic benefits, which was 15 m3. This volume entirely almost eliminated dependence on the electricity grid, covering a total of 8619 h annually, equivalent to 98.39% hours of the year. For the energy demand sector, two representative months of the year, January and August, were selected. These months were chosen to capture the key differences in operation between winter and summer (Figure 10).
The analysis of data from January revealed that, due to significant surpluses, particularly from renewable sources like wind and solar, the tank was rarely fully discharged. On the other hand, in August, the energy pattern lost regularity, characterized by a series of small peaks throughout the period. This fluctuation was likely due to increased infrastructure usage, typical of the summer months when port activity tended to rise. August’s tank loading and unloading profile showed an increased number of cycles due to the solar unit being the primary energy source (Figure 10).
Loading mainly occurred during photovoltaic energy surpluses, while the PAT system was used more consistently to manage peak demand. By implementing the installed technologies, the total cost of purchasing energy from the grid was reduced, reflecting minimal dependency on grid imports. Grid consumption dropped to 2.76 kWh from an initial 171.66 kWh.
For this combination of energy sectors of the port and given demand profile, the optimized final storage capacity determined to maximize the performance of the hybrid solution was 59 m3. The estimated optimal storage volume significantly increased the number of hours covered, reaching a total of 4980 h and supplying energy for 60% of the year. Nevertheless, the system still relied on grid support to meet the demand unmet by the hybrid energy system.

3.2.2. HY4RES Modeling

In this analysis, the objective was to select out of all the energy sectors in the Port of Aviles the ones that would be more suitable to fit the energy prosumer based on one module of the hybridization system. Then, the chosen energy need profile covered four consumption elements in the port, namely the Embarcadero, the Rula Vieja, the Iglesia, and the Luz Roja (Figure 11), and this combination presented the following key parameters:
  • Peak load = 0.604 kW;
  • Average hourly consumption = 0.161 kWh;
  • Total annual consumption = 1410.3 kWh.
Figure 11. Total demand from the selected four sectors: Embarcadero, Rula Vieja, Iglesia, and Luz Roja.
Figure 11. Total demand from the selected four sectors: Embarcadero, Rula Vieja, Iglesia, and Luz Roja.
Applsci 15 05211 g011
The developed study used the following proposed hybrid scenarios:
-
Scenario 3—Solar, wind, and hydrokinetic energy and electric grid;
-
Scenario 4—Solar, wind, and hydrokinetic energy and PAT (PHS), eventually requiring the electric grid to meet the defined load;
-
Scenario 5—Solar, wind, and hydrokinetic energy and BESS (battery energy storage system), keeping in mind the primary renewable sources being solar + wind + hydrokinetic in all scenarios.
  • Scenario 3HY4RES Modeling: Solar, Wind, and Hydrokinetic Energy and Grid: In this scenario, the electric grid satisfied the energy needs that had not been satisfied by the primary renewables. The system was independent of the grid for ~60% of the total annual hours and the energy needs were covered 72%. Nonetheless, the system exported more energy to the grid than it imported:
    -
    Total annual exported renewables = 2681.2 kWh;
    -
    Total annual imported renewables = 609.8 kWh.
Despite the positive grid balance (more renewable exports than imports), most of the renewable energy produced was not consumed for the defined demand but was exported to the grid (Figure 12).
Concerning the defined demand, the primary sources contributed 800.5 kWh (57%) to its satisfaction, while the grid ensured the fulfilment of the remaining needs, 609.8 kWh (43%).
  • Scenario 4HY4RES Modeling: Solar, Wind, and Hydrokinetic Energy and PAT: The goal of this configuration was to maximize the performance of the PAT (PHS) system. However, the site did not possess a significant height variation, and the module’s scale was small. So, the production potential of the PAT subsystem was likely insufficient to meet all the defined energy demand without grid assistance.
The following were the parameters for the PHS subsystem:
  • Pump-rated power (with an efficiency equal to the one in turbine mode) = 0.523 kW;
  • Reservoir capacity = 10 m3.
In HY4RES modeling, the pumped hydro storage (PHS) element was used as an important storage technique with upper and bottom water reservoirs. The energy was stored by retaining water in the higher-elevation reservoir and when needed, the water was released from the upper reservoir, flowing through a Pump-as-Turbine (PAT) driven by gravity to produce hydropower. During periods of surplus renewable energy production or lower demand, the excess energy was used to pump the water from the lower reservoir back to the upper one.
The selected hybrid energy system allowed for flow variations using the upper tank inside the hybrid module and the sea channel in the port (with no necessary defined volume) as the lower one. HY4RES privileged the operation of the pump and hydropower and the storage of water volume in the top reservoir, providing potential for additional energy production. Hence, HY4RES used the following formulation: PHS operation depended on wind/solar energy, depending on whether they were available, expressed by Equation (18), where H n e e d i is the required hydropower energy to satisfy the energy needs, in kWh; if the energy needed ( E n i ) was satisfied by the solar + wind energy produced and if there was a surplus of it, then the PHS was set to pump mode to use that same energy to pump water to the higher reservoir, expressed by Equation (19), where P s i is the available renewable energy to be used by the pumps, in kWh.
H n e e d i = E n i ( S + W ) i , I f > 0
Else   P S i = S s + w i , I f > 0
Regarding PAT operation, the PHS system only produces hydropower if there is enough water stored in the top reservoir (Equation (20)) and in reverse mode as a pump (Equation (21)).
V R i 1 V t i V m i n
V R i 1 + V p i V m a x
where V R i 1 corresponds to the reservoir volume at the end of the previous hour, V t i to the turbine volume, both in m3, and V p i corresponds to the pumped volume in m3. The turbine volume can be computed using Equation (22), based on [31,32]:
V t i = α . H n e e d i . 3600 . 10 3 9800 . η t . H t
where the variable (α) is the hydropower factor, with a value between 0 and 1; H n e e d i is the required hydropower energy for energy needs, in kWh; ηt the average turbine + generator efficiency; and Ht is the average turbine head.
In the pump mode, the feasible renewable energy for the pump ( P F S i ) in kWh can be obtained by Equation (23):
P F S i = β   · P S i
The grid contribution for the pump station plus the available renewable energy for the pump ( P S i ) multiplied by its factor (β) is less than or equal to the nominal power (PN), as described by Equation (24).
I f β   · P S i + γ   · P N P N
Based on the storage capacity and power output, energy production can be estimated using Equation (25).
E [kWh] = 9.81 ρwater Vres Hhead η/(3.6 × 106)
where
  • E is the energy stored in kWh;
  • ρwater is the density of water, 1000 kg/m3;
  • Vres is the volume of water in the upper reservoir in m3;
  • Hhead is the available head in m;
  • η is the efficiency of the energy conversion considering losses for turbine efficiency and generator efficiency.
The rated power of the PAT (in turbine mode) formerly defined limited the energy that could be produced, despite the existence of hours with an unsatisfied load above 0.2 kW. This immediately required the assistance of the grid. Also, the selected reservoir capacity proposed for this module was 10 m3, while the maximum discharge flow was 39.6 m3/h (Figure 13). This volume was not ideal and limited the feasible PAT production. After the optimization, the maximum discharge flow registered was 9.7 m3/h (2.7 L/s) with a power production of 0.05 kW (1/4 of the rated power).
Due to the low reservoir capacity, low installed power, and small head value, the feasible hydropower production from the PAT was substantially low: 5.5 kWh/year, corresponding to only 1% of the required PAT production to meet the leftover energy needs. This produced a total of 604.3 kWh of energy needs not ensured by the system, which eventually required assistance from the external grid in the port. This scenario benefited from grid connection as it could export more renewable excess than what it imported to ensure the fulfilment of remaining energy needs, in which the total renewable excess not consumed by the demand of pump operation of the PAT/PHS subsystem was equal to 2666.7 kWh.
  • Scenario 5HY4RES Modeling: Solar, Wind, and Hydrokinetic Energy and BESS: This scenario used a battery storage system to store the excess renewable energy and ensure the energy needs when these were insufficient. The optimization required a battery capacity of 15 kWh to ensure 100% of the defined demand.
The maximum capacity required was mainly due to peak consumption during the first three months of the year. If the hybrid energy system module was connected to the grid, the battery capacity could be reduced and instead rely on the grid to ensure peak loads (Figure 14).
In this scenario, the battery presented the following annual performance:
  • Stored renewable excess = 609.8 kWh (23% of the total excess);
  • Discharged energy from battery storage = 609.5 kWh (100% of the required amount to completely ensure the energy needs);
  • Renewable excess not stored = 2071.4 kWh (77% of the total excess).

3.2.3. HOMER Modeling

While based on the same data used for HY4RES modeling, HOMER® 3.16.2 had the advantage of collecting some data on renewable sources from NASA for the region of the Port of Aviles, namely an average daily radiation value of 3.37 kWh/m2/day annually. In July, the daily radiation value reached its maximum, measured at 5.330 kWh/m2/day. Based on 30 years of data from the NASA database, the annual average wind speed was 6.15 m/s, with the highest wind speed recorded in December, at 7.370 m/s (Figure 15).
In the developed analysis and when involving hydrokinetic turbines, a water speed of 0.7 m/s was assumed. The power output of the hydrokinetic turbine was kept at a minimum level, considering the assumption that the water speed in the channel was lower.
Regarding electric consumption, the same values of the HY4RES model were used and HOMER® 3.16.2 Pro allowed for an interesting infographic representation (Figure 16).
The study developed with HOMER® 3.16.2Pro used the following proposed hybrid scenarios:
-
Scenario 6—Solar, wind, and hydrokinetic energy and the electric grid;
-
Scenario 7—Solar, wind, and hydrokinetic energy and BESS (battery energy storage system), keeping in mind that the primary renewable sources were solar + wind + hydrokinetic in all scenarios.
It was not able to use a micro-PAT component in the hybrid energy solution module simulation due to the minimum limit possible for this element’s implementation.
  • Scenario 6HOMER Modeling: Solar, Wind, and Hydrokinetic Energy and Electric Grid: According to the evaluation of Scenario 6 using HOMER® 3.16.2 Pro modeling, the amount of energy that needed to be purchased from the grid was calculated as approximately 546 kWh annually. This met the annual energy consumption of 1409 kWh, while 2385 kWh of energy was sold back to the grid. During certain periods of the year, due to increased energy demand, a grid connection was necessary to meet the energy needs in the scenarios without battery storage (Table 2 and Figure 17).
Scenario 6 presented an excess electricity of 40.4 kWh/yr with no unmet nor capacity shortage.
  • Scenario 7HOMER Modeling: Solar, Wind, and Hydrokinetic Energy and BESS: According to the results, the energy produced was 3450 kWh/yr, which met the annual energy consumption of 1409 kWh (Table 3 and Figure 18).
In Scenario 7, an excess of electricity production of 1834 kWh/yr was noticed, alongside an unmet electric load of 0.831 kWh/yr, representing a capacity shortage of 1.41 kWh/yr.

3.3. Converter and Controller

For the HOMER® 3.16.2 Pro model, an electric converter was considered as a device that changed electrical energy from AC to DC or vice versa depending on the type of equipment to be installed. In the system under analysis, where components worked together using different forms of energy, a converter was vital for the system’s operation. It was divided into two parts: a rectifier and an inverter. The inverter converted direct current (DC) to alternating current (AC), which was essential for connecting the PV panel and the PHS (DC) to the load or grid (AC). Meanwhile, the controller was the final piece in the design of this system in HOMER® 3.16.2 Pro, adjusting the system’s operation to meet the desired objectives by changing its priorities and the way in which components interacted. The strategy chosen in HOMER® 3.16.2 was load following (LF). According to HOMER’s explanation, for Scenario 6, when excess energy was needed, grid purchases were made only to meet the primary load demand. In the EMT and HY4RES models, these electric devices did not need to be defined, since these models did not consider electric components.

4. Modeling Skills and ML of Energy Balance

This research included analyses of the results from three different models. Models EMTv1 and HY4RES were developed under the HY4RES INTERREG project and tested for robustness via comparisons with HOMER® 3.16.2 Pro, a widely known and strong commercial energy tool. The capacity of each model based on these analyses is specified in Table 4.
Models EMTv1 and HY4RES were interesting challenges for research and case study analysis due to all associated constrains, requiring more attention and being more time consuming, especially when defining all the necessary inputs for the optimization procedures.
Seven scenarios were tested and taken as base information to guide users to these three models’ simulations. After obtaining the results of the different possible technical solutions, a detailed analysis of the energy balance in terms of energy surplus and energy deficit for the seven defined scenarios was performed.
When the objective is to obtain the best strategic operational hybrid energy solution for the input energy demand and the installed power from renewable energy sources, a main parameter to better interpret the results and find the best technical–operational strategic solution for the system is energy needs’ reliability (Table 5 and Figure 19).
Applying AI, based on machine learning, five scenarios were analyzed (the ones for which numerical data were available) to perceive how predictable the energy balance was under (i) the selected energy sectors’ demand of port operations and (ii) when other energy sectors induced an increasing of demand of more than 80%. This was justified due to the detection of an excess of energy from the optimization procedures that could be undertaken, avoiding additional expenses with the acquisition of energy from the grid. In Figure 20, the energy balance is presented, although only Scenarios 1 to 5 are considered, to analyze the values in MATLAB® R2024A. Scenarios 6 and 7, obtained from HOMER® 3.16.2, could not be used to develop the prediction ML model due to the lack of accessible numerical values, but they followed a similar pattern of results to those obtained from the EMTv1 and HY4RES models. Hence, a new data-driven framework integrating AI was implemented to obtain ML-based forecasted data for the HES of Scenarios 1 to 5. The first dataset contained an average year of forecasted data corresponding to the selected real energy demands and different energy sources depending on each scenario. On the other hand, a second dataset contained input data for an increase in the energy demand to benefit occasional energy consumption nearby.
Average years were input data forecasted by ML, which was fed the NNTS to calculate the energy surplus (positive values) and deficit (negative values). To train the model, 70% of this dataset was used, while 15% was allocated to both validation and testing. Table 5 presents the MSE and R2 values obtained whilst developing this predictive model. The results confirmed that the selected NNTS was appropriate and could be used as a predictive model across all scenarios. For validation purposes, the minimum value of MSE was achieved for Scenario 2 (a value of 0.0018 kWh), while the maximum value of 0.0156 kWh was found for Scenario 3. The R2 ranged from 0.9253 to 0.9695 for all tested scenarios, showing an excellent accuracy (Table 6).
Figure 20 shows the ANN applied for Scenarios 1 to 5, showing a good accuracy for making predictions. This implies that the energy surplus and energy deficit can be predicted using the current model (ANN). It can be helpful for ports’ energy managers to make rapid predictions without the need for expertise and time-consuming operations using the optimization models EMT v1, HY4RES, or HOMMER.
A second case was analyzed, considering possible additional energy beneficiaries for the installed power systems in the hybrid energy module previously defined. This allowed us to demonstrate the accuracy of the training model in making predictions, including for an increase in energy consumption of 80%. Table 7 presents the results of the MSE and R2, which can be compared with the results in Table 6. The highest value of the MSE was found in Scenario 3, with a value of 0.0166 kWh (validation), while the lowest R2 value was 0.9289, for validation purposes, in Scenario 2.
MATLAB R2024a was used to analyze the NNTS. The analysis employed a single hidden layer with ten (10) neurons. To account for the number of epochs used, Scenario 3 was considered, in which only 33 epochs were performed. The best result was achieved at epoch 27, with a mean squared error (MSE) value of 0.000956559, as shown in Figure 21.
Figure 22 presents the results of the predictive model for Scenarios 1 to 5, considering an 80% increase in energy demand. The results allow us to conclude that, regardless of the energy demand, the predictive model can be used under different conditions as a valuable tool for making energy surplus/deficit predictions.
Due to the selected energy demands in the Port of Aviles and the characteristics of the defined hybrid energy module, the results for the different scenarios of this case study did not differ much, allowing us to consider the developed ML model as an efficient tool for predicting excess and shortage of energy in scenarios with diverse combinations of energy sources and types of storage.

5. Conclusions

This research encompassed a comprehensive and up-to-date literature review on hybrid energy solutions and optimization models within ports and marine environments. It detailed the materials and methodologies developed in the study, including the strategic operational energy management approach and the fundamental principles underlying each optimization model. Furthermore, it introduced a machine learning tool to predict energy surplus and deficits under varying energy demand conditions.
The study included a case analysis of the Port of Avilés, providing an overview of the system’s characterization, key components of the hybrid energy solution, simulation results, and discussions of the performance of all examined models. Specifically, it evaluated the developed Energy Management Tool model (EMTv1) and Hybrid for Renewable Energy Solutions (HY4RES), alongside the Hybrid Optimization of Multiple Energy Resources (HOMER® 3.16.2) model, a widely recognized commercial energy tool used for comparative analysis. Model transferability to other ports with different geographic, climatic, and operational conditions requires the study of key factors, such as varying load profiles, renewable resource availability, and local energy policies, which have been acknowledged as influencing model adaptation and performance.
This research enhanced modeling proficiency while ensuring system reliability through optimized energy management models and machine learning-based energy balance predictions.
A novel methodology was developed, consisting of two key steps:
  • Optimization of Renewable Energy Sources and Storage System Management—This step involved the strategic optimization of energy sources and storage systems using three distinct mathematical models: EMTv1 and HY4RES, both developed under the HY4RES research project, and HOMER® 3.16.2 Pro, a widely recognized commercial energy tool. Seven different scenarios (labeled from Sc1 to Sc7) were designed and analyzed based on the models’ capabilities in integrating energy components and managing storage systems.
  • Machine Learning-Based Energy Balance Prediction—This step focused on forecasting energy surplus and deficit through machine learning techniques. Predictions were conducted for five scenarios derived from the developed optimization models, enhancing the overall accuracy and reliability of energy management assessments.
The simulated scenarios included the following: Scenario 1, covering EMTv1 modeling with solar, wind, and hydrokinetic energy and PAT on-grid with waste of excess energy; Scenario 2, focused on EMTv1 modeling, with solar, wind, and hydrokinetic energy and PAT on-grid; Scenario 3, featuring HY4RES modeling, with solar, wind, and hydrokinetic energy and the grid; Scenario 4, covering HY4RES modeling, with solar, wind, and hydrokinetic energy and PAT; Scenario 5, characterized by HY4RES modeling, with solar, wind, and hydrokinetic energy and BESS; Scenario 6, using HOMER modeling, with solar, wind, and hydrokinetic energy and an electric grid; and Scenario 7, featuring HOMER modeling, with solar, wind, and hydrokinetic energy and BESS.
In Scenario 1, a comparison of generated and consumed energy highlighted a substantial surplus, with the hybrid module producing 1449 kWh/year while demand was only 171 kWh/year. Seasonal variations in renewable energy generation and storage dynamics were analyzed to assess system sizing and demand distribution. Hourly calculations revealed that a single hybrid module covered 60.26% of demand (5506 out of 8760 h), requiring 558,431 kWh to be imported from the grid. Scenario 2 examined the interaction between energy generation, demand, and storage within a single hybrid module. 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 m3 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 m3 reservoir capacity and a maximum discharge flow of 11 L/s (39.6 m3/h). HY4RES 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 m3/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® R2024A, while Scenarios 6 and 7 (from HOMER® 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. The model was trained on 70% of the dataset, with 15% for validation and testing, achieving high accuracy (R2: 0.9253–0.9695) across all scenarios. Scenario 2 had the lowest MSE (0.0018 kWh), while Scenario 3 had the highest value (0.0156 kWh). The artificial neural network (ANN) model accurately predicted energy balance for Scenarios 1 to 5, demonstrating its effectiveness. This would enable ports to make rapid energy predictions using the EMTv1, HY4RES, or HOMER® 3.16.2 Pro models, without requiring expertise or time-consuming simulations. An additional analysis was conducted for an 80% increase in demand, analyzing the impact of extra energy beneficiaries on the hybrid energy module. The predictive model remained effective, with Scenario 3 having the highest MSE (0.0166 kWh) and Scenario 2 having the lowest R2 (0.9289), confirming the model’s reliability in predicting energy surplus and deficit under different renewable combinations. The main limitation of ML is its ability to handle increasing demand, as accurate predictions require proper training, validation, and testing. Without these steps, the model’s reliability may be compromised.

Author Contributions

Conceptualization, H.M.R., J.S.T.C., E.B., T.X.A. and O.E.C.-H.; methodology, H.M.R., J.S.T.C., T.X.A., O.E.C.-H. and M.P.-S.; software and calculus, J.S.T.C., E.B., T.X.A. and O.E.C.-H.; writing—original draft preparation, H.M.R. and O.E.C.-H.; review, M.P.-S., K.K., A.M. and R.E.-V.; supervision, H.M.R., M.P.-S., K.K., A.M. and R.E.-V.; editing and final preparation, all authors. All authors have read and agreed to the published version of the manuscript.

Funding

The authors are grateful for the project HY4RES (Hybrid Solutions for Renewable Energy Systems) EAPA_0001/2022 from INTERREG ATLANTIC AREA PROGRAMME, as well the Foundation for Science and Technology’s support to UIDB/04625/2020, the research unit CERIS.

Data Availability Statement

The used data are available in the manuscript.

Acknowledgments

This work was supported by FCT, UIDB/04625/2025 CERIS, in the Hydraulic Laboratory, for experiments on pumped storage performance, and the project HY4RES (Hybrid Solutions for Renewable Energy Systems) EAPA_0001/2022 from the INTERREG ATLANTIC AREA PROGRAMME.

Conflicts of Interest

The authors declare no conflicts of interest.

Nomenclature

Acronyms
ACAlternating Current
AIArtificial Intelligence
ANNArtificial Neural Network
BESSBattery Energy Storage System
DCDirect Current
DTDigital Twin
EMTEnergy Management Tool
GISGeographic Information System
HESHybrid Energy System
HOMERHybrid Optimization of Multiple Energy Resources
HY4RESHybrid for Renewable Energy Solutions
IoTInternet of Things
MREMarine Renewable Energy
MSEMean Square Error
NARXNon-Linear Autoregressive Model Exogenous
NL-GRGNon-Linear Generalized Reduced Gradient
NNTSNeural Network Time Series
PATPump-as-Turbine
PEDPositive Energy District
PERSPort Environmental Review System
PHSPumped Hydropower Storage
PVPhotovoltaic
UWFUrban Waterfront
Variables
B e i Batteries for energy needs [kWh]
B p i Feasible battery energy [kWh]
COVDemandPercentage of covered demand by the hybrid module [%]
EEnergy required (W)
E c i Energy need [kWh]
E i Energy deficit in [kWh]
E + i Energy surplus in [kWh]
E n i Energy need [kWh]
ErevenuesEnergy savings (kWh),
f P V Derating factor of solar PV
gGravity acceleration [9.81 m/s2]
G T Incident solar irradiance [kW/m2]
G T , S T C Incident solar irradiance under standard test conditions [kW/m2]
h n e t Effective head [m]
HHead (m)
HPump head [m]
HiHydropower generated [kWh]
H n e e d i Required hydropower [kWh]
HtAverage turbine head [m]
NNumber of years
PInstalled power (kW)
P F s i Feasible renewable for pump [kWh]
P h y d Hydro turbine power output [kW]
P G i Grid energy for pump [kWh]
P W T G , S T P Output power of wind turbine under standard conditions [kW]
P W T G Output power of wind turbine [kW]
PNPump nominal power [kW]
PPVPV power generated [kW]
P S i Available renewable for pump [kWh]
Q ˙ t u r b i n e Hydro turbine flow rate [m3/s]
R2Determination coefficient [-]
SiSolar energy [kWh]
S s + w i Renewable surplus [kWh]
TcCell temperature of solar PV [°C]
Tc,STCCell temperature at STC [25 °C]
U h u b Wind speed at the hub height of the wind turbine [m/s]
U a n e m Wind speed at the anemometer height [m/s]
VStorage water volume (m3),
VmaxMaximum reservoir volume [m3]
VminMinimum reservoir volume [m3]
V p i Pumped volume [m3]
V R i Reservoir volume [m3]
V R i 1 Previous reservoir volume [m3]
V t i Turbine volume [m3]
Y P V Power output during standard test conditions [kW]
WiWind energy [kWh]
Z 0 Surface roughness length [m]
Z h u b Hub height of the wind turbine [m]
Z a n e m Anemometer height [m]
α P Temperature coefficient of power
αHydropower factor
βRenewable factor
γGrid factor
ηtAverage turbine efficiency [%]
ŋ h y d Efficiency of hydro turbine [%]
ρ Actual air density [kg/m3]
ρ 0 Air density at STP, which is 1.225 [kg/m3]
ρ w a t e r Water density, which is 1000 [kg/m3]
ΔtTime step [h]

References

  1. IEA. Empowering People—The Role of Local Energy Communities in Clean Energy Transitions; IEA: Paris, France, 2023. [Google Scholar]
  2. Directive, E.J.E.B. 2001 of the European Parliament and of the Council of 11 December 2018 on the Promotion of the Use of Energy from Renewable Sources; EU: Brussels, Belgium, 2018. [Google Scholar]
  3. Caramizaru, A.; Uihlein, A. Energy Communities—An Overview of Energy and Social Innovation; Publications Office of the European Union, JRC Publications Repository: Luxembourg, 2020. [Google Scholar]
  4. European Commission. Going Climate-Neutral by 2050: A Strategic Long-Term Vision for a Prosperous, Modern, Competitive and Climate-Neutral EU Economy. Directorate-General for Climate Action, European Commission. 2019. Available online: https://op.europa.eu/en/publication-detail/-/publication/92f6d5bc-76bc-11e9-9f05-01aa75ed71a1 (accessed on 3 January 2025).
  5. Fragkos, P.; Fragkiadakis, K.; Sovacool, B.; Paroussos, L.; Vrontisi, Z.; Charalampidis, I. Equity implications of climate policy: Assessing the social and distributional impacts of emission reduction targets in the European Union. Energy 2021, 237, 121591. [Google Scholar] [CrossRef]
  6. Alamoush, A.S.; Ballini, F.; Ölçer, A.I. ‘Ports’ Technical and Operational Measures to Reduce Greenhouse Gas Emission and Improve Energy Efficiency: A Review. Mar. Pollut. Bull. 2020, 160, 111508. [Google Scholar] [CrossRef] [PubMed]
  7. Can Ports Serve as Renewable Energy Hubs? Future Bridge NetZero Events. 2024. Available online: https://netzero-events.com/can-ports-serve-as-renewable-energy-hubs/ (accessed on 10 January 2025).
  8. Ramos, H.M.; Vargas, B.; Saldanha, J.R. New Integrated Energy Solution Idealization: Hybrid for Renewable Energy Network (Hy4REN). Energies 2022, 15, 3921. [Google Scholar] [CrossRef]
  9. Teng, F.; Zhang, Q.; Xiao, G.; Ban, Z.; Liang, Y.; Guan, Y. Energy Management for a Port Integrated Energy System Based on Distributed Dual Decomposition Mixed Integer Linear Programming. J. Mar. Sci. Eng. 2023, 11, 1137. [Google Scholar] [CrossRef]
  10. Xiong, C.; Su, Y.; Wang, H.; Zhang, D.; Xiong, B. Optimal distributed energy scheduling for port microgrid system considering the coupling of renewable energy and demand. Sustain. Energy Grids Netw. 2024, 39, 101506. Available online: https://www.elsevier.com/locate/segan (accessed on 29 April 2025). [CrossRef]
  11. Psaraftis, H.N.; Zis, T. Shipping decarbonization and green ports. Marit. Transp. Res. 2022, 3, 100068. [Google Scholar] [CrossRef]
  12. Buonomano, A.; Del Papa, G.; Giuzio, G.F.; Maka, R.; Palombo, A. Advancing sustainability in the maritime sector: Energy design and optimization of large ships through information modelling and dynamic simulation. Appl. Therm. Eng. 2023, 235, 121359. [Google Scholar] [CrossRef]
  13. Barone, G.; Buonomano, A.; Del Papa, G.; Maka, R.; Palombo, A. How to achieve energy efficiency and sustainability of large ships: A new tool to optimize the operation of on-board diesel generators. Energy 2023, 282, 128288. [Google Scholar] [CrossRef]
  14. Damman, S.; Steen, M. A socio-technical perspective on the scope for ports to enable energy transition. Transp. Res. Part D Transp. Environ. 2021, 91, 102691. [Google Scholar] [CrossRef]
  15. Buonomano, A.; Del Papa, G.; Giuzio, G.F.; Palombo, A.; Russo, G. Future pathways for decarbonization and energy efficiency of ports: Modelling and optimization as sustainable energy hubs. J. Clean. Prod. 2023, 420, 138389. [Google Scholar] [CrossRef]
  16. Hoang, A.T.; Foley, A.M.; Nižetić, S.; Huang, Z.; Ong, H.C.; Ölçer, A.I.; Pham, V.V.; Phuong, X. Nguyen Energy-related approach for reduction of CO2 emissions: A critical strategy on the port-to-ship pathway. J. Clean. Prod. 2022, 355, 131772. [Google Scholar] [CrossRef]
  17. Nyeche, E.N.; Diemuodeke, E.O. Modelling and optimisation of a hybrid PV-wind turbine-pumped hydro storage energy system for mini-grid application in coastline communities. J. Clean. Prod. 2020, 250, 119578. [Google Scholar] [CrossRef]
  18. Klar, R.; Fredriksson, A.; Angelakis, V. Digital Twins for Ports: Derived From Smart City and Supply Chain Twinning Experience. IEEE Access 2023, 11, 71777–71799. [Google Scholar] [CrossRef]
  19. Xu, H.; Liu, J.; Xu, X.; Chen, J.; Yue, X. The impact of AI technology adoption on operational decision-making in competitive heterogeneous ports. Transp. Res. Part E: Logist. Transp. Rev. 2024, 183, 103428. [Google Scholar] [CrossRef]
  20. Masood Ahmad, M.; Kumar, A.; Ranjan, R. Recent Developments of Tidal Energy as Renewable Energy: An Overview. In River and Coastal Engineering; Jha, R., Singh, V.P., Singh, V., Roy, L., Thendiyath, R., Eds.; Water Science and Technology Library; Springer: Cham, Switzerland, 2022; Volume 117. [Google Scholar] [CrossRef]
  21. Su, Z.; Liu, Y.; Gao, Y.; Park, K.-S.; Su, M. Critical Success Factors for Green Port Transformation Using Digital Technology. J. Mar. Sci. Eng. 2024, 12, 2128. [Google Scholar] [CrossRef]
  22. Jia, X.; Cui, Y. Examining interrelationships of barriers in the evolution of maritime port smartification from a systematic perspective. Transp. Policy 2021, 114, 49–58. [Google Scholar] [CrossRef]
  23. Acciaro, M.; Ghiara, H.; Cusano, M.I. Energy management in seaports: A new role for port authorities. Energy Policy 2014, 71, 4–12. [Google Scholar] [CrossRef]
  24. Barone, G.; Buonomano, A.; Forzano, C.; Giuzio, G.F.; Palombo, A. Improving the Efficiency of Maritime Infrastructures through a BIM-Based Building Energy Modelling Approach: A Case Study in Naples, Italy. Energies 2021, 14, 4854. [Google Scholar] [CrossRef]
  25. Østergaard, P.A.; Duic, N.; Noorollahi, Y.; Mikulcic, H.; Kalogirou, S. Sustainable development using renewable energy technology. Renew Energy 2020, 146, 2430–2437. [Google Scholar] [CrossRef]
  26. Pivetta, D.; Volpato, G.; Carraro, G.; Dall’Armi, C.; Da Lio, L.; Lazzaretto, A.; Taccani, R. Optimal decarbonization strategies for an industrial port area by using hydrogen as energy carrier. Int. J. Hydrogen Energy 2023, 52, 1084–1103. [Google Scholar] [CrossRef]
  27. Barone, G.; Buonomano, A.; Forzano, C.; Palombo, A. Implementing the dynamic simulation approach for the design and optimization of ships energy systems: Methodology and applicability to modern cruise ships. Renew. Sustain. Energy Rev. 2021, 150, 111488. [Google Scholar] [CrossRef]
  28. Abu Bakar, N.N.; Bazmohammadi, N.; Vasquez, J.C.; Guerrero, J.M. Electrification of onshore power systems in maritime transportation towards decarbonization of ports: A review of the cold ironing technology. Renew. Sustain. Energy Rev. 2023, 178, 113243. [Google Scholar] [CrossRef]
  29. Aparisi-Cerd’a, I.; Ribó-Pérez, D.; Cuesta-Fernandez, I.; Gómez-Navarro, T. Planning positive energy districts in urban water fronts: Approach to La Marina de Valencia. Spain Energy Convers. Manag. 2022, 265, 115795. [Google Scholar] [CrossRef]
  30. Agostinelli, S.; Neshat, M.; Majidi Nezhad, M.; Piras, G.; Astiaso Garcia, D. Integrating Renewable Energy Sources in Italian Port Areas towards Renewable Energy Communities. Sustainability 2022, 14, 13720. [Google Scholar] [CrossRef]
  31. Vidal, T.A. Modelling and optimization of a hybrid renewable energy system for Puerto de Avilés, Spain, Project in Energy Engineering and Management II, MEGE, IST, 2025. Available online: https://fenix.tecnico.ulisboa.pt/cursos/mege/dissertacao/846778572214890 (accessed on 10 January 2025).
  32. Coelho, J.S.T.; van de Loo, M.; Díaz, J.A.R.; Coronado-Hernández, O.E.; Perez-Sanchez, M.; Ramos, H.M. Multi-Objective and Multi-Variable Optimization Models of Hybrid Renewable Energy Solutions for Water–Energy Nexus. Water 2024, 16, 2360. [Google Scholar] [CrossRef]
  33. Coehlo, J.S.; Alves, A.B.; Morillo, J.G.; Coronado-Hernández, O.E.; Perez-Sanchez, M.; Ramos, H.M. Hybrid Energy Solution to Improve Irrigation Systems: HY4RES vs. HOMER Optimization Models. Energies 2024, 17, 4037. [Google Scholar] [CrossRef]
  34. Guruprasad, P.S.M.; Quaranta, E.; Coronado-Hernández, O.E.; Ramos, H.M. Hydropower Advantages over Batteries in Energy Storage of Off-Grid Systems: A Case Study. Energies 2023, 16, 6309. [Google Scholar] [CrossRef]
Figure 1. Strategic energy management methodology.
Figure 1. Strategic energy management methodology.
Applsci 15 05211 g001
Figure 2. EMT model with flow distribution for the on-grid without self-consumption (a) and on-grid with self-consumption (b).
Figure 2. EMT model with flow distribution for the on-grid without self-consumption (a) and on-grid with self-consumption (b).
Applsci 15 05211 g002
Figure 3. HY4RES model with microgrid definition.
Figure 3. HY4RES model with microgrid definition.
Applsci 15 05211 g003
Figure 4. HOMER® model with the microgrid definition.
Figure 4. HOMER® model with the microgrid definition.
Applsci 15 05211 g004
Figure 5. ML methodology.
Figure 5. ML methodology.
Applsci 15 05211 g005
Figure 6. Shortcut of primary energy sources, battery storage solution, and excess and deficit energy.
Figure 6. Shortcut of primary energy sources, battery storage solution, and excess and deficit energy.
Applsci 15 05211 g006
Figure 7. Port of Aviles’ location for the hybrid energy module and system characteristics.
Figure 7. Port of Aviles’ location for the hybrid energy module and system characteristics.
Applsci 15 05211 g007
Figure 8. Selected energy demand sectors.
Figure 8. Selected energy demand sectors.
Applsci 15 05211 g008
Figure 9. EMT modeling for Scenario 1: energy balance in (a) January and (b) August.
Figure 9. EMT modeling for Scenario 1: energy balance in (a) January and (b) August.
Applsci 15 05211 g009
Figure 10. EMT modeling for Scenario 2: energy balance in (a) January and (b) August.
Figure 10. EMT modeling for Scenario 2: energy balance in (a) January and (b) August.
Applsci 15 05211 g010
Figure 12. HY4RES results for Scenario 3: hybrid energy system of microgrid module balance.
Figure 12. HY4RES results for Scenario 3: hybrid energy system of microgrid module balance.
Applsci 15 05211 g012
Figure 13. HY4RES results for Scenario 4.
Figure 13. HY4RES results for Scenario 4.
Applsci 15 05211 g013
Figure 14. HY4RES results for Scenario 5: (a) energy balance and (b) battery capacity.
Figure 14. HY4RES results for Scenario 5: (a) energy balance and (b) battery capacity.
Applsci 15 05211 g014
Figure 15. HOMER Pro data collection: (a) solar irradiation and (b) wind speed.
Figure 15. HOMER Pro data collection: (a) solar irradiation and (b) wind speed.
Applsci 15 05211 g015
Figure 16. Energy demand profiles for the combination of “Embarcadero, Rula Vieja, Iglesia and Luz Roja”.
Figure 16. Energy demand profiles for the combination of “Embarcadero, Rula Vieja, Iglesia and Luz Roja”.
Applsci 15 05211 g016
Figure 17. HOMER results for Scenario 6: (a) microgrid and (b) energy balance.
Figure 17. HOMER results for Scenario 6: (a) microgrid and (b) energy balance.
Applsci 15 05211 g017
Figure 18. HOMER results for Scenario 7: (a) microgrid; (b) energy balance; and (c) battery’s state of charge.
Figure 18. HOMER results for Scenario 7: (a) microgrid; (b) energy balance; and (c) battery’s state of charge.
Applsci 15 05211 g018
Figure 19. Patterns of energy balance surplus and deficit for all analyzed scenarios.
Figure 19. Patterns of energy balance surplus and deficit for all analyzed scenarios.
Applsci 15 05211 g019
Figure 20. Artificial neural network used to consider demand and energy balance for various scenarios: (a) No.1; (b) No. 2; (c) No. 3; (d) No. 4; and (e) No. 5.
Figure 20. Artificial neural network used to consider demand and energy balance for various scenarios: (a) No.1; (b) No. 2; (c) No. 3; (d) No. 4; and (e) No. 5.
Applsci 15 05211 g020
Figure 21. Analysis of the number of epochs for Scenario 3.
Figure 21. Analysis of the number of epochs for Scenario 3.
Applsci 15 05211 g021
Figure 22. Artificial neural network employed considering a higher demand for various scenarios: (a) No.1; (b) No. 2; (c) No. 3; (d) No. 4; and (e) No. 5.
Figure 22. Artificial neural network employed considering a higher demand for various scenarios: (a) No.1; (b) No. 2; (c) No. 3; (d) No. 4; and (e) No. 5.
Applsci 15 05211 g022
Table 1. Base characteristics for the hybrid energy module.
Table 1. Base characteristics for the hybrid energy module.
PV SolarHydrokinetic
Installed power of solar panels, 405 W/panelArea swept by turbine, 0.28 m2
Number of solar panels, 2 panelsNumber of wind turbines, 2 turbines
Average solar irradiation in Avilés, 3 kWh/m2/dayAverage water velocity in river, 0.7 m/s
System efficiency, 80%System efficiency, 20%
Days of operation, 292 (80% of year)Days of operation, 292 (80% of year)
WindPAT
Installed power of wind turbine, 800 W/turbinePower of PAT system, 200 W
Number of wind turbines, 3 turbinesMaximum flow rate, 11 ls
Area swept by turbine, 0.45 m2Average head, 3 to 5 m
Average wind potential, 250 W/m2Average efficiency, 62%
System efficiency, 20%Days of operation, 292 (80% of year)
Days of operation, 292 (80% of year)
Table 2. Energy balance for Scenario 6.
Table 2. Energy balance for Scenario 6.
ComponentProduction (kWh/yr)%ComponentConsumption (kWh/yr)%
Solar PV90422.6AC Primary Load140937.1
Wind Turbines238059.5DC Primary Load00
Hydrokinetic Turbine1664.16Deferrable Load00
Grid Purchases54613.7Grid Sales238562.9
Total3997100Total3794100
Table 3. Energy prosumer for Scenario 7.
Table 3. Energy prosumer for Scenario 7.
ComponentProduction (kWh/yr)%ComponentConsumption (kWh/yr)%
Solar PV90426.2AC Primary Load1409100
Wind Turbines238069.0DC Primary Load00
Hydrokinetic Turbine1664.82Deferrable Load00
Total3450100Total1409100
Table 4. Capability of each optimization model.
Table 4. Capability of each optimization model.
Type of ModelingSimulated ScenariosInput of Primary Renewable Sources (PV, Wind) DatabaseEnergy Balance of Primary SourcesCombination of Energy Demand from Different SectorsWater Allocation NeedStorage Capacity and PHS Unlimited PowerBESSComplete Optimization Strategic OperationLess Time-ConsumingEconomic AnalysisEnvironmental Analysis
EMT—v1 (Research development)1 and
2
Need input dataNot preparedNot yet
HY4RES (GRG and Python) (Research development)3,
4, and
5
Need input data
Not valid for Python version
HOMER® 3.16.2 Pro (Commercial)6 and
7
NoNot prepared for micro
Table 5. Optimal technical-operational strategic solutions based on models and scenarios.
Table 5. Optimal technical-operational strategic solutions based on models and scenarios.
Energy Needs Reliability (%)Sc1Sc2Sc3Sc4Sc5Sc6Sc7
EMTv16060
HY4RES 7272100
HOMER® 3.16.2 63~100
Table 6. MSE and R2 for training, validation, and testing for the demand and energy balance.
Table 6. MSE and R2 for training, validation, and testing for the demand and energy balance.
ScenarioTrainingValidationTesting
MSE (kWh)R2MSE (kWh)R2MSE (kWh)R2
10.00360.96770.0048095940.00350.9716
20.00150.93500.00180.92530.00160.9287
30.01500.96660.01560.96570.01380.9660
40.01480.96630.01500.96540.01560.9665
50.01510.96500.01470.96950.01470.9678
Table 7. MSE and R2 for validation and testing in scenarios with a higher energy demand.
Table 7. MSE and R2 for validation and testing in scenarios with a higher energy demand.
ScenarioValidationTest
MSE (kWh)R2MSE (kWh)R2
10.00370.96550.00430.9651
20.00170.92890.00150.9353
30.01660.96370.01420.9671
40.01500.96740.01670.9622
50.01410.96930.01630.9617
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Ramos, H.M.; Coelho, J.S.T.; Bekci, E.; Adrover, T.X.; Coronado-Hernández, O.E.; Perez-Sanchez, M.; Koca, K.; McNabola, A.; Espina-Valdés, R. Optimization and Machine Learning in Modeling Approaches to Hybrid Energy Balance to Improve Ports’ Efficiency. Appl. Sci. 2025, 15, 5211. https://doi.org/10.3390/app15095211

AMA Style

Ramos HM, Coelho JST, Bekci E, Adrover TX, Coronado-Hernández OE, Perez-Sanchez M, Koca K, McNabola A, Espina-Valdés R. Optimization and Machine Learning in Modeling Approaches to Hybrid Energy Balance to Improve Ports’ Efficiency. Applied Sciences. 2025; 15(9):5211. https://doi.org/10.3390/app15095211

Chicago/Turabian Style

Ramos, Helena M., João S. T. Coelho, Eyup Bekci, Toni X. Adrover, Oscar E. Coronado-Hernández, Modesto Perez-Sanchez, Kemal Koca, Aonghus McNabola, and R. Espina-Valdés. 2025. "Optimization and Machine Learning in Modeling Approaches to Hybrid Energy Balance to Improve Ports’ Efficiency" Applied Sciences 15, no. 9: 5211. https://doi.org/10.3390/app15095211

APA Style

Ramos, H. M., Coelho, J. S. T., Bekci, E., Adrover, T. X., Coronado-Hernández, O. E., Perez-Sanchez, M., Koca, K., McNabola, A., & Espina-Valdés, R. (2025). Optimization and Machine Learning in Modeling Approaches to Hybrid Energy Balance to Improve Ports’ Efficiency. Applied Sciences, 15(9), 5211. https://doi.org/10.3390/app15095211

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop