ORIGINAL RESEARCH article

Front. Energy Res., 13 November 2025

Sec. Smart Grids

Volume 13 - 2025 | https://doi.org/10.3389/fenrg.2025.1681139

Smart meter-based demand forecasting for energy management using supercapacitors

  • 1. Faculty of Systems, Electronics and Industrial Engineering, Universidad Técnica de Ambato, Ambato, Ecuador

  • 2. Department of Electrical Engineering, University of Jaén, Linares, Spain

  • 3. Department of Electrical Engineering, Electronics, and Telecommunications (DEET), Universidad de Cuenca, Cuenca, Ecuador

  • 4. Department of Electrical Engineering and Applied Physics, Faculty of Electrical Engineering and Computer Science, Transilvania University of Brasov, Brasov, Romania

Abstract

The smart grid paradigm has introduced new capabilities for monitoring and managing intelligent energy systems. In this context, IoT environments integrate smart sensors and devices to record electricity consumption and production in real time. This article proposes a methodological framework for energy management that incorporates real-time data processing, predictive modelling, and supercapacitor-based storage control to address short-term power fluctuations caused by load variability. The proposed approach is implemented in three phases. First, demand data are collected using a smart meter, with measurements stored on a local server. In the second phase, the data are processed to develop a forecasting model based on a Wide Neural Network, which updates autonomously. In the final phase, energy management is performed using a demand smoothing algorithm and a supercapacitor charge/discharge control mechanism. The forecasting performance was assessed through a comparative analysis of neural network models. The WNN achieved a correlation coefficient of 0.94 and a mean absolute percentage error of 6.3%. These results were obtained in a real-time processing environment and demonstrate the model’s ability to generalize under variable load conditions. In addition, the proposed system enables direct control of the storage system’s state of charge based on forecasted demand and a predefined power reference. Experimental validation was conducted in a prototype setup integrating smart metering, data acquisition, and automated response capabilities.

1 Introduction

The sustained growth in global electricity demand has prompted the development of strategies to improve the efficiency of generation, transmission, and distribution processes (Nespoli and Medici, 2025; Laurencio et al., 2024). Concurrently, the increasing integration of renewable energy sources has led to more decentralized power systems, bringing generation closer to consumption points and significantly reducing transport-related energy losses (Arévalo et al., 2025). In this context, enhancing the operational autonomy of power systems is essential for better energy planning and real-time management.

Accurate modelling and forecasting of demand behavior are therefore strategic for optimizing energy resource usage and for supporting resilient and sustainable system operations (Dewangan et al., 2023). The use of smart meters (SMs), together with Advanced Metering Infrastructure (AMI), enables detailed and continuous monitoring of electricity consumption, generating high-resolution time series suitable for forecasting models (Li et al., 2011; Weranga et al., 2012). These technologies also facilitate demand-side management by identifying peak usage periods and notifying users or control systems to prevent overloads and reduce costs (Komatsu and Kimura, 2020).

Short-term electricity demand forecasting (STDF) has traditionally been classified into static and dynamic models. Static models—such as polynomial interpolation—have been integrated into SM-based systems for real-time decision-making, especially in industrial settings where load patterns are relatively stable over short periods (Weranga et al., 2012). These models can be embedded directly into metering hardware, enabling rapid responses and alerts without relying on external computation.

The significance of STDF has been highlighted in recent studies, particularly for its role in minimizing technical losses, improving billing precision, and supporting optimal operation under time-of-use tariff schemes (Li et al., 2011; Komatsu and Kimura, 2020). Furthermore, the deployment of AMI systems has expanded the capabilities of forecasting models by incorporating environmental and behavioral factors, such as weather conditions, appliance usage, and regional consumption profiles (Miyasawa et al., 2021). These developments have supported the evolution of more advanced forecasting techniques based on artificial intelligence.

When integrated with machine learning methods, data streams from SMs can enhance predictive models in complex, non-linear environments (Ali et al., 2024). In particular, the use of non-parametric, AI-based models in combination with smart metering has shown strong potential for improving load forecasts and supporting demand-side energy control strategies.

This study presents a methodological framework for real-time demand forecasting and energy smoothing using SMs and supercapacitors. The proposed approach comprises three stages: data acquisition via smart metering, demand prediction using a Wide Neural Network (WNN), and implementation of a smoothing model based on supercapacitors to mitigate power fluctuations. The system has been experimentally validated in a microgrid testbed.

1.1 Literature review

Recent studies have examined the integration of smart meters (SMs) with machine learning techniques to improve load forecasting. For example, Mehdipour Pirbazari et al. (2020) conducted a systematic comparison of four machine learning algorithms—Artificial Neural Networks (ANNs), Support Vector Machines (SVM), Classification and Regression Trees (CART), and Long Short-Term Memory (LSTM)—applied to hourly residential energy consumption data. As a general foundation, classical works on ANNs such as Haykin (2009) offer a structured description of supervised and unsupervised learning, activation functions, training strategies, and convergence behavior, providing the theoretical underpinnings for later applications in energy demand forecasting. Building on this theoretical base, more recent surveys such as Dini and Paolini (2025) show how ANN models are applied in battery management, particularly for estimating the state of charge of EV and HV batteries. Their adaptability to complex, nonlinear patterns of electrochemical systems demonstrates the transferability of ANN approaches to different domains of energy management, including demand prediction, since both involve real-time assessment of dynamic variables under uncertain operating conditions. At the same time, broader reviews like Barbierato and Gatti (2024) remind that while ANN models achieve high predictive accuracy, their opaque decision-making process raises questions about interpretability. This issue is theoretical in nature and has practical implications in power system applications, where transparency of forecasting and control models is important for trust, validation, and operational accountability. Together, these perspectives connect the conceptual foundation, practical applications, and methodological challenges of ANNs, situating their role within demand forecasting frameworks that combine predictive modeling and real-time control.

Distributed learning techniques have also been investigated. For instance, the FedAVG-based approach in Fekri et al. (2022) improved prediction accuracy while minimizing communication overhead. Hybrid architectures such as LSTM-XGBoost have outperformed standalone configurations in several cases (Dewangan et al., 2023), and autoregressive neural networks have been successfully applied to predict harmonic distortion from SM data (Rodríguez-Pajarón et al., 2022). Additionally, recurrent neural networks such as Bi-LSTM and GRU have been used to address overfitting in high-dimensional datasets and to enhance forecast precision (Steephen et al., 2023). More recent contributions extend this line of work toward transformer-based forecasting, where attention mechanisms capture long-term dependencies in load patterns and probabilistic schemes quantify forecasting uncertainty (Hu et al., 2024). In parallel, NILM-oriented research has advanced through transformer-enhanced models, showing improved disaggregation of aggregated demand signals and enabling better representation of appliance-level dynamics (Rong et al., 2025). Further developments integrate NILM with smart grid management, where transformer-based algorithms support the analysis of flexible loads and electric vehicle charging, linking detailed consumption patterns with operational cost optimization (Yang et al., 2025).

A time-series decomposition method using parametric modeling was proposed by Mondal and Das (2023) to analyze residential consumption patterns in London. Their findings highlighted the sensitivity of model calibration to seasonal and cyclical variations. In another study, Neupane et al. (2024) trained a neural network model using AMI data from a distribution system in Nepal, reporting robust performance across diverse load types and climatic conditions. Incorporating temperature and temporal variables was found to significantly improve short-term forecasting.

From a spatial analysis perspective, Miyasawa et al. (2021) introduced a geo-referenced forecasting framework using SM data, where spatial granularity was used as a clustering criterion for regional optimization. In parallel, Abera and Khedkar (2020) addressed appliance-level consumption forecasting with a focus on feature engineering and correlation-based variable selection to reduce computational complexity. More recent studies have explored non-intrusive load monitoring approaches that employ transformer networks to improve the disaggregation of household and commercial demand. For example, transfer learning strategies have been incorporated into transformer-based NILM models to enhance generalization across diverse load types, reducing the need for large annotated datasets while maintaining high predictive accuracy. Likewise, new serial multi-task transformer algorithms have been introduced to analyze cyclical dependencies in household demand, enabling the separation of EV charging and other flexible loads from aggregate smart meter data. These advances demonstrate how disaggregation techniques enrich the quality of input signals available for short-term demand forecasting, connecting appliance-level analysis with broader system-level management (Rong et al., 2025; Yang et al., 2025).

Evolutionary algorithms have also been employed to train neural networks for load prediction in smart grids, as discussed in Kumar et al. (2025a). Related developments include adaptive probabilistic models with architecture tuning (Wang et al., 2022) and hybrid frameworks such as ADELA (Kumar et al., 2025b). Techniques like singular value decomposition (SVD), K-shape clustering, and empirical mode decomposition (EMD) have been applied to improve data preprocessing and input representation in Bi-LSTM-based models (Cao et al., 2023).

Finally, the EDF-FMLA model presented by Ghazal et al. (2021), which integrates IoT-based SMs with deep extreme learning and automatic load control, achieved a prediction accuracy of 90.70%, exceeding that of traditional models. Collectively, these contributions reflect a transition from conventional statistical methods to more complex, hybrid deep learning models closely linked with real-time metering infrastructure.

Table 1 provides a comparative synthesis of recent contributions and identifies key research gaps.

TABLE 1

Author (Year)Key contributionStrengthsTopics partially or not addressed
Mehdipour Pirbazari et al. (2020)Comparison of ML models (ANN, SVM, CART, LSTM) for residential load forecastingSystematic benchmarking, strong LSTM performanceNo energy smoothing or hardware implementation
Khan et al. (2020)Clustering-integrated load forecasting for peak demand mitigationAdaptability to variable consumption patternsLacks integration with real-time control systems
Fekri et al. (2022)Federated learning (FedAVG) for load forecasting using SM dataEnhances privacy and reduces communication overheadNo demand-side corrective action or smoothing
Dewangan et al. (2023)Taxonomy of smart grid load forecasting modelsBroad review of hybrid architecturesNo experimental or real-time validation
Rodríguez-Pajaron et al. (2022)Neural forecasting for THD and demand decompositionPower quality estimation via autoregressive modelsFocused on THD, not on energy storage or peak mitigation
Steephen et al. (2023)Deep learning for smart homes (Bi-LSTM, GRU)Robustness against nonlinear and volatile loadsLacks hardware interface and operational integration
Mondal and Das (2023)Parametric time-series modeling using London SM dataDecomposition of seasonal and cyclical demand trendsNo real-time forecasting or adaptive smoothing
Neupane et al. (2024)ANN-based short-term forecasting with AMI data from NepalReal-world AMI application with climate-aware inputsForecasting-only, no energy balancing or smoothing
Miyasawa et al. (2021)Spatial forecasting using geo-tagged SM dataIntegration of spatial resolution for regional planningDoes not address power fluctuation mitigation
Abera and Khedkar (2020)Appliance-level load prediction using MLEfficient feature selection and load disaggregationDoes not scale to aggregated forecasting or smoothing
Kumar et al. (2025a)Evolutionary optimization of neural load forecastingMulti-objective optimization with NSGA and AdamNo coupling with energy storage or SM-based actuation
Wang et al. (2022)Adaptive probabilistic forecasting with DARTS and LSTMArchitecture search for robust quantile predictionDoes not address load smoothing or dynamic energy buffers
Kumar et al. (2025b)ADELA hybrid learning for demand forecasting in smart gridsHigh forecast accuracy with evolutionary adaptationLacks validation under fluctuating or real-time conditions
Cao et al. (2023)BI-LSTM forecasting with SVD, K-shape, and EMD preprocessingImproved data cleaning and signal structuringLacks integration with physical systems or energy storage
Ghazal et al. (2021)EDF-FMLA: IoT-based SVM + DEML with automatic load controlStrong results (90.70% accuracy) and device integrationForecasting precision, but no use of supercapacitor buffers
Hu et al. (2024); Rong et al. (2025); Yang et al. (2025)Transformer-based forecasting and NILM disaggregation methods for smart meter dataImproved capture of long-term dependencies, uncertainty quantification, and higher accuracy in appliance-level disaggregationFurther exploration could focus on integrating these approaches with real-time storage control and demand smoothing strategies

Summary of contributions, strengths, and gaps in related studies on load forecasting with SM.

1.2 Research problem

Although smart metering infrastructure and advanced forecasting techniques have become increasingly prevalent, the integration of predictive intelligence with real-time energy smoothing remains insufficiently developed. As discussed in Section 1.1, most existing studies prioritize improving the accuracy of short-term load forecasts using machine learning models—ranging from deep neural networks to federated learning and hybrid optimization. However, these approaches rarely include an implementation layer that enables active control of demand profiles or mitigation of power fluctuations.

The incorporation of energy storage devices, such as supercapacitors, into forecasting-based control systems has received limited attention. While some recent works have proposed automatic load control or IoT-based supervisory schemes, fe—if any—address the combined challenges of: (i) high-resolution real-time demand forecasting using SM data, (ii) activation of a load balancing system based on predictive profiles, and (iii) experimental validation in a physical testbed. This disconnect between prediction and control reduces the practical utility of forecasting models, particularly in microgrid and distribution-level environments where peak shaving, demand smoothing, and flexibility are essential.

Additionally, although several models incorporate spatial and temporal features, the design of adaptive architectures capable of autonomous operation within a short control horizon remains largely unexplored. This limits the effectiveness of intelligent demand-side management systems in reducing peak demand charges or preventing local grid overloads—especially under dynamic tariffs and high renewable energy penetration.

To address these gaps, this research proposes a methodological framework that integrates: (i) short-term load forecasting via a WNN trained on SM data; (ii) real-time energy smoothing through a supercapacitor-based control model; and (iii) experimental deployment within a microgrid laboratory equipped with real-time measurement systems. By linking data acquisition, forecasting, and physical actuation, the proposed system aims to support the development of power systems that are more autonomous, responsive, and energy efficient. In addition, the scope of the objectives has been defined in measurable terms: the forecasting model is required to achieve a mean absolute percentage error (MAPE) below 10%, the estimation of the supercapacitor state of charge (SoC) must be validated under real-time conditions, and the smoothing algorithm is tested during peak ramp events to evaluate its ability to mitigate abrupt variations in demand. These targets provide a clear basis for assessing forecasting accuracy, storage dynamics, and demand-side control within the experimental framework.

2 Methodology

The proposed method is structured in three main stages: (i) demand forecasting, (ii) power smoothing, and (iii) reference power calculation for the supercapacitors. Figure 1 illustrates the sequence of operations involved in the energy smoothing strategy based on predictive analysis.

FIGURE 1

The process begins with the collection of daily demand data from previous days. These records are organized into daily vectors, which are then compiled into a weekly matrix. This dataset is used to train the forecasting model, which predicts the next day’s demand. The forecasted values serve as input for calculating the SoC of the storage system and adjusting model parameters retrospectively. The model also receives real-time inputs from the current SoC and instantaneous power demand.

As the algorithm runs, incoming data is processed continuously, allowing the system to refine its behavior based on updated conditions. The following subsections describe each stage of the methodology in detail.

2.1 Demand forecast

2.1.1 Recording data in matrix form

The monitoring system is based on a smart energy meter that records demand data per minute for a day. Each day contains data points. These values generate the daily record in matrix form for consecutive days. The observation matrix for day is defined as Equation 1:where represents the value of the variable demand during data of days.

The general matrix for the 5 days of registration can be represented in an extended form as Equation 2:

2.1.2 Data preprocessing

During data acquisition with smart meters, temporary interruptions may occur due to communication issues, network instability, or hardware constraints. These interruptions can introduce measurement errors or gaps in the recorded data. Missing values (NaN) or invalid entries compromise the integrity of the input vectors used for model training. To address this issue, a linear interpolation strategy is applied directly to reconstruct missing values. This approach leverages the temporal structure of the data, preserving continuity in the time series and enabling reliable prediction of load profiles. This approach preserves the temporal continuity of the dataset, enabling reliable prediction of load profiles. The process is formalized through Equations 35.where the time and target columns are removed from the DataFrame. The time column is excluded to focus exclusively on state variables, while the target column is discarded because it contains incomplete records before the 24-h period is completed, which could bias the prediction process.where is the value resulting from the interpolation of the previous and next values according to the following equation:

In this way, this procedure aligns with best practices in data preparation for intelligent systems, where input quality is crucial for the performance of the proposed model. The application of this interpolation methodology improves the information density of the dataset and also reduces the bias introduced by random omissions, strengthening the robustness of the analysis.

2.1.3 Neural model architecture

The proposed neural network is defined as a Multilayer Feedforward model (See Equation 6) consisting of densely connected layers. The general expression for each layer is:where is activation vector at layer , is weight matrix of layer , is bias vector and is the activation function (ReLU in hidden layers).

The model structure is defined by Equations 712:where is the expected output matrix (target), Y.shape[1] denotes the output dimension. That is, the number of variables predicted per sample. In this case, the model forecasts a single variable: the total daily power demand.

The model configuration was defined through an empirical tuning process aimed at maximizing generalization capacity while avoiding overfitting. The number of neurons per layer (128, 64, 32) was determined through sensitivity analysis and grid search, promoting hierarchical feature extraction with minimal computational redundancy. A dropout layer with a rate of 0.3 was included as a regularization mechanism to reduce reliance on specific units and enhance robustness against unseen data. The batch size of 48 was selected for its optimal balance between gradient stability and computational efficiency, particularly in scenarios with high daily variability. The validity of these parameters is supported by the performance analysis presented in Section 3.4.1.

2.2 Supercapacitor model

The proposed system includes an integrated power distribution architecture in which supercapacitors (SC) are incorporated to smooth the demand curve and reduce power fluctuations caused by load variability. Figure 2 illustrates the configuration. The supercapacitor unit, labeled as SC, performs energy storage and exchange via a bidirectional interface comprising AC/DC and DC/AC converters connected to the power grid.

FIGURE 2

The point of common coupling (PCC) is implemented through a low-voltage 230 Vac Delta-Wye (-Y) transformer, forming the AC bus of the system. The power exchanged with the grid is denoted as , the power demanded by the loads as , and the power delivered by the supercapacitor as through the bidirectional inverter. The governing power balance for this configuration is expressed in Equation 13.

The behavior of the EDLC supercapacitor is modeled using the following Equations 1416:where is stored energy in joules, is the capacitance of the EDLC (F), and is terminal voltage of the supercapacitor (V).

The dynamic SoC of the SC can be calculated based on its charge and discharge current during a time interval according to the following expression:where is charge/discharge current (A), is sampling time interval (s), is nominal charge capacity (C), and is SoC at time . Then, terminal voltage with internal resistance can be calculated as:where is the open-circuit voltage as a function of SoC, is the internal resistance as a function of SoC and temperature .

2.3 Power smoothing model

2.3.1 Ramp rate control

The dynamics of the load power variation , must closely correspond to the real-time measured data. This requires a control mechanism that operates within a response range bounded by a time interval, . Furthermore, the associated rate of change, denoted , is subject to a predetermined upper limit. Therefore, the ramp rate control formed by Equations 1719 can provide a detailed description of the dynamics of the proposed system:

Charge/discharge control according to power variation can be set as follows:where represents the supercapacitor power used to compensate for fluctuations and the maximum exchange rate allowed for loads.

2.3.2 Real-time SoC estimation

The calculation of the SoC estimate for supercapacitors is determined by the energy stored during charging and discharging respectively at time . The power assigned as a reference value is calculated from the following Equations 2024:where is the resulting load power , the ramp rate control smoothing power, and is the adjustment power to the model from the demand forecasting algorithms and the calculation of the expected state of charge. These values will be explained in detail in Section 2.3.3.

Consequently, the total energy stored in the SC during a time is determined as:where is SC charging efficiency and is SC discharging efficiency, respectively Benavides et al. (2023). The SoC of the SC as a function of its maximum energy can be calculated as follows:

The SC SoC restriction is limited in its maximum (95%) and minimum (5%) values allowed according to the following equation:

2.3.3 SoC prediction adjustment

The estimated SoC value is recalculated from Equations 2528. Where the forecast demand values are used to establish the fit in the demand power smoothing model, that is:where the expected reference power value can be calculated as the difference between the calculated value of the load forecast and the expected smoothing power of this value. Consequently, the prediction of the SC charging energy and discharging energy can be assigned as follows:

Similarly, the total energy expected to be stored in the SC during a time is determined as:

The SoC in response to the SC demand forecast model, expressed as a percentage, is calculated using the following Equation 28:

Finally, the adjustment factor in the correction of the reference power to the SCs can be calculated as defined in the following Equation 29:where is the adjustment coefficient [0–0.5] that can be calculated based on the nominal load power and the percentage of the confidence interval. That is . Consequently, the adjustment power is updated based on the next event of the state of charge prediction , is the confidence interval coefficient within the real-time measured value.

3 Results and discussion

3.1 Case study

The evaluation of the experimental results was carried out in a low voltage three-phase distribution board of the Faculty of Systems, Electronics and Industrial Engineering of the Technical University of Ambato. The measuring equipment integrates three CT (Current Transformer) type current sensors of 500A JCT36K 3000: 1. In Figure 3 it can be observed in detail in (2). These sensors are incorporated into the smart meter (3) based on PZEM004T and ESP32 m (See Figure 2) with an access point (4) for reading power data in real time at the coupling point of the Main switch (1). The data is recorded and stored on the server (5) for subsequent processing and data analysis. Finally, the SC-based storage system (6) and the two-level bidirectional inverter (7) with Fsw = 2.5 kHz allows a dual flow from the grid with a maximum capacity of 0.4 kWh from the University of Cuenca’s Microgrid Laboratory (Espinoza et al., 2017). Table 2 below summarizes the essential electrical and operational parameters of the distribution panel, supercapacitor module, and bi-directional inverter, which together define the configuration and performance of the integrated power management system.

FIGURE 3

TABLE 2

ComponentTechnical specificationParameter value
ElectricalBusbar systemThree-phase (R, S, T and N)
DistributionNominal voltage230 Vac (60 Hz)
PanelNominal power50 kVA
Nominal current500 A
SupercacitorsModelMaxwell BMOD-0130
Capacitance130 F
Equivalent series resistance8.1 m
DC voltage56 Vdc
Operating temperature−40 °C to 40 °C
Charging efficiency Greater than 95%
Discharging efficiency Greater than 96%
Charge and discharge cyclesPractically unlimited cycling
Depth of Discharge (DoD)100%
Number of cells10 cells in parallel
Max. energy0.4 kWh
Bidirectional inverterDC voltage560 Vdc
Output voltage230 Vac (60 Hz)
Nominal charge output/input30 kW
Switching frequencyFsw = 2.5 kHz

Technical specifications of the energy distribution and storage system components.

3.2 Data acquisition and preprocessing

The weekly log matrix data are detailed in Figure 4a for weekdays and non-working days. Furthermore, the load power fluctuates during working hours, while maintaining a constant level during non-working hours. Figure 4b summarizes the distribution data for the week. The average value of around 15 kW for weekdays and a constant demand of 3 kW during non-working hours are highlighted. Similarly, a representative data pattern is assumed for weekdays, which will be analyzed later using neural networks in the following section to estimate the demand forecast for these days.

FIGURE 4

3.3 Forecast results with the WNN

This section presents the performance of the WNN model during the training and validation phases applied to the demand data matrix. For the training dataset (70%), a correlation coefficient of was obtained, reflecting strong alignment between predicted and actual values (see Figure 5a). The fitted relationship, given by , indicates a slope close to unity and minimal bias in the training predictions. The training method used is Levenberg-Marquardt, an optimized variant of the backpropagation algorithm that stands out for its effectiveness in regression problems with moderate-sized neural networks. This characteristic makes it an ideal choice for tuning feedforward architectures with high accuracy and rapid convergence.

FIGURE 5

Figure 5b displays the validation results using the remaining 30% of the data. In this case, the correlation was , with a fitted equation of .

When evaluating the complete dataset, the resulting correlation coefficient was , as shown in Figure 5c. These results confirm that the model preserves predictive consistency across both training and validation subsets. Furthermore, Table 3 summarizes the statistical indicators of the predictive model across the training, validation, and overall evaluation stages. The training dataset exhibits a positive mean error of 0.0175 and a skewness of 2.0553, indicating slight overestimation with an error distribution skewed toward positive values. In contrast, the validation dataset shows a negative mean error of −0.0524 and a moderate skewness of 0.7678, reflecting slight underestimation and a more balanced distribution. Finally, the validation of the full model maintains a mean error close to −0.0034 and an intermediate skewness of 1.4956, suggesting good generalization capability with a marginal tendency toward overestimation.

TABLE 3

DatasetMean error
Skewness
Training (70%)0.01752.0553
Validation (30%)−0.05240.7678
Model validation−0.00341.4956

Statistical indicators of the predictive model.

Figure 5d shows the error histogram with a distribution around zero, which may confirm the model’s high accuracy. However, a greater distribution toward negative values is observed, indicating a marginal tendency to underestimate demand at certain points. In summary, the results indicate a model with high predictive capacity with the established data matrix and predictable behavior over time. This analysis was carried out using specialized MATLAB R2025a Neural Network Training tools using the Feed-Forward Neural Network with high precision in the results.

After configuring the adjustment parameters and validating the WNN model, it was implemented for real-time operation. The network was developed and trained in Python using libraries such as TensorFlow, Keras, Scikit-learn, Pandas, and NumPy. The architecture was designed to forecast multiple hourly energy demand values based on sequences of four consecutive days of historical data. During preprocessing, missing values were treated using forward- and backward-fill techniques, and the data were normalized using the MinMaxScaler method. Training was conducted over 500 epochs with a batch size of 48, employing mean squared error (MSE) as the loss function and the Adam optimizer. The model generates predictions within a confidence interval of 15%, as shown in Figure 6a. This output is used to estimate the SoC for upcoming intervals, where the adjustment power defines the prediction range. Likewise, Figure 6b presents the percentage error between real-time values and the model’s predictions. It is observed that the majority of samples fall within the range, demonstrating high accuracy in demand estimation. Only a small number of cases exceed this threshold, further reinforcing the reliability of the predictive model.

FIGURE 6

3.4 Evaluation of the predictive model

3.4.1 Training and validation of models

A comparison is made of some of the most commonly used neural networks for demand forecasting to evaluate the model. The following neural networks were selected for this evaluation: Long Short-Term Memory (LSTM), Narrow Neural Network (NNN), Bilayer Neural Network (BNN), Robust Linear Regression (RLR), Support Vector Machine (SVM), and WNN to validate the results. The tuning parameters of each model are evaluated based on a data matrix from three previous days, and their predicted response on the fourth day is assessed. The optimization of this process involves the analysis of weekdays. Subsequently, these models are validated in a pre-simulation environment for the best performing section of the network. These results are presented in Figures 7a–7f.

FIGURE 7

Figure 7a presents the evaluation of the LSTM network, recognized as a foundational architecture in demand prediction models and one of the most representative among recurrent neural networks. Alternatively, the NNN model used in this study (Figure 7b) was configured with a single fully connected layer of 10 units and employed the ReLU activation function. Training was carried out over a maximum of 1,000 iterations without regularization , and the input data were standardized prior to model fitting. The second network, BNN (Figure 7c), consists of two fully connected layers, each with 10 units and ReLU activation. The model was trained for up to 1,000 iterations, also without regularization. Standardization was applied to the input matrix to facilitate convergence. The third configuration, RLR, applies a linear formulation designed to reduce sensitivity to outliers. It incorporates standard linear terms within a stability-enhancing optimization scheme. However, as shown in Figure 7d, the validation results exhibit a temporal lag, indicating limited responsiveness to rapid variations in the data. The SVM model, illustrated in Figure 7e, uses a linear kernel with automatic scaling and box constraints for adaptive parameter tuning. The margin parameter is set by default. Despite partial alignment with the load curve, the model displays inconsistencies in capturing temporal dynamics, particularly during transitions.

Finally, Figure 7f presents the WNN model adopted in this study. It comprises a single layer with 100 neurons and ReLU activation, trained over 1,000 iterations without regularization. Standardization was applied to enhance numerical stability. Among the evaluated configurations, this architecture demonstrated improved capacity for learning nonlinear demand patterns, with more precise temporal alignment than the alternatives.

3.4.2 Evaluation indices

After analyzing the training and validating the models, this section presents the results, which are analyzed based on the Root Mean Square Error (RMSE) indicators, which estimates the standard deviation of the prediction and actual errors; the R-Square or coefficient of determination ; the Mean Square Error (MSE); and the Mean Absolute Percentage Error (MAPE). This accurately evaluates the performance of the LSTM, NNN, BNN, RLR, SVM, and WNN models presented in this section, providing highly accurate results. Equations 3033, which evaluate these models, are described below:where is the real value, is the predicted value, is the average of the actual values and is the total number of samples.

The results of this evaluation are presented in Table 4. According to Section 3.4.1, the resulting values of the RSME, , MSE and MAPE indices are established. The comparative results of these evaluated predictive neural network models and classical regression techniques highlight the Wide Neural Network model as the best performer among all, with minimum values in RMSE (1.0310), MSE (1.0630) and MAPE (6.3%), and of 0.96, indicating high accuracy and capacity for real-time demand forecasting. The second most adaptive model is the LSTM, which demonstrated strong performance with RMSE = 1.1546, MSE = 0.89, and MAPE = 11.08%. This architecture enhances long-sequence learning capabilities, overcoming limitations typically associated with conventional recurrent neural networks. In contrast, the Support Vector Machine and Robust Linear Regression present higher error values, with MAPE greater than 26%, which suggests limited effectiveness. On the other hand, the Bilayered Neural Network model also represents acceptable values after WNN, with MAPE of 8.3% and R2 of 0.94, maintaining a balance between accuracy and structural complexity. Finally, the presented results conclude the use of deep neural architectures, particularly the WNN, as the best option in this comparative study. Consequently, it generates a reliable methodological tool for predicting energy demand in real time. In addition, the pseudocode that allows obtaining the results is presented sequentially and in detail in Table 5.

TABLE 4

ItemDescriptionRMSEMSEMAPE
1Long Short-Term Memory (LSTM)1.15460.891.333011.08%
2Narrow Neural Network (NNN)1.60420.902.573412.4%
3Bilayered Neural Network (BNN)1.29790.941.68448.3%
4Robust Linear Regression (RLR)2.40850.785.801126.3%
5Support Vector Machine (SVM)2.37420.795.637030.9%
6Wide Neural Network (WNN)1.03100.961.06306.3%

Comparison with different network models.

TABLE 5

Pseudocode
1. Load database CSV
1.1: file_path = “database_by_days.csv”
1.1: df = pd.read_csv(file_path)
2: Preprocessing
2.1: ds_time = df.iloc[:, 0]
2.2: df_days = df.drop(columns = [‘time’, df.columns[-1]])
2.3: df_days = df_days.interpolate(method = ‘linear’,axis = 0)
3: Create 4-day dataset 5th day
3.1: data_array = df_days.to_numpy().T
3.2: n_days = data_array.shape[0]
3.3: X = []
3.4: Y = []
3.5: for i in range(n_days - 4)
3.6: input = data_array[i:i+4, :].flatten()
3.7: output = data_array[i+4, :].flatten()
3.8: X.append(input)
3.9: Y.append(output)
3.10: X = np.array(X)
3.11: Y = np.array(Y)
4: Normalize and separate the data
4.1: scaler_X = MinMaxScaler()
4.2: scaler_Y = MinMaxScaler()
4.3: X_scaled = scaler_X.fit_transform(X)
4.4: Y_scaled = scaler_Y.fit_transform(Y)
4.5: X_train, X_val, Y_train, Y_val = train_test_split(X_scaled, Y_scaled, test_size = 0.3, random_state = 42)
5: Build and train model
5.1: model = Sequential()
5.2: model.add(Dense(128, input_dim = X.shape[1], activation = ‘relu’))
5.3: model.add(Dropout(0.3))
5.4: model.add(Dense(64, activation = ‘relu’))
5.5: model.add(Dense(32, activation = ‘relu’))
5.6: model.add(Dense(Y.shape[1]))
5.7: model.compile(loss = ‘mse’, optimizer = ‘adam’)
5.8: model.fit(X_train, Y_train, epochs = 250, batch_size = 16, verbose = 1)
6: Run predictive models
6.1: Y_pred_scaled = model.predict(X_val)
6.2: Y_pred = scaler_Y.inverse_transform(Y_pred_scaled)
6.3: Y_val_real = scaler_Y.inverse_transform(Y_val)
7: end

Processing algorithm and predictive modeling in energy systems.

Figure 8a presents a representative comparison based on four important areas for demand forecasting. The first Zone in Figure 8b corresponds to the response of the models to a small initial load connection. In Figure 8c corresponding to Zone 2, the response is executed to a growing slope of demand during the first working hours of the day, then a drop in demand is generated at midday (See Figure 8d), where an adjustment of most of the models in this section is observed. Finally, Figure 8e in the Zone 4 reflects the decreasing slope of the day. These values emphasize the importance of analyzing demand and finding specific patterns that allow to optimize the application of these predictive models in a better way.

FIGURE 8

3.5 Evaluation of the power smoothing model

In this section, the results of the demand power smoothing model based on Equations 1729 are presented. Figure 9a shows the demand curve profile from 5:00 to 19:00 h, where the real-time demand profile and the algorithm’s response to mitigate the generated fluctuations as are illustrated. The enlarged section shows the contribution of the SC as a ramp rate limiter. On the other hand, Figure 9b shows the SC charging and discharging powers as the difference between the measured power and the reference power of the smoothing method, where the positive rate of change implies a discharge of the SCs and a negative rate of change of the load. The state of charge expressed as a percentage is shown in Figure 9c, where it can be observed that the charging power exhibits abrupt variations throughout the day, while the grid power maintains a more stable trend, except for a pronounced drop at the end of the day.

FIGURE 9

It is worth highlighting the dynamics of the storage system’s power output, which operates at specific times of charging (positive peaks) and discharging (negative peaks), in sync with demand (Benavides et al., 2024). Furthermore, the progressive decrease in the SCs state of charge allows for recovery at the end of the workday around 7:00 p.m. This representation supports the storage system’s effectiveness in offsetting power demand fluctuations, optimizing grid supply, and maintaining operating load levels within established ranges, improving its energy efficiency and energy quality for the grid.

3.5.1 Sensitivity analysis by adjustment coefficient

This section presents a sensitivity analysis of the adjustment coefficient, as established in Equation 29. This coefficient enables optimal regulation of the state of charge values, ensuring they remain within a predefined interval. Figure 10 displays the results of this configuration under various values of the adjustment coefficient. The values of demand power, predicted power, and smoothed power are analyzed under different adjustment coefficients, along with their response to both the real and predicted state of charge. In Figures 10a,b, a noticeable increase in the real-time SoC compared to the predicted value is observed, attributed to a low adjustment coefficient , which limits the system’s self-regulation capability. In contrast, Figures 10c,d assign a coefficient of , significantly improving alignment with the predicted value. This configuration enables more accurate monitoring, maintains balance in the prediction, and anticipates future load behavior events.

FIGURE 10

Additionally, Figures 10e,f, with , show that the system fails to adjust properly at the end of the process, leaving a narrow margin near the SoC operating limits. When a higher coefficient of is applied, as shown in Figures 10g,h, the system exceeds the predefined range, complicating SoC control. Consequently, an intermediate value of is recommended to optimize the performance of the storage system, balancing predictive accuracy and operational stability.

3.5.2 Sensitivity analysis by test days

Finally, a sensitivity analysis is performed considering the test days Monday, Friday, and Saturday, with the objective of validating and evaluating the operation of the proposed model under different demand conditions. Figure 11a details the demand profile with a high power change rate and the system response as in a timely manner, significantly mitigating the generated disturbances. In parallel, Figure 11b shows the SoC of the SC under these effects, highlighting the predictive operating range in response to the WNN network model . This allows for optimal SoC control by limiting future demand events. Similarly, Figures 11c,d show the results for the evaluated day on Friday. In this case, there are no significant changes in the power rate, so it can be mitigated within the stipulated period. Furthermore, in Figures 11e,f, the non-working day has been considered for the interpretation of the results, and the system has no operation due to maintaining a constant demand without generating major fluctuations. Overall, the presence of areas of high variability in the state of charge suggests that the system responds quickly to differences between load and supply, validating its ability to act as a dynamic backup in the face of grid intermittency. Overall, this figure summarizes the storage system’s efficiency in mitigating hourly imbalances, showing how the SoC adjusts based on actual demand and preset operating parameters.

FIGURE 11

4 Conclusion

The integration of IoT tools in electrical systems has improved access to and analysis of operational data. This study implemented smart meters for real-time demand forecasting, incorporating fast-response energy storage to manage load variations and anticipate future demand trends. The main findings of the research are outlined below.

The forecasting system was based on the construction of demand matrices from historical data and the application of a Wide Neural Network. This configuration achieved correlation coefficients above 0.94 and a mean absolute percentage error of 6.3%, surpassing other evaluated models such as SVM and RLR.

The model supports real-time adaptation through continuous data acquisition and processing. Both the current demand and the system load state contributed to iterative updates of the forecast, allowing the system to respond to changing operating conditions.

The energy smoothing algorithm reduced ramp rate variations associated with demand fluctuations by adjusting the reference power signal according to the supercapacitor’s state of charge. This result confirms the system’s function as a buffer against short-term variations in power flow.

The methodology follows a modular structure and is implemented using Python libraries (TensorFlow, Keras, Scikit-learn), which allows for its integration into broader IoT-based energy management platforms.

Finally, the integration of predictive forecasting with energy storage control enables future developments in anticipatory management strategies, where load behavior forecasts inform storage operation based on projected demand and SoC adjustments.

Statements

Data availability statement

The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.

Author contributions

DB: Conceptualization, Data curation, Formal Analysis, Funding acquisition, Investigation, Methodology, Project administration, Resources, Software, Supervision, Validation, Visualization, Writing – original draft, Writing – review and editing. PA-C: Conceptualization, Formal Analysis, Investigation, Methodology, Validation, Visualization, Writing – original draft, Writing – review and editing. JE: Conceptualization, Data curation, Formal Analysis, Investigation, Methodology, Validation, Writing – original draft, Writing – review and editing. DO-C: Conceptualization, Data curation, Formal Analysis, Investigation, Methodology, Resources, Supervision, Validation, Visualization, Writing – original draft, Writing – review and editing. DT: Formal Analysis, Funding acquisition, Investigation, Methodology, Project administration, Software, Visualization, Writing – original draft, Writing – review and editing. AR: Formal Analysis, Funding acquisition, Investigation, Project administration, Resources, Software, Supervision, Validation, Visualization, Writing – original draft, Writing – review and editing.

Funding

The author(s) declare that no financial support was received for the research and/or publication of this article.

Acknowledgments

The authors thank the Dirección de Investigación y Desarrollo (DIDE) of the Universidad Técnica de Ambato for supporting this work through the research project PFISEI36, “Development of Computational Tools for the Management and Optimization of Smart Microgrids.” The authors thank the Faculty of Engineering, Universidad de Cuenca, Ecuador, for easing access to the Micro-Grid Laboratory’s facilities, allowing the use of its equipment, and authorizing its staff to provide technical support necessary to carry out the experiments described in this article.

Conflict of interest

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Generative AI statement

The author(s) declare that no Generative AI was used in the creation of this manuscript.

Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.

Publisher’s note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

Nomenclature

  • Matrix of values of the demand power d accumulated days

  • Extended value matrix of the demand power of accumulated days

  • Power grid

  • Sum of powers of the load

  • Reference power to the supercapacitor

  • Energy stored in the SC

  • State of charge of the SC at a time t

  • SC voltage at time t

  • Ramp rate control

  • Smoothed power to compensate for fluctuations

  • Power adjustment to the model based on demand forecast

  • SC charging energy

  • SC discharging energy

  • Load demand power prediction

  • Time

  • Time interval

  • Temperature

  • Adjustment coefficient

  • confidence interval coefficient

  • Regularization parameter

  • SC power prediction

  • SC charge energy prediction

  • SC discharge energy prediction

  • SC energy prediction

  • SC state of charge prediction

  • Root Mean Square Error

  • Mean Squared Error

  • Mean Absolute Percentage Error

  • Coefficient of determination

  • SC

    Supercapacitor

  • SM

    Smart meter

  • WNN

    Wide Neural Network

  • BNN

    Bilayered Neural Network

  • NNN

    Narrow Neural Network

  • RLR

    Robust Linear Regression

  • SVM

    Support Vector Machine

  • LSTM

    Long Short-Term Memory

References

  • 1

    AberaA.KhedkarM. (2020). Machine learning approach: electric appliance consumption forecasting based on smart meter data. Int. J. Eng. Res. and Technol.9, 305312. 10.1007/s11277-019-06845-6

  • 2

    AliS.BogarraS.RiazM. N.PhyoP. P.FlynnD.TahaA. (2024). From time-series to hybrid models: advancements in short-term load forecasting embracing smart grid paradigm. Appl. Sci.14, 4442. 10.3390/app14114442

  • 3

    ArévaloP.BenavidesD.Ochoa-CorreaD.RíosA.TorresD.Villanueva-MachadoC. W. (2025). Smart microgrid management and optimization: a systematic review towards the proposal of smart management models. Algorithms18, 429. 10.3390/a18070429

  • 4

    BarbieratoE.GattiA. (2024). The challenges of machine learning: a critical review. Electronics13, 416. 10.3390/electronics13020416

  • 5

    BenavidesD.ArévaloP.AguadoJ. A.JuradoF. (2023). Experimental validation of a novel power smoothing method for on-grid photovoltaic systems using supercapacitors. Int. J. Electr. Power and Energy Syst.149, 109050. 10.1016/j.ijepes.2023.109050

  • 6

    BenavidesD.ArévaloP.CriolloA.Tostado-VélizM.JuradoF. (2024). Multi-mode monitoring and energy management for photovoltaic-storage systems. Renew. Energy230, 120820. 10.1016/j.renene.2024.120820

  • 7

    CaoJ.ZhangR.-X.LiuC.-Q.YangY.-B.ChenC.-L. (2023). A group resident daily load forecasting method fusing self-attention mechanism based on load clustering. Appl. Sci.13, 1165. 10.3390/app13021165

  • 8

    DewanganF.AbdelazizA. Y.BiswalM. (2023). Load forecasting models in smart grid using smart meter information: a review. Energies16, 1404. 10.3390/en16031404

  • 9

    DiniP.PaoliniD. (2025). Exploiting artificial neural networks for the state of charge estimation in EV/HV battery systems: a review. Batteries11, 107. 10.3390/batteries11030107

  • 10

    EspinozaJ. L.GonzálezL. G.SempérteguiR. (2017). “Micro grid laboratory as a tool for research on non-conventional energy sources in Ecuador,” in 2017 IEEE international autumn meeting on power, electronics and computing (ROPEC), 17. 10.1109/ROPEC.2017.8261615

  • 11

    FekriM. N.GrolingerK.MirS. (2022). Distributed load forecasting using smart meter data: Federated learning with recurrent neural networks. Int. J. Electr. Power and Energy Syst.137, 107669. 10.1016/j.ijepes.2021.107669

  • 12

    GhazalT.NoreenS.SaidR.KhanM.SiddiquiS.AbbasS.et al (2021). Energy demand forecasting using fused machine learning approaches. IASC31, 539553. 10.32604/iasc.2022.019658

  • 13

    HaykinS. (2009). Neural networks and learning machines. 3rd edn. Upper Saddle River, NJ: Pearson.

  • 14

    HuJ.HuW.CaoD.SunX.ChenJ.HuangY.et al (2024). Probabilistic net load forecasting based on transformer network and gaussian process-enabled residual modeling learning method. Renew. Energy225, 120253. 10.1016/j.renene.2024.120253

  • 15

    KhanZ. A.JayaweeraD. A. (2020). “Smart Meter Data Based Load Forecasting and Demand Side Management in Distribution Networks With Embedded PV Systems,” in IEEE Access. 926312644. 10.1109/ACCESS.2019.2962150

  • 16

    KomatsuH.KimuraT. (2020). Peak demand alert system based on electricity demand forecasting. Energy Rep.6, 181189. 10.1016/j.egyr.2019.10.017

  • 17

    KumarJ.RaniP.SaxenaD.SinghA. K.MakkarA. (2025a). Evolutionary learning driven load forecasting and demand response management model for smart grid. Appl. Soft Comput.177, 113169. 10.1016/j.asoc.2025.113169

  • 18

    KumarJ.SaxenaD.KumarJ.Kumar SinghA.VasilakosA. V. (2025b). An adaptive evolutionary neural network model for load management in smart grid environment. IEEE Trans. Netw. Serv. Manag.22, 242254. 10.1109/TNSM.2024.3470853

  • 19

    LaurencioR. M.BreffO. T.RamirezS. M.JiménezD. J. (2024). Predicción de Consumo y Demanda de Electricidad Mediante Redes Neuronales Artificiales y Algoritmo Iterativo. Rev. Politécnica54, 4558. 10.33333/rp.vol54n3.05

  • 20

    LiF.LuoB.LiuP. (2011). Usage analysis for smart meter management. Int. J. Electr. Power and Energy Syst.33, 712720. 10.1016/j.ijepes.2010.12.007

  • 21

    Mehdipour PirbazariA.FarmanbarM.ChakravortyA.RongC. (2020). Short-term load forecasting using smart meter data: a generalization analysis. Processes8, 484. 10.3390/pr8040484

  • 22

    MiyasawaY.TaniguchiH.MaruyamaH.FukuyamaY. (2021). A two-stage stochastic programming approach for non-cooperative generation maintenance scheduling model design. Int. J. Electr. Power and Energy Syst.126, 106584. 10.1016/j.ijepes.2020.106584

  • 23

    MondalS.DasM. (2023). Parametric time-series modelling of London smart meter data. Int. J. Electr. Power and Energy Syst.146, 108258. 10.1016/j.ijepes.2022.108258

  • 24

    NespoliL.MediciV. (2025). Global forecasting models for residential load flexibility and grid optimization. Front. Energy Res.13, 1547617. 10.3389/fenrg.2025.1547617

  • 25

    NeupaneB. G. C. I.AdhikariD.SahS. (2024). “Artificial neural network based short-term load forecasting of nuwakot distribution center using smart meter ami data,” in 2024 IEEE international conference on power system technology (PowerCon) (IEEE). 10.1109/PowerCon60995.2024.10870552

  • 26

    Rodríguez-PajarónP.Hernández BayoA.MilanovićJ. V. (2022). Forecasting voltage harmonic distortion in residential distribution networks using smart meter data. Int. J. Electr. Power and Energy Syst.136, 107653. 10.1016/j.ijepes.2021.107653

  • 27

    RongJ.WangC.ZhouQ.HeY.WuH. (2025). Enhancing non-intrusive load monitoring through transfer learning with transformer models. Energy Build.330, 115334. 10.1016/j.enbuild.2025.115334

  • 28

    SteephenA.GeorgeL.JosephA. (2023). “Demand forecasting in smart homes using deep learning,” in 2023 IEEE international conference on smart energy systems (ICSES) (IEEE), 143148. 10.1109/ICSES56715.2023.10214423

  • 29

    WangC.QinD.WenQ.ZhouT.SunL.WangY. (2022). Adaptive probabilistic load forecasting for individual buildings. iEnergy1, 341350. 10.23919/IEN.2022.0041

  • 30

    WerangaK.ChandimaD.MunasingheS.KumarawaduS.AbeykoonA. (2012). “Short-term electricity demand forecasting method for smart meters,” in 2012 international conference on industrial and information systems (ICIIS) (IEEE), 16. 10.1109/ICIINFS.2012.6304772

  • 31

    YangN.WangY.ZhangY.YuanD. (2025). Non-intrusive load monitoring for energy management in smart grids incorporating EVs. IEEE Trans. Consumer Electron.71, 16961706. 10.1109/TCE.2024.3489580

Summary

Keywords

smart meter, demand forecasting, energy management, supercapacitors, real-time, power smoothing

Citation

Benavides D, Arévalo-Cordero P, Espinosa Domínguez J, Ochoa-Correa D, Torres D and Ríos A (2025) Smart meter-based demand forecasting for energy management using supercapacitors. Front. Energy Res. 13:1681139. doi: 10.3389/fenrg.2025.1681139

Received

06 August 2025

Revised

02 October 2025

Accepted

27 October 2025

Published

13 November 2025

Volume

13 - 2025

Edited by

L. J. Muhammad, Bayero University Kano, Nigeria

Reviewed by

Yunqi Wang, RMIT University, Australia

Anna Diva Lotufo, Universidade Estadual Paulista Julio de Mesquita Filho, Brazil

Updates

Copyright

*Correspondence: Dario Benavides,

Disclaimer

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.

Outline

Figures

Cite article

Copy to clipboard


Export citation file


Share article

Article metrics