Open Access
ARTICLE
Demand Forecasting of a Microgrid-Powered Electric Vehicle Charging Station Enabled by Emerging Technologies and Deep Recurrent Neural Networks
1 Department of Computer and Network Engineering, College of Computer Science and Engineering, University of Jeddah, Jeddah, 21959, Saudi Arabia
2 The International Centre for Theoretical Physics, Trieste University, Trieste, 34151, Italy
3 Faculty of Science and Technology, University of Jijel, Jijel, 18000, Algeria
4 Department of Civil Engineering, College of Engineering, Northern Border University, Arar, 1321, Saudi Arabia
5 SAMATWAIQ for Drones Company, Prince Sultan Road, Jeddah, 23621, Saudi Arabia
6 Physics Department, Faculty of Science, Islamic University of Madinah, Madinah, 42351, Saudi Arabia
7 Department of Electrical Engineering, College of Engineering, Northern Border University, Arar, 91431, Saudi Arabia
8 Center for Scientific Research and Entrepreneurship, Northern Border University, Arar, 73213, Saudi Arabia
* Corresponding Authors: Sahbi Boubaker. Email: ; Adel Mellit. Email:
(This article belongs to the Special Issue: Advances in Deep Learning for Time Series Forecasting: Research and Applications)
Computer Modeling in Engineering & Sciences 2025, 143(2), 2237-2259. https://doi.org/10.32604/cmes.2025.064530
Received 18 February 2025; Accepted 30 April 2025; Issue published 30 May 2025
Abstract
Electric vehicles (EVs) are gradually being deployed in the transportation sector. Although they have a high impact on reducing greenhouse gas emissions, their penetration is challenged by their random energy demand and difficult scheduling of their optimal charging. To cope with these problems, this paper presents a novel approach for photovoltaic grid-connected microgrid EV charging station energy demand forecasting. The present study is part of a comprehensive framework involving emerging technologies such as drones and artificial intelligence designed to support the EVs’ charging scheduling task. By using predictive algorithms for solar generation and load demand estimation, this approach aimed at ensuring dynamic and efficient energy flow between the solar energy source, the grid and the electric vehicles. The main contribution of this paper lies in developing an intelligent approach based on deep recurrent neural networks to forecast the energy demand using only its previous records. Therefore, various forecasters based on Long Short-term Memory, Gated Recurrent Unit, and their bi-directional and stacked variants were investigated using a real dataset collected from an EV charging station located at Trieste University (Italy). The developed forecasters have been evaluated and compared according to different metrics, including R, RMSE, MAE, and MAPE. We found that the obtained R values for both PV power generation and energy demand ranged between 97% and 98%. These study findings can be used for reliable and efficient decision-making on the management side of the optimal scheduling of the charging operations.Keywords
As urban mobility evolves, particularly with the increasing adoption of electric vehicles (EVs), the induced massive infrastructure development has led to both opportunities and challenges [1]. The concentration of EVs in such large-scale facilities has imposed the urgent need for efficient traffic management systems. The main objective behind those management systems is to prevent congestion and optimize vehicle routing [2]. Moreover, the growing EV fleet requires strategic planning for sufficient and efficient charging infrastructure, which may alleviate range anxiety and ensure seamless mobility. The complexity of EV charging systems requires synchronized operation of multiple components for efficient energy distribution. To ensure optimal operation, the huge charging infrastructure, along with its interacting stakeholders, calls for innovative solutions. Recent advances in drone technology, artificial intelligence (AI), and edge computing offer promising approaches to optimize this complex ecosystem [3]. The widespread adoption of EVs presents unique infrastructure challenges that extend beyond simply connecting vehicles to charging stations. While EVs offer promising environmental benefits, mainly in reducing greenhouse gas emissions, their successful integration into existing transportation ecosystems requires careful consideration of infrastructure deployment, demand management, and grid stability [4]. This is particularly critical in rapidly growing metropolitan areas like Jeddah and Riyadh (Saudi Arabia). In fact, those urban areas are characterized by population density and expanding mobility, which creates additional complexity in infrastructure planning [5]. The design of road networks should carefully consider optimally placing new charging stations in addition to the efficient management of the existing EV charging facilities. The derived integrated system may allow not only easy accessibility to charging facilities but also the prevention of road network congestion and the optimization of grid utilization.
To address the above-cited challenges, aggregators serve as intermediaries, orchestrating the delicate balance between charging demand and grid capacity. Their role becomes increasingly important as the number of EVs grows, necessitating sophisticated approaches to load management and charging schedule optimization [6]. In this context, emerging technologies offer innovative solutions. A fleet of drones can be deployed for real-time infrastructure monitoring, crowd surveying and management, preventive maintenance support, and potentially, emergency charging support in underserved areas [7]. These operations are coordinated through central control systems that process real-time data from multiple sources. However, the success of this ecosystem relies heavily on collaborative efforts among diverse stakeholders. Utility companies, regulatory bodies, and charging network operators should align their efforts to address grid stability, charging station distribution, and renewable energy integration [8]. This multi-stakeholder approach, supported by seamless communication protocols, is essential for building a reliable, scalable, and sustainable EV charging infrastructure. Recently, common practices involving microgrids (MGs) at the charging stations have been adopted. In MGs, the objective of the energy management system (EMS) is to provide operational reference signals for MG units. Additionally, an efficient EMS should ensure communication between the system components, aiming for bi-directional transfer of the energy between the EVs, the grid, and the MGs [9,10]. Renewable energy-based microgrids, particularly those incorporating photovoltaic systems, provide multiple benefits, including greenhouse gas emissions reduction, power support for voltage profile improvement, decentralization of energy supply, heat load integration for cogeneration, ancillary services, and demand response mechanisms [11].
In the context of integrated energy management involving MGs, accurate forecasting of the EVs’ energy demand is critical for need satisfaction. In fact, accurate forecasts may allow a balance between production and consumption. As is well known, classical electricity can’t be stored and therefore should be used at the same time as its production. Despite the advancements in energy storage technologies, the issues of storage capacity and cost continue to pose significant challenges that require extensive investigation. Under these challenging conditions, the prediction accuracy of electric vehicle demand profiles facilitates efficient resource allocation between traditional grid and photovoltaic microgrid systems. Within the complex ecosystem of EV charging infrastructure, this paper specifically explores photovoltaic microgrid forecasting techniques, considering interactions with drone systems, aggregation services, and grid operations. Station-specific forecasting is essential across the urban charging network, as individual locations exhibit unique characteristics in terms of technical configuration, capacity limitations, historical usage data, and customer behavior patterns. The whole charging process is both random and complex since EV energy use depends on multiple factors, including, among others, the driver’s behavior and the road network complexity.
Due to the stochastic nature of EV charging demand coupled with critical scheduling requirements, accurate forecasting methodologies are needed for charging facilities. The development of reliable forecasters is contingent upon various factors, including the dataset’s quality and the computational resources. The design of an accurate and effective PV power generation and energy demand forecasting model is fundamental for the operational effectiveness of PV-integrated EV charging stations. It ensures efficient energy management, enhances battery storage, grid stability, and economic benefits. In this context, many forecasting methods and techniques were developed in the literature with variable levels of accuracy. The developed approaches range from traditional statistical techniques to more sophisticated methods, including machine learning (ML) and deep learning (DL).
Traditional statistical models, including autoregressive moving-average (ARMA), autoregressive integrated moving-average (ARIMA), and seasonal ARIMA (SARIMA), were used to forecast the power consumption for EV charging stations [12]. The results indicated that the SARIMA performs better than the ARMA and ARIMA models. Statistical methods are constrained by their requirement for stationary data, which poses limitations when analyzing microgrid energy and EV charging demand patterns due to their inherent complexity and multi-factorial dependencies. Moreover, statistical techniques are more suitable for detecting trends in data due to their structure. For instance, ARMA models and their derivatives are usually based on previous observations and generate the linear pattern of the ahead values. Therefore, these models fail to capture important nonlinear features, including energy data volatility.
In response to traditional modeling limitations, researchers have increasingly turned to AI solutions, including machine learning, deep learning, and hybrid approaches. For instance, study [13] developed a DNN-based framework for modeling EV energy demand patterns. The model was validated using a separate test dataset and compared to the traditional response surface approach to demonstrate their effectiveness. To increase prediction accuracy, the developed model included additional parameters. In [14], the authors discussed how PV solar power, MG storage, and EVs affect the maximum harvested solar radiation hours. The authors developed reinforcement learning (RL) algorithms and an RL home-centralized photovoltaic system to manage the energy demand between the smart MG elements. In another study [15], the authors developed a multi-EV charging/discharging scheduling strategy to prevent the peak load of MGs during EV charging and therefore decrease the operating cost of the PV-based charging station, with a focus on the power management of interdependent MG and EV fleets located in a charging station. It has been shown that the operating cost was decreased by 28.85% compared to the conventional EV charging/discharging scheduling algorithms.
In [16], the authors evaluated the performance of various ML algorithms based on recurrent neural networks (RNNs) and with different architectures to forecast the day-ahead electric vehicle power consumption in an EV charging station in Spain. To improve the results of the three algorithms, an ensemble method was proposed. In addition, the case study of the EV charging facility at the University of Trieste (Italy) [17] has shown through practical evaluations that the use of an EV is today feasible from both an environmental and an economic point of view while considering the energy and its cost constraints. In [18], four deep learning models, including Artificial Neural Network (ANN), Recurrent Neural Network (RNN), Long-Short Term Memory (LSTM), and Gate Recurrent Unit (GRU), were evaluated for predicting EV charging demand using 2000 charging event observations from public stations in Morocco. The results showed that the GRU model slightly outperformed the others, achieving an RMSE of 1.39% and an MAPE of 0.50% during training and 2.90% and 0.76% during testing.
A novel DL-based LSTM model optimized with the arithmetic optimization algorithm and enhanced using empirical mode decomposition for forecasting EV charging demand was proposed in [19]. The model addresses gradient issues common in recurrent neural networks and achieved a prediction accuracy of 97.14%, with a mean absolute error of 0.1083 and a root mean square error of 2.0628 × 10−5, tested on Georgia Tech’s EV charging dataset. The study [20] introduced the transformer model for predicting EV charging demand. Forecasts were generated for three time horizons: 7, 30, and 90 days, covering both short-term and long-term predictions. Performance evaluations using RMSE and MAE metrics showed that the transformer model outperformed other approaches, highlighting its effectiveness in addressing time series problems, particularly for EV charging forecasts. Various ML models based on RNNs, such as LSTM and GRU models, with different architectural configurations, were compared to evaluate their ability to predict the power curve of an EV charging station one day in advance. To further enhance the prediction capabilities, a Seq2Seq model was implemented, allowing the model to learn complex temporal dependencies from the data. A thorough analysis of an attention layer was conducted to investigate how attention mechanisms could improve model performance by focusing on important time steps in the sequence [21].
Based on the surveyed literature, attaining a high level of accuracy in energy production and consumption in the context of EV charging is case-sensitive. In fact, the accuracy depends on several factors related to the charging station itself, the available datasets (in terms of quality and size), the techniques/methods used, and the computational resources (hardware and software) utilized to design and implement the forecaster(s).
Predicting energy patterns for electric vehicle charging remains a complex challenge in today’s power systems. Research shows that achieving high accuracy in forecasting energy production and consumption at charging stations depends on multiple interconnected factors. The quality and size of available data play a crucial role, as do the specific characteristics of each charging station. Additionally, the choice of forecasting methods and the computational power behind them significantly influence prediction outcomes. This multi-faceted dependency makes each forecasting scenario unique, requiring carefully tailored approaches rather than one-size-fits-all solutions. To tackle these problems, trade-offs between the forecaster’s precision and the resources used, considering time constraints, will be highlighted through this paper.
This study introduces an innovative framework that reimagines the electric vehicle charging landscape across urban environments. By examining a complex ecosystem of distributed charging stations, the research leverages cutting-edge technologies, including drone systems, edge computing capabilities, and artificial intelligence, to enhance charging operations. At the heart of this investigation lies a micro-grid charging station, serving as a pilot system to demonstrate the framework’s effectiveness. The research’s primary contribution centers on the development and validation of a novel Energy Management System (EMS). This system creates a seamless interface between charging infrastructure, EV users, and various stakeholders, facilitating informed decision-making processes. The proposed EMS is designed with scalability in mind, recognizing that optimal efficiency can only be achieved through network-wide implementation. By establishing communication channels between charging stations and technological enablers—specifically drones and AI-powered computing systems—the framework paves the way for a more integrated and responsive charging infrastructure. This interconnected approach ensures that the benefits of the system can be realized across the entire urban charging network.
To achieve efficient scheduling of EV charging operations, the system proposed in this study integrates deep RNNs (DRNNs), including LSTM, deeper LSTM, Bidirectional-LSTM (Bi-LSTM), GRU, Bidirectional-GRU (Bi-GRU) networks, and other hybrid configurations (GRU-LSTM and LSTM-GRU), for forecasting EVs’ energy demand and PV power, enabling efficient scheduling of the charging events while considering the grid stability and the balance between the produced and needed energies.
The proposed approach stands out from existing works due to its usefulness, computational efficiency, and ease of implementation. Unlike many complex machine learning models that require extensive computational resources, our method is designed to be lightweight and adaptable for real-time deployment. The motivation behind employing DRNNs stems from their strong ability to capture temporal dependencies in time-series data, making them well-suited for addressing forecasting challenges and supporting real-time decision-making in EMSs. A key advantage of our approach is its straightforward architecture, which reduces system complexity while maintaining high forecasting accuracy. This design choice enhances the feasibility of real-time implementation, ensuring seamless integration with MG operations. In this study, we introduce an intelligent scheduling energy system that utilizes DRNNs to predict PV power generation and use for the next hour, enabling practical energy management. The system operates in conjunction with rule-based algorithms to ensure compliance with MG constraints and optimize energy distribution. The primary objective is to arrange the supply of locally generated PV power to EV charging stations and other consumers within the MG. In cases where PV power generation is insufficient to meet the demand, the system dynamically procures additional energy from the distribution network while minimizing operational costs and maintaining grid stability. By integrating advanced forecasting techniques with an adaptive energy scheduling framework, this approach enhances the overall efficiency and reliability of EV charging infrastructure.
As a summary, the contributions of the current study are provided as follows:
• A comprehensive framework for an EMS integrating emerging technologies, such as drones, edge computing, and AI, is presented. The roles of all key components within this framework have been thoroughly analyzed, emphasizing their contributions to efficient energy management and decision-making.
• Various forecasting models based on DNNs have been investigated to predict PV power generation and EV energy demand. These models include architectures such as LSTM, GRU, and hybrid configurations, ensuring accurate short-term energy forecasting. The benefits of those models, as well as their hyperparameter tuning, were detailed to allow them to be reproduced by other researchers working on EV charging scheduling and optimization.
• The developed forecasters have been evaluated within a real MG environment, assessing their performance in optimizing energy distribution and grid stability. Using measured data collected from an EV charging station at the University of Trieste (Italy), several insights about how to use the forecasted produced energy and the forecasted EVs’ needs to ensure a balanced and efficient energy management system for better scheduling the future load profiles.
The remainder of the paper is organized as follows. Section 2 provides the study methodology, including the research global framework, the PV-powered charging station, and the forecasting algorithms. Section 3 provides the study results and discussion. Finally, Section 4 includes the study conclusion, future directions, and recommendations.
2.1 Research Framework and System Architecture
The proposed EMS (as depicted in Fig. 1) integrates multiple physical components in a hierarchical architecture to enable efficient monitoring, control, and optimization of EV charging operations. The system architecture comprises five primary subsystems.

Figure 1: Proposed EMS physical components
The framework consists of five key components:
• Aerial Monitoring Unit: Autonomous drones equipped with high-resolution cameras and sensors to capture real-time visual and environmental data. Onboard edge computing enables localized processing, while secure communication ensures seamless data exchange.
• Smart Charging Infrastructure: Grid-connected charging stations support bidirectional power flow: vehicle-to-grid and grid-to-vehicle (V2G and G2V). Real-time monitoring and power management systems optimize load balancing and charging slot availability to enhance system stability.
• Electric Vehicle Interface: EVs communicate via a vehicle-to-infrastructure (V2I) system, providing real-time battery state-of-charge (SoC) data and user preferences for efficient charging coordination.
• Central Control System: This hub aggregates data, optimizes power flow, and employs predictive algorithms for scheduling and grid stability.
• Distributed Energy Resources (DER): Includes solar PV, battery storage, and microgrid connections to enhance resilience and maximize renewable energy use. Power quality management ensures stable energy distribution.
The system components detailed functionalities are more explicated in Fig. 2 below.

Figure 2: Specific functionalities of the overall framework by individual EMS physical components
The communication architecture (Fig. 3) implements a bidirectional data flow protocol to enable real-time system coordination. Aerial units transmit surveillance data to the microgrid controller for system status monitoring and demand forecasting while simultaneously relaying power availability metrics and load management instructions to charging stations.

Figure 3: Communication flow of the integrated EMS
These drones also communicate the charging optimization data directly to EVs, including recommended charging schedules and station assignments. The edge computing infrastructure manages power flow through discrete command channels: dispatching power allocation directives to the microgrid, coordinating charge/discharge cycles of storage systems, and regulating grid power exchange based on real-time demand and generation profiles. This hierarchical communication framework ensures efficient data exchange while minimizing latency in system response.
The structure of the MG EV charging station investigated is shown in Fig. 4a. It consists of a 3.9 kWp PV array, a 4.6 kVA inverter with 10 kWh lithium-ion phosphate batteries, an interface board performing the connection with the low-voltage (LV) 230 V grid, and a 22 kW charging station. An EMS optimizes the energy flows between the different parts of the MG, where the data are exchanged through the campus [22]. A photo of the real MG installed at the University of Trieste (Italy) is shown in Fig. 4b.

Figure 4: (a) Schematic structure of the MG. (b) Real photo of the MG at Trieste University, Italy
The dataset used in this study was collected throughout 2023, comprising measurements sampled every 5 min. Fig. 5 shows a sample of the collected data covering one month. The dataset includes the energy demanded by electric vehicles (Pcar), the power produced by the PV array (Ppv), the battery state of charge (SoC), the power exchanged with the grid (Pgrid), and the consumed power (Pcon).

Figure 5: Plots of the collected data: Ppv, SoC, Pcar, Pcon, and Pgrid as of January, 2023, with a 1-h time step
Fig. 6 shows the PV power and the car (EV) demand power, the autocorrelation plot, and the density plot. The autocorrelation plot may help to check the correlation of the series with its past values. A gradual decline in autocorrelation values across lags may indicate that past values influence the series over a long duration.

Figure 6: (a) The produced PV power and car demand power (strong annual seasonality and high autocorrelation at seasonal lags, i.e., peaks at roughly 365-day intervals) and (b) the corresponding autocorrelation plots (strong short-term autocorrelation at small lags and weekly seasonality, e.g., different charging behaviour on weekdays vs. weekends)
Fig. 6a shows the measured PV power and car demand over a 5-min time horizon across a one-year period. As shown in Fig. 6b, clear seasonality is observed in the case of PV power, while seasonality is less noticeable in the case of car demand. The developed model may intrinsically manifest biases stemming from anomalies or outliers within the dataset, as well as from variations in input data scales arising from disparate maximum ranges inherent to their diverse characteristics. Addressing these challenges necessitates data normalization, a critical step to attenuate the impact of outliers and ensure all features are harmonized to a consistent scale. To achieve this, the max-min normalization approach, as delineated in Eq. (1), is employed. Fig. 7 shows a sample of the normalized data.

Figure 7: Normalized data: (a) produced PV power and (b) EV demand power
The dataset was divided into two subsets used for model training and evaluation, respectively. 80% of the data was allocated for training the deep neural networks, allowing the models to learn patterns and relationships within the provided data. The remaining data (20%) was reserved to assess the models’ performance and generalization capability. This standard split was applied for both PV power generation and EV charging demand data. 20% of the data is tested as out-of-sample and was not used during the training phase.
Eight DRNN architectures (LSTM, GRU, BiGRU, BiLSTM, Stacked LSTM, Stacked GRU, hybrid LSTM-GRU, and GRU-LSTM) were utilized to develop forecasters for both PV power generation and EV power demand profiles, considering a 5-min horizon, which was the sampling time of the collected data.
The training process consists of four steps:
• Step #1: The input data passes through network layers, where hidden states and cell states are updated to capture temporal dependencies.
• Step #2: The calculated output is compared to the real target values using a loss function (e.g., MSE, MAE,. . .).
• Step #3: The gradients of the MSE function are computed and propagated forward and backward through the network.
• Step #4: The selected optimizers (e.g., Adam, Adamax, …) are used to adjust the weights of the network and compute gradients to minimize the loss.
• Step #5: The whole process is repeated over multiple epochs until the model reaches optimal performance.
As multiple factors may affect the energy demand on the user side and the energy production on the microgrid side, the study will not consider engineering feature usually used to measure the strength of the relationships between external factors that may affect the output variables, including energy production and needs. For instance, the driver behavior, the road congestion, the EV battery use, etc., are hard to measure parameters. In addition, cloud coverage, quality of the PV panel, among other factors, are also difficult to manage. The present paper developed models are deliberately chosen to be based only on historical observations of the energy. The assumption that all the hidden patterns are implicitly included in the historical observations, and they are therefore propagated through the deep neural network structure, known to efficiently handle historical time series, is used. The eight investigated DL structures are detailed below with a special focus on their mathematical formalism.
LSTM, a recurrent neural network (RNN), is specifically designed to capture long-term dependencies in sequential data by addressing the vanishing gradient problem that commonly affects standard RNNs. LSTMs are particularly effective for tasks such as time series forecasting, language modeling, and case studies with sequential data. By including LSTM cells as well as a dense output layer, the LSTM deep neural network is widely used in forecasting time series (see Fig. 8). Eqs. (2)–(7) describe the operation of the LSTM and how the information is processed from the input to the output, passing through the respective gates [23]:

Figure 8: Basic architecture of an LSTM deep neural network unit
A Gated Recurrent Unit (GRU) is a variant of RNN designed to process sequential data, such as time series, while addressing the vanishing gradient issue that traditional RNNs face (Fig. 9). As a simpler alternative to LSTM, GRU has fewer parameters and a more streamlined architecture, making it computationally more efficient yet still highly effective at capturing long-term dependencies in the data. The role of the newly introduced gates is to take a decision about the portion of information to be kept and therefore passed to the output. The operation of GRU is described by the set of Eqs. (8)–(11) [24].
where r is a reset gate, and z is an update gate.

Figure 9: Basic architecture of a GRU deep neural network
Bidirectional models such as Bi-LSTM or Bi-GRU demonstrate the capability to manipulate inputs from both directions, considering the past and the future timestamps (see Fig. 10). They can increase the amount of information available to the network and therefore improve the quality and quantity of data available to the algorithm [25].

Figure 10: Basic architecture of a BiGRU and BiLSTM deep neural network
Mathematically,
where f is either LSTM or GRU,
A stacked LSTM or GRU is a deep RNN architecture in which multiple LSTM or GRU layers are stacked on top of each other. The output of one LSTM or GRU layer serves as the input to the next layer, allowing the network to learn hierarchical temporal representations. This architecture enhances the model’s ability to capture complex patterns in sequential data by leveraging the depth of the network. Lower layers focus on extracting basic temporal features, while higher layers learn more abstract, high-level features [25]. Fig. 11 shows a basic structure of a stacked LSTM with a fully connected layer. By increasing the depth of the LSTM, it can capture more intricate patterns and long-range dependencies within the data, enhancing its effectiveness for tasks related to sequential or time series analysis.

Figure 11: Basic architecture of a stacked LSTM
2.4.5 Hybrid GRU-LSTM and LSTM-GRU
In the hybrid GRU-LSTM model, the GRU initially processes sequential input data, such as historical power output, utilizing its gating mechanisms to capture short-term patterns (see Fig. 12). The resulting output is then adapted to satisfy the input requirements of the LSTM, ensuring a seamless integration between the two networks. In the LSTM-GRU model, the LSTM first processes the sequential input data, such as historical power output, leveraging its advanced gating mechanisms to capture long-term dependencies and complex patterns. The output from the LSTM is then adjusted to fit the input requirements of the GRU, allowing for smooth integration between the two networks. The GRU then analyzes the integrated input to capture short-term patterns, refining the model’s ability to learn both short-term and long-term trends. By combining the LSTM’s long-term modeling strengths with the GRU’s short-term pattern recognition, this hybrid approach enhances overall forecasting accuracy. Hybrid models take advantage of the complementary strengths of LSTM and GRU, leading to better forecasting accuracy, especially in complex and dynamic environments like energy prediction, natural language processing, or other sequential data tasks.

Figure 12: Example of architecture of an LSTM-GRU
To evaluate the accuracy of the developed forecasters, the following performance metrics: correlation coefficient (R), root-mean-squared error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE)—have been used.
where n is the number of samples used for the test step, xi and yi are the measured and forecasted values, respectively, and
The experiments were carried out on a laptop equipped with an i7-12650H microprocessor and a clock frequency of 2.30 GHz, 32 GB of RAM, a GPU of DDR3 RAM, and an Nvidia GeForce RTX4060.
For both developed PV power generation and EV demand power forecasting models, the input consists of historical data, while the output corresponds to future values for the next time step. The forecasting models explored include various DRNN architectures as described, including GRU, LSTM, BiLSTM, BiGRU, stacked LSTM, and stacked GRU, and hybrid models like LSTM-GRU and GRU-LSTM.
The optimized parameters for each model configuration, derived from these simulations, are presented in Table 1. To determine the optimal set of hyperparameters for each investigated model, we employed the grid search technique for systematic testing of a wide range of hyperparameter combinations to achieve the best forecasting performance.

The range and values of the hyperparameters for the grid search method are as follows: Number of units {50, 100, 150, 200}, layers {1, 2, 3}, optimizers [SGD, RMSprop, Adam, Adamax], dropout {0.2, 0.3, 0.4, 0.5, 0.6}, batch size {32, 64, 64,128}, loss functions {MAE, MSE, MAPE} and epoch {50, 100, 150}.
Fig. 13a illustrates the variation of the loss function during the training phase, showing convergence to a minimal loss value of approximately 0.001 which indicates effective model learning and strong generalization capability. The stability of the loss curve further suggests that the model avoided common training issues such as overfitting or underfitting. Fig. 13b presents a scatter plot depicting a strong positive correlation between the measured and predicted PV power values, demonstrating the model’s high accuracy in capturing data relationships. Upon closer examination of the zoomed section in Fig. 13c, it becomes evident that the proposed model effectively captures the detailed fluctuations in PV power generation, successfully tracking both short-term variations and long-term trends with high precision.

Figure 13: Predicted power using the LSTM model: (a) Loss function, (b) scatter plot, (c) superposition of measured and predicted Ppv and zoomed-in curve
Fig. 14 compares the measured and forecasted PV power profiles over a sequence of 1000 samples (equivalent to 5000 min). The visual inspection shows a close alignment between observed and predicted power values, with no significant deviations across the examined models. This consistency underscores the models’ robustness and reliability in handling dynamic power variations. Table 2 presents the computed error metrics, including R, RMSE, MAE, and MAPE, for the evaluated forecasting models. The results show that all models deliver comparable predictive accuracy, with minor variations. The Bi-GRU model achieves a slightly higher correlation coefficient (R), indicating marginally better predictive performance. However, the LSTM and GRU models exhibit key advantages in computational efficiency, including lower complexity, faster execution times, and reduced implementation costs. These computational benefits make the LSTM and GRU architectures particularly suitable for real-time applications, such as MG control and energy management systems. In these scenarios, maintaining a balance between predictive accuracy and computational efficiency is crucial for ensuring seamless operation and optimized energy distribution.

Figure 14: Comparison of measured and forecasted Pv power profiles for the evaluated DRNN models over a sequence of 1000 samples

Regarding the developed models for forecasting EV charging demand, multiple models have been assessed to ensure robust forecasting performance. Fig. 15a depicts the variation of the loss function during the training process, demonstrating the model’s convergence to a minimal loss value of approximately 0.001, indicating effective learning and strong generalization capabilities. Fig. 15b presents a scatter plot showing a strong positive correlation between the measured and predicted EV power values, reinforcing the model’s predictive accuracy. A detailed inspection of the zoomed section in Fig. 15c further validates the model’s ability to capture intricate patterns in PV power generation profiles. The model effectively tracks both sudden fluctuations and gradual changes, demonstrating its capacity to adapt to dynamic power variations. These findings highlight the model’s reliability for practical applications in real-time energy forecasting and smart grid management. It can be seen from Fig. 16 that the BiGRU, LSTM-GRU, and stacked LSTM present good correlations.

Figure 15: Predicted car power using the BiGRU model: (a) Loss function, (b) scatter plot, (c) superposition of measured and predicted Pcar, along with the corresponding zoomed-in curve

Figure 16: Comparison between measured and forecasted EV demand for the investigated models
Table 3 presents the performance metrics (R, RMSE, MAE, and MAPE) used to evaluate the forecasting models. The results reveal no significant differences in predictive accuracy among the models; however, the BiGRU model slightly outperforms the others by achieving a higher correlation coefficient (R), indicating a more precise relationship between the predicted and actual values. Despite this advantage, the LSTM and GRU models excel in computational efficiency, offering several key benefits, including lower algorithmic complexity, faster execution times, and reduced resource requirements. These attributes make them particularly suitable for real-time applications where a balance between predictive accuracy and computational efficiency is critical. Examples include microgrid control systems, dynamic energy management strategies, and distributed energy resource optimization. The lower implementation costs further enhance their appeal for large-scale deployment in smart grid environments, where scalability and cost-effectiveness are essential factors.

4 Conclusions and Future Directions
Accurate demand forecasting is essential for creating efficient, cost-effective, and sustainable EV charging schedules. It benefits consumers, charging station operators, and grid managers, ensuring a smooth transition to widespread EV adoption. It also helps users and operators minimize costs by scheduling charging when electricity prices are low. In addition, accurate demand forecasting allows EV charging to be synchronized with solar PV availability. Furthermore, smart charging schedules based on demand forecasts can reduce battery degradation by avoiding excessive rapid charging. To achieve the previous goals and contribute to solving the numerous challenges arising from the extensive deployment of EVs, this work first presents a comprehensive framework using emerging technologies such as drones and AI to optimize the scheduling of EV charging. The increasing penetration of EVs in energy systems introduces challenges related to load balancing, grid stability, and efficient charging, necessitating intelligent solutions.
To address the challenges associated with accurate energy forecasting, several advanced forecasting models based on DRNNs have been developed and rigorously evaluated. These models were specifically designed to predict critical input variables for the microgrid, including PV power generation and the fluctuating demand for EV charging. Given the dynamic nature of both PV power output and EV charging demand, strongly influenced by factors such as time of day, weather conditions, and user behaviour, accurate forecasting is essential for the effective operation of energy management systems (EMSs). The developed DRNN-based forecasting models exhibited a high level of predictive accuracy, with error rates ranging between 2% and 3% and overall accuracy levels between 97% and 98%. These results demonstrate the ability of the models to reliably anticipate both PV power generation and EV charging demand, thereby enhancing the microgrid’s efficiency. By minimizing energy waste, improving resource coordination, and ensuring a stable energy supply-demand balance, these models contribute significantly to the optimization of microgrid performance.
These findings offer a comprehensive decision-making tool for electricity regulatory authorities at the investigated site. They contribute to improving forecasting accuracy, enabling more efficient energy dispatching and better management of electricity demand. The results support strategic planning for the development of new public charging stations, which is essential to accommodate the growing adoption of EVs and reduce charging congestion. Furthermore, they play a crucial role in enhancing the maintenance and operational efficiency of existing charging infrastructure. By providing a deeper understanding of the grid impact of EV integration, the study helps in ensuring grid stability, optimizing resource allocation, and advancing sustainable energy initiatives.
In the future, we aim to expand our study by evaluating the impact of vehicle-to-grid (V2G) and battery-to-grid (B2G) integration on the EMS. This will involve analysing how bidirectional energy flow between EVs, stationary battery storage, and the grid influences overall system performance, efficiency, and stability. Specifically, we plan to investigate how V2G and B2G capabilities can enhance grid resilience by allowing EVs and battery storage systems to supply power back to the grid during peak demand periods, reducing reliance on conventional energy sources, and improving load balancing. Additionally, we will explore how these technologies affect the scheduling of EV charging operations, considering factors such as charging/discharging cycles, battery degradation, energy pricing, and grid constraints. To achieve these objectives, we intend to develop an advanced optimization framework that integrates V2G and B2G functionalities within the EMS.
Acknowledgement: This work was funded by the University of Jeddah, Jeddah, Saudi Arabia, under grant No. (UJ-23-SRP-10). The authors, therefore, thank the University of Jeddah for its technical and financial support. The authors would like to thank Dr. A. Massi Pavan (University of Trieste, Italy) for providing the dataset used in this study.
Funding Statement: University of Jeddah, Jeddah, Saudi Arabia, grant No. (UJ-23-SRP-10).
Author Contributions: The authors confirm their contribution to the paper as follows: Conceptualization, Sahbi Boubaker, Walid Meskine, Adel Mellit and Mohamed Benghanem; Data curation, Habib Kraiem; Formal analysis, Mohamed Benghanem and Adel Mellit; Funding acquisition, Sahbi Boubaker; Investigation, Nejib Ghazouani and Sahbi Boubaker; Methodology, Adel Mellit, Sahbi Boubaker and Mohamed Benghanem; Project administration, Sahbi Boubaker; Resources, Sahbi Boubaker and Walid Meskine; Software, Adel Mellit and Mohamed Benghanem; Supervision, Sahbi Boubaker; Validation, Mohamed Benghanem, Adel Mellit and Sahbi Boubaker; Writing—original draft, Adel Mellit, Sahbi Boubaker and Nejib Ghazouani; Writing—review & editing, Mohamed Benghanem and Habib Kraiem. All authors reviewed the results and approved the final version of the manuscript.
Availability of Data and Materials: The data supporting the findings of this study are not publicly available due to their owner internal restrictions.
Ethics Approval: Not applicable.
Conflicts of Interest: The authors declare no conflicts of interest to report regarding the present study.
References
1. Liu Y, Jian L, Jia Y. Energy management of green charging station integrated with photovoltaics and energy storage system based on electric vehicles classification. Energy Rep. 2023;9(1):1961–73. doi:10.1016/j.egyr.2023.04.099. [Google Scholar] [CrossRef]
2. Elfaki AO, Messoudi W, Bushnag A, Abuzneid S, Alhmiedat T. A smart real-time parking control and monitoring system. Sensors. 2023;23(24):9741. doi:10.3390/s23249741. [Google Scholar] [PubMed] [CrossRef]
3. Patil P, Kazemzadeh K, Bansal P. Integration of charging behavior into infrastructure planning and management of electric vehicles: a systematic review and framework. Sustain Cities Soc. 2023;88(6):104265. doi:10.1016/j.scs.2022.104265. [Google Scholar] [CrossRef]
4. Sadeghian O, Oshnoei A, Mohammadi-ivatloo B, Vahidinasab V, Anvari-Moghaddam A. A comprehensive review on electric vehicles smart charging: solutions, strategies, technologies, and challenges. J Energy Storage. 2022;54:105241. doi:10.1016/j.est.2022.105241. [Google Scholar] [CrossRef]
5. Al-fouzan AA, Almasri RA. A sustainable solution for urban transport using photovoltaic electric vehicle charging stations: a case study of the city of hail in Saudi Arabia. Appl Sci. 2024;14(13):5422. doi:10.3390/app14135422. [Google Scholar] [CrossRef]
6. Eid C, Codani P, Chen Y, Perez Y, Hakvoort R. Aggregation of demand side flexibility in a smart grid: a review for European market design. In: 2015 12th International Conference on the European Energy Market (EEM); 2015 May 19–22; Lisbon, Portugal. 2015. p. 1–5. doi:10.1109/EEM.2015.7216712. [Google Scholar] [CrossRef]
7. Jemmali M, Melhim LKB, Alharbi MT, Bajahzar A, Omri MN. Smart-parking management algorithms in smart city. Sci Rep. 2022;12(1):6533. doi:10.1038/s41598-022-10076-4. [Google Scholar] [PubMed] [CrossRef]
8. Das HS, Rahman MM, Li S, Tan CW. Electric vehicles standards, charging infrastructure, and impact on grid integration: a technological review. Renew Sustain Energy Rev. 2020;120(3):109618. doi:10.1016/j.rser.2019.109618. [Google Scholar] [CrossRef]
9. Ma J, Ma X. A review of forecasting algorithms and energy management strategies for microgrids. Syst Sci Control Eng. 2018;6(1):237–48. doi:10.1080/21642583.2018.1480979. [Google Scholar] [CrossRef]
10. Zia MF, Elbouchikhi E, Benbouzid M. Microgrids energy management systems: a critical review on methods, solutions, and prospects. Appl Energy. 2018;222(6):1033–55. doi:10.1016/j.apenergy.2018.04.103. [Google Scholar] [CrossRef]
11. Bouhedir R, Mellit A, Benghanem M, Hassan B. Optimal energy management strategy for electric vehicle charging station based on tied photovoltaic system. Comput Electr Eng. 2025;121:109875. doi:10.1016/j.compeleceng.2024.109875. [Google Scholar] [CrossRef]
12. Akshay KC, Grace GH, Gunasekaran K, Samikannu R. Power consumption prediction for electric vehicle charging stations and forecasting income. Sci Rep. 2024;14(1):6497. doi:10.1038/s41598-024-56507-2. [Google Scholar] [PubMed] [CrossRef]
13. Topić J, Škugor B, Deur J. Neural network-based modeling of electric vehicle energy demand and all electric range. Energies. 2019;12(7):1396. doi:10.3390/en12071396. [Google Scholar] [CrossRef]
14. Almughram O, Abdullah ben Slama S, Zafar BA. A reinforcement learning approach for integrating an intelligent home energy management system with a vehicle-to-home unit. Appl Sci. 2023;13(9):5539. doi:10.3390/app13095539. [Google Scholar] [CrossRef]
15. Jin H, Lee S, Nengroo SH, Har D. Development of charging/discharging scheduling algorithm for economical and energy-efficient operation of multi-EV charging station. Appl Sci. 2022;12(9):4786. doi:10.3390/app12094786. [Google Scholar] [CrossRef]
16. Gómez-Quiles C, Asencio-Cortés G, Gastalver-Rubio A, Martínez-Álvarez F, Troncoso A, Manresa J, et al. A novel ensemble method for electric vehicle power consumption forecasting: application to the Spanish system. IEEE Access. 2019;7:120840–56. doi:10.1109/ACCESS.2019.2936478. [Google Scholar] [CrossRef]
17. Pavan AM, Lughi V, Scorrano M. Total cost of ownership of electric vehicles using energy from a renewable-based microgrid. In: 2019 IEEE Milan Power Tech; 2019 Jun 23–27; Milan, Italy. 2019. p. 1–6. doi:10.1109/ptc.2019.8810736. [Google Scholar] [CrossRef]
18. Boulakhbar M, Farag M, Benabdelaziz K, Kousksou T, Zazi M. A deep learning approach for prediction of electrical vehicle charging stations power demand in regulated electricity markets: the case of Morocco. Clean Energy Syst. 2022;3(6):100039. doi:10.1016/j.cles.2022.100039. [Google Scholar] [CrossRef]
19. Shanmuganathan J, Victoire AA, Balraj G, Victoire A. Deep learning LSTM recurrent neural network model for prediction of electric vehicle charging demand. Sustainability. 2022;14(16):10207. doi:10.3390/su141610207. [Google Scholar] [CrossRef]
20. Koohfar S, Woldemariam W, Kumar A. Prediction of electric vehicles charging demand: a transformer-based deep learning approach. Sustainability. 2023;15(3):2105. doi:10.3390/su15032105. [Google Scholar] [CrossRef]
21. Matrone S, Ogliari E, Nespoli A, Leva S. Electric vehicle supply equipment day-ahead power forecast based on deep learning and the attention mechanism. IEEE Trans Intell Transp Syst. 2024;25(8):9563–71. doi:10.1109/TITS.2024.3391375. [Google Scholar] [CrossRef]
22. Mellit A, Pavan AM, Lughi V. Deep learning neural networks for short-term photovoltaic power forecasting. Renew Energy. 2021;172(2):276–88. doi:10.1016/j.renene.2021.02.166. [Google Scholar] [CrossRef]
23. Boubaker S, Benghanem M, Mellit A, Lefza A, Kahouli O, Kolsi L. Deep neural networks for predicting solar radiation at hail region, Saudi Arabia. IEEE Access. 2021;9:36719–29. doi:10.1109/ACCESS.2021.3062205. [Google Scholar] [CrossRef]
24. Dey R, Salem FM. Gate-variants of gated recurrent unit (GRU) neural networks. In: 2017 IEEE 60th International Midwest Symposium on Circuits and Systems (MWSCAS); 2017 Aug 6–9; Boston, MA, USA. 2017. p. 1597–600. doi:10.1109/MWSCAS.2017.8053243. [Google Scholar] [CrossRef]
25. Gamboa JCB. Deep learning for time-series analysis. arXiv:1701.01887. 2017. [Google Scholar]
Cite This Article
Copyright © 2025 The Author(s). Published by Tech Science Press.This work is licensed under a Creative Commons Attribution 4.0 International License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.


Submit a Paper
Propose a Special lssue
View Full Text
Download PDF
Downloads
Citation Tools