1. Introduction
Increased penetration of renewable energy sources (RES) in microgrids has posed serious challenges in energy management due to the inherent variability of solar, wind, and load demand [
1,
2]. Reliable microgrid operations demand high-quality forecasting models for predicting generation patterns as well as consumption patterns, along with effective optimization schemes for minimizing operational costs without compromising on stability [
3,
4]. Conventional forecasting schemes based on autoregressive models as well as machine learning methods are often ill-equipped with modeling the sophisticated temporal–spatial dependencies in renewable energy patterns, resulting in poor predictability in scheduling decisions [
5,
6]. Conventional optimization schemes are similarly constrained in tackling high-dimensional non-convex problems in energy dispatching, especially with forecast uncertainty [
7,
8].
Using machine learning and metaheuristic algorithms, recent developments in microgrid energy management aim to resolve forecasting uncertainties and minimize operational expenses. Major studies performed recently can be categorized in three fields: renewable energy/load forecasting, optimization methods, and demand response management.
Conventional statistical models for load and renewable energy prediction are prone to spatiotemporal volatility [
1,
2]. Machine learning, particularly deep learning methods, has shown to be much better at capturing complex patterns: LSTMs are good at understanding time-related patterns in solar power, while CNNs are effective at identifying layout patterns in wind farms. These different types of models work well together in combined systems like bi-LSTM attention mechanisms, dueling DQN-DDPG schemes, and Seq2Seq scheduling schemes, which improve prediction accuracy. For instance, real-time decision-making processes enhance bi-LSTM attention schemes [
3], while neural-fuzzy schemes manage intermittent patterns in renewable power [
9]. Recent breakthroughs combine IoT-enabled data streams for high-granularity forecasting schemes [
10,
11] as well as probabilistic schemes for quantifying uncertainty estimates [
4]. Most schemes; however, focus on separated temporal or spatial dimensions of features [
5,
6] and leave scope for holistic modeling of the spatiotemporal dimension—a problem solved using our hybrid CNN-GRU framework, which synergistically combines convolutional operations with GRU temporal gates.
Metaheuristics are now central in microgrid economic dispatch. Particle Swarm Optimization (PSO) optimizes operational expenses in hybrid power systems [
7], with Multi-Objective Kepler Optimizers balancing emissions with costs [
1]. Teaching–Learning-Based Optimization is promising in resource allocation tasks [
8] but is prone to premature convergence in high dimensions. New advances involve improved Gazelle Optimizers [
12] as well as scheduling based on C-LSGANs [
4] and hybrid schedules such as dung-beetle optimization [
13] and jellyfish search [
14]. Genetic algorithms (GAs) help make battery equalization tasks and economic scheduling tasks better, while better versions of GAs that use Latin Hypercube Sampling are more effective for exploring options. Distributed energy resource (DER) coordination is improved upon in Seq2Seq models [
15] as well as in multi-objective schemes [
16,
17]. The improved TLBO in this study boosts these advancements by using luminance coefficients and hybrid genetic operations, which help balance exploration and exploitation while being more efficient than traditional PSO and TLBO when dealing with uncertainties from forecasts.
Optimum management of microgrids demands strong handling of forecast uncertainty and variability in demand. Reinforcement learning (RL) systems like CuEMS and DRL schedulers change their strategies based on changes in energy, while stochastic optimization and deep learning-based rule-based controls help improve stability. Energy storage systems (ESS) are improved using genetic algorithms and cost-effective scheduling, while combining different ESS designs makes them more reliable. Demand response methods promote load shifting through price-responsive controls [
18] and IoT-powered real-time adjustments [
11]. Multi-energy microgrids rely on hydrogen production optimization [
19] as well as power-to-gas integration [
12] to minimize carbon footprints. Few studies combine demand response with forecasting-driven optimization [
18,
20]. In this research, our framework closes this gap by integrating CNN-GRU probabilistic predictions with ITLBO’s adaptive handling of constraints, allowing it to anticipate deviation in predictions while ensuring grid stability [
21].
Recent progress in deep learning has shown promising performance in renewable energy prediction, as structures such as the Long Short-Term Memory (LSTM) unit and Convolutional Neural Networks (CNN) enhanced prediction accuracy through modeling temporal and spatial features, respectively [
3,
5]. Hybrid models like bi-LSTM with attention mechanisms [
3] and CNN-LSTM structures [
5] have outperformed conventional methods, but most such methods still address temporal and spatial dependencies in isolation, without their synergistic interaction [
6]. In terms of optimization, the popular choice of metaheuristic algorithms like Particle Swarm Optimization (PSO) [
7], Cheetah Optimizer (CO) [
22], and Teaching–Learning-Based Optimization (TLBO) [
8] for economic dispatch is plagued with slow convergence rates and premature stagnation in high-dimensional search spaces [
12,
13]. Reinforcement learning (RL) and stochastic optimization schemes [
14,
23] have been applied for uncertainty reduction but tend to be decoupled in their integration with high-precision forecasting. In addition, whereas demand response management increases grid flexibility via IoT-driven adjustments [
11] and price-sensitive load shifting [
16], few research studies consider probabilistic forecasting in conjunction with adaptive optimization for dynamic correction of prediction errors [
20,
21].
To meet these challenges, this paper introduces an innovative two-stage approach consisting of a hybrid CNN-GRU forecasting method [
24] with an Improved Teaching–Learning-Based Optimization (ITLBO) algorithm. The CNN-GRU algorithm extracts both spatial and temporal features from historical load and renewable energy datasets at the same time, enhancing the reliability of the forecast. The improved ITLBO algorithm includes adaptive luminance coefficients, Latin Hypercube Sampling for initialization, and hybrid genetic operations for optimizing generation scheduling in uncertainty scenarios. Introducing demand response mechanisms, the approach ensures cost-effective microgrid operation while minimizing the effect of forecast uncertainties on the system performance.
The major contributions of this research are as follows:
Hybrid CNN-GRU Forecasting Model: merges convolutional layers for spatial feature extraction with GRU temporal gates, achieving far better renewable energy and load demand prediction accuracy in comparison with independent CNN and MLANN models [
25,
26].
Advanced TLBO (ITLBO) Algorithm: augments standard TLBO with adaptive exploration–exploitation trade-off through luminance coefficients, Latin Hypercube initialization for promoting diversity, and hybrid genetic operations in order to prevent premature convergence, outperforming PSO, TLBO, and several other baselines in cost optimization.
Integrated Forecasting–Optimization Framework: anticipates forecast uncertainties proactively through probabilistic CNN-GRU predictions combined with ITLBO’s dynamic handling of constraints, lowering operational expenses as well as peak grid dependency.
Broad Case Studies: verifies the framework’s strength through four operational contexts (perfect foresight, CNN-GRU, CNN, and MLANN predictions), reflecting near-optimum scheduling performance in actual uncertainty environments.
Integration of Demand Response: illustrates how the envisioned framework stabilizes the grid by integrating forecasting-based optimization with demand response, presenting an extensible solution for realistic applications in microgrids.
These contributions together promote microgrid power management in advancing spatiotemporal forecasting, efficiency in optimization, as well as uncertainty robustness.
The rest of this paper is structured as follows:
Section 2 summarizes the problem formulation of the optimal microgrid management.
Section 3 explains the proposed ITLBO algorithm.
Section 4 represents the proposed hybrid CNN-GRU forecasting methodology.
Section 5 discusses experimental findings with comparisons.
Section 6 concludes the work and outlines future research directions.
2. Problem Formulation
The microgrid energy management problem is formulated as a multi-period constrained optimization task considering renewable integration, demand response, and grid interactions [
27]. Let
denote the scheduling horizon (typically
h) and define the following components:
2.1. Objective Function
However, this involves the minimization of total operational costs: total operational cost,
, consists of the costs incurred from renewable generation (PV, wind), grid purchases, diesel generation, and demand response incentives. The objective function minimizes these cost components to determine an economically optimal energy dispatch subject to operational constraints over the scheduling horizon.
where the cost terms represent
Renewable generation expenses based on per-unit costs for PV and wind power;
Time-varying grid electricity purchase costs;
Quadratic fuel costs for diesel generation, accounting for efficiency effects;
Linear compensation costs for demand response participation.
This formulation enables cost-aware decision-making across all available energy resources while maintaining reliable microgrid operation.
In Equation (1), indicate the sets of PV units, wind turbines, and diesel generators. represents the power dispatch at time, (kW). is the unit costs ($/kWh). are quadratic fuel cost coefficients for the diesel generator, . defines the DR incentive rate ($/kWh).
2.2. System Constraints
For maintaining reliable power supply and proper functioning of electrical equipment, the microgrid operation needs to meet certain physical and technical constraints as listed below.
2.2.1. Power Balance
The total generation by the PV, wind, and diesel units, and grid imports at any time step must equal system load minus demand response curtailment. This balances demand and supply.
2.2.2. Generation Limits
All power generation sources operate within their limits of technical capabilities. Like renewable outputs (PV and wind), output is bound by available resources, like diesel generators, which have minimum/maximum stable outputs, and grid exchange respects contractual or line limits.
2.2.3. Demand Response Constraints
Shiftable loads through demand response is limited to a fraction (
) of the total instantaneous load and to a maximum amount of energy used over the scheduling period, to preserve comfort of the consumer.
The linear DR model approximates aggregate behavior; user-specific utility functions are a future extension. While the current model restricts DR magnitude via η (Equations (7) and (8)), future work will incorporate ramping constraints (e.g., ±5% load change per hour) and minimum DR durations to better reflect practical user flexibility limits.
2.2.4. Spinning Reserve Requirement
The total available capacity from the fast-responding diesel generators plus the grid must exceed the load plus a specified reserve margin to account for generation outages or forecast errors.
Rreserve is fixed at 10% of peak demand, aligning with grid reliability standards. This set of constraints ensure to facilitate operational feasibility and at the same time, works towards the cost-minimization objective.
2.3. Decision Variables
The optimization derives the best hourly dispatch schedule of all controllable resources, defined as a decision vector, , that covers the entire scheduling horizon. This includes
Power generated by each PV unit, wind turbine, diesel generator;
Power from the grid, where positive/negative values are import/export;
Demand side response curtailment.
The optimization determines the hourly dispatch schedule as follows:
All time-coupled decisions can be expressed in the compact format of matrix Formulation (10), which allows for simultaneous optimization throughout the 24 h horizon, subject to system constraints. This matrix structure allows integration with an objective function and constraints, as each column represents a resource type, and each row represents a time period.
2.4. Fitness Function Evaluation and Constraint Handling
The optimization algorithm evaluates candidate solutions using a fitness function that combines the total operational cost with penalty terms for constraint violations. This ensures feasible and cost-effective microgrid operation.
The fitness function
F(
X) is defined as:
where
= Original objective function (total operational cost);
λviol = Penalty coefficient (large positive scalar to discourage infeasibility);
Penalty(X,t) = Constraint violation measure at time t.
4. Proposed Hybrid Forecasting Methodology
The developed CNN-GRU framework combines convolutional feature extraction with temporal dependency modeling to predict critical microgrid variables.
Figure 1 illustrates the integrated architecture, which processes multi-modal input data to generate 24 h forecasts of solar irradiance (
), ambient temperature (
), wind speed (
), and power demand (
).
4.1. Data Preprocessing and Feature Engineering
Input features are normalized to a [−1, 1] range to stabilize training, while target variables (e.g., irradiance, temperature) are standardized to zero mean and unit variance. Temporal sequences are restructured into 24 h windows, preserving the diurnal cycle for sequential modeling. Input features are normalized using min-max scaling to stabilize gradient descent [
33]:
where
represents the
-th input feature (time-of-day, day-of-week, humidity, pressure, wind direction). Targets are normalized per variable:
Temporal sequences are restructured into daily windows [
34]:
4.2. Hybrid CNN-GRU Architecture
4.2.1. Spatial Feature Extraction
Parallel 1D convolutions scan input sequences to extract local patterns (e.g., daily solar irradiance trends), followed by max-pooling for dimensionality reduction [
35].
where
denotes depth-wise convolution with 128 filters (
). Max-pooling reduces dimensionality:
4.2.2. Temporal Dependency Modeling
Bidirectional GRUs capture long-range dependencies by processing sequences forward and backward, enhancing prediction robustness [
36],
4.2.3. Multi-Task Prediction
Dedicated output heads generate variable-specific forecasts, allowing shared feature learning while accommodating distinct prediction scales.
Specialized heads generate target-specific forecasts [
37]:
4.3. Physics-Constrained Post-Processing
Predicted meteorological variables are converted to PV and wind power outputs using industry-standard physical models [
35]:
4.3.1. Photovoltaic Power
This model accounts for solar irradiance, panel temperature, and manufacturer specifications (e.g., NOCT, temperature coefficients).
4.3.2. Wind Turbine Power
This model follows a piecewise cubic relationship with wind speed, respecting cut-in, rated, and cut-out thresholds.
4.4. Training Protocol
A weighted multi-task loss function balances mean squared error (MSE) and symmetric mean absolute percentage error (sMAPE) across all targets, with adaptive learning rate decay to refine convergence [
34].
The multi-task loss combines weighted errors,
, is calculated as follows:
Adaptive moment estimation with learning rate decay:
4.5. Performance Quantification
Forecast accuracy is evaluated using four metrics [
33,
35]:
Root Mean Squared Error (RMSE): measures absolute deviation;
Mean Absolute Percentage Error (MAPE): quantifies relative error;
Correlation Coefficient (CC): assesses linear relationship strength;
Mean Absolute Deviation (MAD): provides robust error estimation.
These metrics are expressed using the following equations:
The proposed CNN-GRU forecasting framework utilizes the following key notations: input features, , include time-of-day, day-of-week, humidity, pressure, and wind direction, while target variables, , consist of solar irradiance, , ambient temperature, , wind speed, , and power demand, . The CNN extracts spatial features through convolutional outputs, , and pooled representations, , while bidirectional GRUs model temporal dependencies using forward, , and backward, , hidden states, combined as . Physical model parameters for PV generation include standard test conditions, , temperature coefficient, , and nominal operating cell temperature, , whereas wind power conversion relies on cut-in, , rated, , and cut-out, speeds along with rated power, . Forecast accuracy is quantified via (40)–(43), with training governed by a weighted multi-task loss (38) under an adaptive learning rate where .
4.6. Implementation Procedure of the Proposed Microgrid Energy Management Model
The suggested scheme marries predicted renewable generation and load demand (obtained through CNN-GRU or other predictive algorithms) in synergy with an optimization framework for minimizing operational expenses while meeting system constraints. The step-by-step implementation procedure is as follows:
Step 1: Preparing the data for forecasting
Implementation is initiated with processing of historical microgrid operational data using the hybrid CNN-GRU forecasting algorithm (explained in
Section 4). It uses multi-modal inputs such as weather inputs as well as historical load profiles, processing them via convolutional layers for spatial processing of features followed by gated recurrent units for temporal processing. It produces predictions for the next 24 h for solar irradiance (translated in terms of PV power based on panel specifications), wind speed (translated in terms of turbine output based on power curves), and power demand. These predictions are normalized and formatted as time-series sequences for optimization.
Step 2: Initialization of optimization problem
With the predicted parameters, the optimization routine expresses the decision variables as a matrix of hourly power dispatch across all installed resources (wind, PV, diesel units, grid exchange, and demand response). In the objective function, total costs are minimized in terms of renewable generation costs, diesel fuel costs (modeled as quadratic functions), time-varying grid electricity price, as well as demand response incentives. Mathematical formulations are used for system constraints such as power balance equations, generation capacity according to predicted availability of renewables as well as equipment specifications, demand response limits (generally ±5% of load), as well as spinning reserve requirements.
Step 3: Population initialization and constraint pre-screening
ITLBO algorithm creates an initial population of candidate solutions within variable bounds. Each candidate dispatch schedule is subjected to constraint pre-screening where (1) power imbalance corrections are made within the most economic resources first—making use of grid capacity initially before firing up diesel generators; (2) violations of generation limits are rectified through clamping values within their allowed ranges; and (3) demand response measures are sized to remain within contract load modification boundaries. This repair mechanism guarantees that all candidate solutions originate within the feasible regions of the search space.
Step 4: Iterative optimization using adaptive constraint treatment
The algorithm advances through successive proposed ITLBO algorithm (Algorithm 1) cycles with incorporated constraint management, utilizing penalty-augmented fitness function (Equation (11)) that scores both cost effectiveness as well as compliance with the constraints. (1) Actual operational expenses (PV + wind + diesel + grid + DR); (2) scaled penalty terms for residual constraint violations; (3) bonus terms for the use of lower-cost resources.
Step 5: Convergence and solution extraction
Optimization stops at the maximum number of iterations (usually 200).
Step 6: The model obtains the final solution as the dispatch schedule of minimum validated cost, automatically meeting all operational requirements via the built-in repair mechanism. This schedule dictates: (1) hourly power outputs for individual PV systems as well as wind turbines, (2) dispatch levels for all diesel generators, (3) import/export quantities for grids, and (4) precise demand response adjustments. The solution matrix takes the form outlined in Equation (10).
While stochastic optimization offers theoretical robustness, ITLBO’s adaptive mechanisms provide a practical trade-off. The flowchart of the implementation procedure is shown in
Figure 2.
5. Results and Discussion
Simulations using the problem-solving framework monitored operational cost-effectiveness, predictive performance, and system robustness. All tests were performed in MATLAB 2021b on an Intel
® Core™ i7-6500U (2.5 GHz, 8 GB RAM), running the optimization algorithms (PSO, CO, TLBO, and the new ITLBO) 200 times over 20 separate trials with a group size of 50. This random sampling helped ensure that the performance comparisons were statistically reliable. Such random sampling had the effect of achieving statistical reliability in performance comparisons. The parameters for ITLBO is represented in
Table 1, and for other algorithms the original parameters of them are utilized.
A microgrid test system (
Figure 3) incorporated distributed energy resources consisting of two diesel generators (DGs) at Bus 22 and Bus 28, having quadratic cost functions with coefficients a = [0.00043, 0.000394] USD/kWh
2 and b = [21.6, 20.81] USD/kWh, corresponding to fuel and maintenance costs. Both DGs had their operational ranges between 30 and 33 MW (minimum) and 125 and 143 MVA (maximum) ranges. Two wind power generation units (two 200 kW wind turbines at Bus 15) and two PV power generation units (two 200 kW at Bus 12), both having generation costs of 0.1095 USD/kWh, were the sources of renewable generation. Grid interaction at Bus 1 adhered to the time-of-use (TOU) tariff of 0.17 USD/kWh for peak hours (1:00 PM–7:00 PM) and 0.076 USD/kWh for off-peak hours (7:00 PM–1:00 PM), within the limit of 300 kW import. Demand response (0.1 USD/kWh cost of load reduction) was applied for relief of peak demand stresses.
In terms of forecasting, the hybrid CNN-GRU outperformed CNN and MLANN baselines, utilizing its capacity for extracting patterns in solar irradiance and temperature as well as load profiles in both space and temporal dimensions. Optimization showed that ITLBO converged faster with lower operational expenses as compared to PSO, CO, and conventional TLBO due to its adaptive learning features.
5.1. Forecasting Performance Analysis
We methodically evaluate the predictive capability of the proposed CNN-GRU model in comparison with conventional CNN and MLANN methodologies for four key microgrid variables. The resulting variables predications of these methods are shown in
Figure 4,
Figure 5 and
Figure 6. As shown in
Figure 4, the predictions made by the CNN-GRU model (red dashed line) closely match the actual measurements (blue solid line), particularly for solar irradiance and ambient temperature, achieving correlation coefficients of 0.980 and 0.995, respectively. This visual superiority is reflected in
Table 2, in which CNN-GRU lessens the RMSE for solar irradiance by 11.6% in relation to CNN (61.79 vs. 69.94 W/m
2) and by 32.3% for ambient temperature (0.54 vs. 0.81 °C), demonstrating its ability to accurately capture both spatial and temporal trends in renewable generation data.
Downstream optimization is directly affected by forecasting accuracy, as the CNN-GRU’s MAPE of solar irradiance at 15.2% directly equates to PV power estimates for scheduling that are more accurate. All measures, however, indicate the possibility for improvement in power demand forecasting (CNN-GRU CC = 0.647), reflecting the capacity for adding contextual features such as calendar events or weather forecast as inputs in addition to the variables considered here. Visual examination in
Figure 4 graphically illustrates how the hybrid structure of the CNN-GRU produces steadier predictions across all variables, especially in sustaining phase accuracy for the diurnal patterns seen in solar generation and temperature trends.
The CNN-GRU model performs better than others in all the measures shown in
Table 2, making it the best choice for the next phase of optimization. While MLANN is slightly better at predicting temperature with a MAPE of 3.47% compared to 3.29%, CNN-GRU provides more consistent accuracy across all four variables, which is better for various forecasting needs in integrated energy management where different types of forecasts are used together. Unlike deterministic models without error bounds, the CNN-GRU’s probabilistic outputs (such as 95% confidence intervals) quantify forecast uncertainty, allowing ITLBO to dynamically modify scheduling decisions.
5.2. Optimal Energy Management: Case Configuration
To systematically evaluate the impact of forecasting accuracy on operational decisions, four optimization cases were designed:
Case 1 (Baseline): utilizes measured solar irradiance, ambient temperature, wind speed, and power demand data to establish the theoretical performance limit.
Case 2 (CNN-GRU): employs forecasts from the proposed hybrid CNN-GRU model as inputs to the optimization framework.
Case 3 (CNN): implements standalone CNN-based forecasts to isolate the contribution of temporal feature extraction.
Case 4 (MLANN): uses multilayer artificial neural network (MLANN) predictions to benchmark against conventional machine learning approaches.
Each case was solved using PSO, CO, TLBO, and the proposed ITLBO algorithms under identical microgrid constraints.
5.3. Case 1 (Baseline) Analysis: Optimal Scheduling with Actual Data
The baseline case determines the theoretical performance limit for the microgrid utilizing measured solar radiation, wind speed, temperature, and load data. The ITLBO algorithm created a 24 h plan (
Figure 7) that makes the best use of renewable energy while reducing the need for diesel generators (DGs) and electricity from the grid. At maximum solar generation at Hour 13 (244.32 kW PV), the renewable generation fully offset grid buys, taking advantage of time-of-use pricing and bypassing peak tariffs of
$0.17/kWh. Diesel generators ran at minimum capacity (63 kW) for 22 h, peaking only at Hour 16 (75.20 kW) in response to concurrent wind generation reduction (129.44 kW) and peak demand (540.07 kW).
ITLBO’s cost-effectiveness is reflected in
Table 3 at
$33,433.42—the lowest total daily cost in the three scenarios—19.3% less than PSO (
$41,231.15) and 48.1% lower than CO (
$64,390.27). This cost benefit is due to three synergistic tactics: prioritization of renewables, grid import optimization, and demand response efficiency. By leveraging maximum contributions of PV and wind power (
$80.00 +
$108.27), ITLBO decreased diesel costs by 19.4% over TLBO (
$32,317 vs.
$46,365). Strategic buys in the off-periods, like Hour 5 (222.62 kW at
$0.076/kWh), cut grid costs by 60.3% compared to CO (
$148.63 vs.
$442.34). Though aggressive load shifting raised the cost of demand response (
$779.36), it allowed for a peak diesel use reduction of 28.7% over PSO, illustrating cost-saving demand-side management.
Convergence analysis (
Figure 8) highlights ITLBO’s computational superiority, reaching quick stabilization near-optimum costs at iteration 85 at
$4,331,405.81, with additional fine-tuning at the final cost of
$33,433.42 at iteration 200. In direct contradiction, emphasis is seen with prolonged oscillations in the case of PSO, reaching but not exceeding suboptimal costs at
$51,300.79 at iteration 142, ending at
$41,231.15 at 200 iterations. TLBO showed performance in between, plateauing at
$47,567.25 at iteration 117, whereas CO did not escape local optima. The reasonable difference in algorithm performance—ITLBO’s end cost being 80.9% less than CO and 19.3% less than PSO—reflects the key contribution of adaptive learning processes. Even with perfect predictions (Case 1), ITLBO’s ability to handle complex limits and avoid settling too soon makes it a top choice for managing energy based on forecasts.
5.4. Case 2 (CNN-GRU) Analysis: Forecast-Driven Optimization
Combining CNN-GRU predictions with ITLBO resulted in near-optimum performance at
$33,538.17—a negligible cost overrun of just 0.3% above Case 1. This minimal deviation reflects the hybrid model’s predictive accuracy as well as the predictive uncertainty reduction capability of ITLBO. As seen in
Figure 9, at Hour 10, the algorithm utilized an excess PV (197.23 kW) capacity for zeroing grid imports (139.78 kW) while running diesel generators at the minimum for 22 h. There was a strategic deviation at Hour 23, with wind generation (1.84 kW) and grid exports (−5.03 kW) taking advantage of predicted price differentials for optimized revenue generation.
ITLBO dominance is measured in
Table 4, where renewable use costs (
$68.08 PV +
$112.88 wind) beat out PSO by 19% using exact calibration with forecast availability. Grid costs were kept at
$189.29—45.3% below CO—by limiting imports to off-peaking windows such as Hour 5 (44.16 kW). While costs for DR were higher at
$696.82 (compared to
$779.36 in Case 1), this approach saved
$12,450 in diesel/grid costs over TLBO.
Convergence trends (
Figure 10) measure ITLBO’s better ability to cope with forecast uncertainties. The algorithm cuts costs down to 99.98% in the 48th round, from
$323.18 million in the initial round to
$43.35 thousand in cost, utilizing CNN-GRU’s patterns across space and time effectively. On the other hand, PSO is in erratic form, taking 46 iterations to get out of local minima (Iteration 1:
$691.01M → Iteration 46:
$63.98k) while stabilizing only at Iteration 142 (
$39.01k). Interestingly, ITLBO finds near-optimal scheduling at Iteration 65—at
$41.15k—47 iterations ahead of the stabilization of PSO while it keeps maintaining at least a 99.9% difference in cost over CO, which plateaus at
$68.94M due to uncontrolled forecast volatility.
ITLBO (
$33,538.17) vs. CO (
$55,025.75) difference amounts to
$21,487.58 (
Table 4), demonstrating capability in minimizing CNN-GRU’s residual prediction errors through ITLBO. For instance, in the period between Iterations 8 and 17, ITLBO exploited the enhanced short-term wind forecast (Hour 23: actual of 7.19 kW vs. predicted at 1.84 kW) in order to conserve
$2.13 million at each step, whereas PSO incurred
$216,000 in penalties as it depended on false solar predictions. This deviation illustrates ITLBO’s exclusive capability in balancing exploration based on forecast as well as exploitation of grid constraints, stabilizing 77% faster than TLBO (Iteration 114 vs. Iteration 65).
This case illustrates the practical applicability of the CNN-GRU-ITLBO framework, where high-quality predictions allow for near-optimum scheduling. Case 1’s 1.8% cost difference between Case 1 and Case 2 is in stark contrast with Case 4’s 6.1% penalty for MLANN, highlighting the benefit of using hybrids of spatiotemporal modeling.
5.5. Case 3 (CNN) Analysis: Standalone Forecasting Limitations
The independent CNN model incorporated measurable inefficiencies, as ITLBO reached
$34,044.60 (
Table 5)—a 1.8% cost higher than CNN-GRU (Case 2). The hourly optimal scheduling results of ITLBO is shown in
Figure 11. As seen, in Hour 17, limitations in temporal modeling caused excessive wind generation (242.45 kW predicted vs. 160.89 kW actual), initiating unnecessary grid exports (−52.49 kW DR adjustment) as well as a
$216.31 grid penalty. Diesel demand surged to 96.66 kW in Hour 23 in response to solar prediction errors (6.98 kW actual vs. 24.10 kW predicted).
Cost breakdowns (
Table 5) indicate CNN’s weaknesses: excessive wind overcommitting wind costs 33.7% higher at
$150.95 as opposed to Case 2 at
$112.88, while wild forecasting forced peak-load grid imports (Hour 1: 232.99 kW at
$0.17/kWh), increasing grid costs to
$261.61. It should be noted that, while CNN-GRU excels in spatiotemporal forecasting, standalone CNN or MLANN remain viable for microgrids with low-dimensional data or limited computational resources.
Convergence analysis (
Figure 12) quantifies ITLBO’s resilience to CNN’s temporal blind spots, achieving a 95.5% cost reduction by iteration 16 (
$903.7M →
$99.96k) through aggressive exploitation of transient solar overestimations. Despite CNN’s erratic wind predictions (Hour 17: 242.45 kW forecasted vs. 160.89 kW actual), ITLBO stabilized at
$34,044.60 by iteration 200 with 0.3% residual oscillations (
$34,044.60 ±
$102.50), maintaining a
$3833.56 cost advantage over PSO (
$37,878.16).
5.6. Case 4 (MLANN) Analysis: Benchmarking Conventional Forecasting
MLANN-ITLBO combined made
$33,050.60—a 1.4% improvement on CNN-GRU but 12.9% lower than independent CNN, as represented in
Table 6. Form
Figure 13, there is encountered difficulty at Hour 15 due to underestimating solar power (6.90 kW generated vs. an expected 24.50 kW), resulting in costly peak-load grid imports of 291.78 kW as well as a 60 kW boost via the diesel unit. In response, fine wind forecasting at Hour 7 (154.69 kW) saved
$12,320 in costs versus CO on the grid.
MLANN’s middle capability is revealed in
Table 6: renewable costs fell to
$32.41 for PV and
$94.33 for wind (58% less than CO), whereas off-peak grid imports (such as Hour 24: 231.03 kW) maintained grid costs at
$150.50—73.2% reduction below TLBO. Though costs for DR rose to
$782.75, these adjustments saved
$15,230 in costs for diesel. Regardless of the rise in the costs of DR to
$782.75, these savings avoided
$15,230 in the costs of diesel.
Convergence analysis (
Figure 14) illustrates that ITLBO is able to take charge of ambiguous forecasts between MLANN, saving costs by 99.995% within the 21st iteration (
$684.23M down to
$55.98k). The algorithm improves continually, achieving
$33,050.60 in terms of cost at the point where it stabilizes at the 200th iteration with just 0.07% difference in variance (
$33,050.60 ±
$23.42). It continues striving for improvement, achieving
$33,050.60 as its plateau in cost at the 200th iteration with just 0.07% residual oscillation (
$33,050.60 ±
$23.42). In stark contrast, oscillating unstable results are observed for PSO, momentarily losing direction at the 130th iteration at
$58.21k due to discordant solar and wind predictions, before recovering partially towards
$37,998.34, being 15.0% less optimal than ITLBO.
6.1% penalty on Case 1—compared to that of CNN-GRU at 0.3%—justifies hybrid models as the choice for applications requiring high accuracy. Though ITLBO is capable in addressing forecasting problems, the inability of MLANN to treat time and space relations hinders it, reinforcing that CNN-GRU is the optimal choice.
5.7. Statistical Performance Analysis
The statistical findings of different algorithms in each case, as depicted in
Table 7, illustrate ITLBO’s overall superiority in all the test cases. Having the lowest mean costs (
$33,500–
$34,390) and the smallest standard deviations (
$290–
$450), ITLBO is both optimal and reliable. Its poorest result (CNN case) is still better than the best solutions of PSO by 10–15%, which proves its strong constraint-handling ability. Though ITLBO consumes higher computation times (1.06–1.19 s vs. 0.03–0.06 s for PSO/TLBO), this is compensatory for its ability to avoid catastrophic constraint violations in CO (with mean costs
$63 M–
$255 M). ITLBO’s narrow standard deviation of its outcomes (±1% of mean costs) asserts its stability over the wider oscillations of PSO (±6%).
The experiments reveal two significant trends. First, it is seen that forecasting performance directly influences optimization performance: CNN-GRU-enhanced ITLBO resulted in costs within 0.3% of the baseline, whereas CNN and MLANN incurred penalties of 1.4–4.1%. Secondly, ITLBO’s ability to learn and adjust effectively handles forecast mistakes, showing a 40–50% lower standard deviation compared to PSO under the same forecasting conditions. CO’s repeated failure (maximum costs above
$250 M) strengthens the case for penalty-sensitive algorithms for microgrid scheduling, where the compromise at the line level has serious operational ramifications. Overall, these results show that ITLBO is the best algorithm for managing electricity a day in advance, even though it requires more computing power to adjust and learn. ITLBO’s computational complexity scales linearly with population size, similar to PSO/TLBO, but its adaptive mechanisms reduce iterations needed for convergence (
Table 7). Furthermore, ITLBO’s constraint handling (Equation (11)) ensures stable operation even with 10% forecast bias, as demonstrated in Cases 2–4.
5.8. Cost Optimization Performance Analysis
Table 8 illustrates how significantly ITLBO reduces costs in various forecasting scenarios relative to the
$110,488.34 non-optimal base cost. Amazingly, consistency in the reduction is found in the analysis across different forecasting methods used, with ITLBO saving about 70%. Perfect information base case sets the theoretical maximum at the 69.7% reduction of
$33,433, whereas cases based on forecast illustrate the resilience of the optimization approach. Most noteworthy is the hybrid CNN-GRU approaching closest ideal circumstances with only a 0.3% performance discrepancy, whereas individual CNN has slightly poorer outcomes (69.2%). Perhaps unexpectedly, the case of MLANN has better outcomes than others in terms of savings at 70.1%, as potentially its conservative forecasting might have unconsciously circumnavigated peak tariff times.
Table 9 quantifies the relative significance of various factors influencing microgrid operational costs. We can see that algorithm selection has the biggest impact on performance (10–15% difference between ITLBO and PSO), but the accuracy of prediction matters as well (0.5–2%). The improvement of 70% in costs savings relative to non-optimal operation stresses the critical role of optimization in microgrid management. ITLBO’s adaptability is especially important in conjunction with CNN-GRU predictions, together providing both robust and economically optimal scheduling solutions. ITLBO’s computation overhead (1.1–1.2 s versus 0.03–0.05 s for less complex methods) is justified in light of its better handling of constraints as well as overall performance stability regardless of forecast qualities.