<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "JATS-journalpublishing1-3-mathml3.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" article-type="research-article" dtd-version="1.3" xml:lang="EN">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Energy Res.</journal-id>
<journal-title-group>
<journal-title>Frontiers in Energy Research</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Energy Res.</abbrev-journal-title>
</journal-title-group>
<issn pub-type="epub">2296-598X</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="publisher-id">1654803</article-id>
<article-id pub-id-type="doi">10.3389/fenrg.2025.1654803</article-id>
<article-version article-version-type="Version of Record" vocab="NISO-RP-8-2008"/>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Original Research</subject>
</subj-group>
</article-categories>
<title-group>
<article-title>A hybrid ANFIS-transformer framework tuned by enhanced HawkFish optimization for voltage and load balancing in smart grids</article-title>
<alt-title alt-title-type="left-running-head">Mushref Aldulaimi et al.</alt-title>
<alt-title alt-title-type="right-running-head">
<ext-link ext-link-type="uri" xlink:href="https://doi.org/10.3389/fenrg.2025.1654803">10.3389/fenrg.2025.1654803</ext-link>
</alt-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" corresp="yes">
<name>
<surname>Mushref Aldulaimi</surname>
<given-names>Omer Muneam</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
<xref ref-type="corresp" rid="c001">&#x2a;</xref>
<uri xlink:href="https://loop.frontiersin.org/people/3108335"/>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="software" vocab-term-identifier="https://credit.niso.org/contributor-roles/software/">Software</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="methodology" vocab-term-identifier="https://credit.niso.org/contributor-roles/methodology/">Methodology</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Data curation" vocab-term-identifier="https://credit.niso.org/contributor-roles/data-curation/">Data curation</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="investigation" vocab-term-identifier="https://credit.niso.org/contributor-roles/investigation/">Investigation</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="conceptualization" vocab-term-identifier="https://credit.niso.org/contributor-roles/conceptualization/">Conceptualization</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Writing &#x2013; review &amp; editing" vocab-term-identifier="https://credit.niso.org/contributor-roles/writing-review-editing/">Writing &#x2013; review &amp; editing</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Writing &#x2013; original draft" vocab-term-identifier="https://credit.niso.org/contributor-roles/writing-original-draft/">Writing &#x2013; original draft</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Project administration" vocab-term-identifier="https://credit.niso.org/contributor-roles/project-administration/">Project administration</role>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Kurnaz</surname>
<given-names>Sefer</given-names>
</name>
<xref ref-type="aff" rid="aff2">
<sup>2</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/2234124"/>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Writing &#x2013; original draft" vocab-term-identifier="https://credit.niso.org/contributor-roles/writing-original-draft/">Writing &#x2013; original draft</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="resources" vocab-term-identifier="https://credit.niso.org/contributor-roles/resources/">Resources</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Funding acquisition" vocab-term-identifier="https://credit.niso.org/contributor-roles/funding-acquisition/">Funding acquisition</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="visualization" vocab-term-identifier="https://credit.niso.org/contributor-roles/visualization/">Visualization</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="methodology" vocab-term-identifier="https://credit.niso.org/contributor-roles/methodology/">Methodology</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Formal analysis" vocab-term-identifier="https://credit.niso.org/contributor-roles/formal-analysis/">Formal analysis</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="validation" vocab-term-identifier="https://credit.niso.org/contributor-roles/validation/">Validation</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="software" vocab-term-identifier="https://credit.niso.org/contributor-roles/software/">Software</role>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Farhan</surname>
<given-names>Hameed Mutlag</given-names>
</name>
<xref ref-type="aff" rid="aff2">
<sup>2</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/3281925"/>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="visualization" vocab-term-identifier="https://credit.niso.org/contributor-roles/visualization/">Visualization</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="investigation" vocab-term-identifier="https://credit.niso.org/contributor-roles/investigation/">Investigation</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="supervision" vocab-term-identifier="https://credit.niso.org/contributor-roles/supervision/">Supervision</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Funding acquisition" vocab-term-identifier="https://credit.niso.org/contributor-roles/funding-acquisition/">Funding acquisition</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Data curation" vocab-term-identifier="https://credit.niso.org/contributor-roles/data-curation/">Data curation</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Project administration" vocab-term-identifier="https://credit.niso.org/contributor-roles/project-administration/">Project administration</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Writing &#x2013; review &amp; editing" vocab-term-identifier="https://credit.niso.org/contributor-roles/writing-review-editing/">Writing &#x2013; review &amp; editing</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="validation" vocab-term-identifier="https://credit.niso.org/contributor-roles/validation/">Validation</role>
<role vocab="credit" vocab-identifier="https://credit.niso.org/" vocab-term="Writing &#x2013; original draft" vocab-term-identifier="https://credit.niso.org/contributor-roles/writing-original-draft/">Writing &#x2013; original draft</role>
</contrib>
</contrib-group>
<aff id="aff1">
<label>1</label>
<institution>Electrical and Computer Engineering, Altinbas University</institution>, <city>Istanbul</city>, <country country="TR">T&#xfc;rkiye</country>
</aff>
<aff id="aff2">
<label>2</label>
<institution>Computer Engineering, Altinbas University</institution>, <city>Istanbul</city>, <country country="TR">T&#xfc;rkiye</country>
</aff>
<author-notes>
<corresp id="c001">
<label>&#x2a;</label>Correspondence: Omer Muneam Mushref Aldulaimi, <email xlink:href="203720322@ogr.altinbas.edu.tr">203720322@ogr.altinbas.edu.tr</email>
</corresp>
</author-notes>
<pub-date publication-format="electronic" date-type="pub" iso-8601-date="2025-12-12">
<day>12</day>
<month>12</month>
<year>2025</year>
</pub-date>
<pub-date publication-format="electronic" date-type="collection">
<year>2025</year>
</pub-date>
<volume>13</volume>
<elocation-id>1654803</elocation-id>
<history>
<date date-type="received">
<day>27</day>
<month>06</month>
<year>2025</year>
</date>
<date date-type="rev-recd">
<day>10</day>
<month>07</month>
<year>2025</year>
</date>
<date date-type="accepted">
<day>30</day>
<month>07</month>
<year>2025</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#xa9; 2025 Mushref Aldulaimi, Kurnaz and Farhan.</copyright-statement>
<copyright-year>2025</copyright-year>
<copyright-holder>Mushref Aldulaimi, Kurnaz and Farhan</copyright-holder>
<license>
<ali:license_ref start_date="2025-12-12">https://creativecommons.org/licenses/by/4.0/</ali:license_ref>
<license-p>This is an open-access article distributed under the terms of the <ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution License (CC BY)</ext-link>. The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</license-p>
</license>
</permissions>
<abstract>
<p>This paper presents a novel hybrid framework that integrates an Adaptive Neuro-Fuzzy Inference System (ANFIS) with a Transformer model, optimized through an Enhanced HawkFish Optimization Algorithm (EHFOA), to enhance voltage regulation and load balancing in smart grid environments. The proposed system leverages the temporal modeling capabilities of Transformers for accurate load and voltage prediction, while ANFIS enables adaptive, rule-based control in dynamic operating conditions. EHFOA, incorporating strategies such as L&#xe9;vy flight, energy-aware movement, and elite memory, is designed to fine-tune the hyperparameters of both ANFIS and the Transformer for optimal performance. Simulation results using a real-time load monitoring dataset from Kaggle show that the proposed method significantly outperforms traditional ANFIS-only and Transformer-only models. In simulation on a 5 kW PV-battery system, the proposed model achieved a voltage-forecasting RMSE of 1.24 V and MAE of 0.96 V (1.50% MAPE), and a load-forecasting RMSE of 4.15 kW and MAE of 3.22 kW (3.10% MAPE), outperforming standalone Transformer (2.65 V RMSE, 8.12 kW RMSE) and ANFIS (3.43 V RMSE, 9.65 kW RMSE) benchmarks. In grid-control tests, the hybrid controller reduced system energy loss to 3.10%, a 54.4% improvement over the Transformer-only case (6.80% loss). EHFOA delivered rapid convergence&#x2014;best fitness 0.0094 in 58 iterations&#x2014;with a runtime of 46.3 s and a final RMSE of 1.24 V, surpassing GA, PSO, and GWO optimizers. These results demonstrate the framework&#x2019;s ability to deliver high-accuracy forecasting, significant energy-loss reduction, and efficient optimization for next-generation smart-grid deployment.</p>
</abstract>
<kwd-group>
<kwd>smart grid</kwd>
<kwd>anfis</kwd>
<kwd>transformer</kwd>
<kwd>metaheuristic optimization</kwd>
<kwd>EHFOA</kwd>
<kwd>voltage stability</kwd>
<kwd>load forecasting</kwd>
<kwd>energy management</kwd>
</kwd-group>
<funding-group>
<funding-statement>The author(s) declare that no financial support was received for the research and/or publication of this article.</funding-statement>
</funding-group>
<counts>
<fig-count count="14"/>
<table-count count="12"/>
<equation-count count="22"/>
<ref-count count="40"/>
<page-count count="26"/>
</counts>
<custom-meta-group>
<custom-meta>
<meta-name>section-in-acceptance</meta-name>
<meta-value>Smart Grids</meta-value>
</custom-meta>
</custom-meta-group>
</article-meta>
</front>
<body>
<sec id="s1" sec-type="intro">
<label>1</label>
<title>Introduction</title>
<p>The rapid evolution of modern power systems toward decentralization and sustainability has increased the integration of renewable energy sources&#x2014;especially photovoltaic (PV) systems&#x2014;into smart grids (<xref ref-type="bibr" rid="B15">International Energy Agency, 2019</xref>). These grids must be intelligent, responsive, and self-optimizing. They rely on real-time data analysis, adaptive control, and predictive modeling to maintain stability. However, solar energy&#x2019;s inherent intermittency and the nonlinear, time-varying nature of load demands create significant challenges. Traditional control methods&#x2014;often rule-based or based on static optimization&#x2014;struggle to adapt in real time. The result is higher losses, voltage instability, and reduced reliability (<xref ref-type="bibr" rid="B12">Gao et al., 2024</xref>). To overcome these issues, researchers have turned to intelligent systems that learn from historical patterns and adapt to changing conditions. Yet most existing approaches treat prediction and control as separate problems (<xref ref-type="bibr" rid="B36">Xia et al., 2024</xref>). Forecasting models such as CNNs, LSTMs, and Transformers excel at predicting future states but do not directly translate those predictions into control actions. On the other hand, fuzzy-logic controllers or reinforcement-learning agents act on current snapshots without leveraging temporal forecasts. Tuning hybrid AI architectures adds another layer of difficulty. Manual parameter selection and simple heuristics often fall short when balancing multiple objectives&#x2014;minimizing power loss, maintaining voltage profiles, and maximizing PV energy extraction&#x2014;simultaneously (<xref ref-type="bibr" rid="B19">Kumar et al., 2024</xref>). In this paper, we introduce a unified control framework that bridges these gaps. First, a Transformer network captures temporal patterns in voltage and load data. Next, an Adaptive Neuro-Fuzzy Inference System (ANFIS) interprets those patterns to generate control actions. Finally, an Enhanced HawkFish Optimization Algorithm (EHFOA) automatically tunes all parameters to optimize voltage stability, load balancing, and energy efficiency. By embedding global optimization into the predictive control loop, our method adapts in real time to PV variability and dynamic loads. The result is a smart-grid controller that sets a new benchmark for reliability and efficiency in distributed energy systems. The projected global growth of distributed solar PV capacity across major regions is illustrated in <xref ref-type="fig" rid="F1">Figure 1</xref> (<xref ref-type="bibr" rid="B1">Abdollahi Chirani and Karami, 2024</xref>).</p>
<fig id="F1" position="float">
<label>FIGURE 1</label>
<caption>
<p>Global PV market growth projection (<xref ref-type="bibr" rid="B15">International Energy Agency, 2019</xref>).</p>
</caption>
<graphic xlink:href="fenrg-13-1654803-g001.tif">
<alt-text content-type="machine-generated">Bar chart titled &#x22;Distributed solar PV capacity growth by country/region&#x22; showing growth in gigawatts from December 2007 to 2019-2024, divided into main and accelerated scenarios. China leads growth in all periods, especially in 2019-2024 accelerated. Other regions include North America, Europe, Asia and Pacific, Latin America, MENA, Sub-Saharan Africa, Eurasia, and others.</alt-text>
</graphic>
</fig>
<p>
<xref ref-type="bibr" rid="B12">Gao et al. (2024)</xref>, (<xref ref-type="bibr" rid="B9">Basha et al., 2024</xref>) proposed a two-stage multi-agent deep reinforcement learning (DRL) framework for distribution network reconfiguration with an emphasis on switch contribution. In their approach, the reconfiguration problem is treated as a cooperative multi-agent task where each agent controls a switch, and a QMIX-based value decomposition method is employed to aggregate local utilities into a global one. The introduction of a switch contribution factor significantly reduces the action space and helps avoid redundant switching, leading to faster convergence and better power loss reduction. Their method performs well in large-scale urban grids and outperforms traditional greedy and single-agent baselines in terms of energy loss minimization and reconfiguration speed. <xref ref-type="bibr" rid="B36">Xia et al. (2024)</xref>, (<xref ref-type="bibr" rid="B24">Maciel et al., 2024</xref>) tackled the decentralized operation of networked microgrids using a hierarchical safe DRL method that coordinates voltage and reactive power control. The system architecture integrates a high-level policy controller trained using safe policy optimization with lower-level distributed droop control. The key innovation lies in ensuring operational constraints (e.g., voltage and current limits) are not violated during training or deployment, using constrained Markov decision processes. Their method demonstrates superior scalability and safety under uncertain load and generation profiles compared to centralized DRL approaches. <xref ref-type="bibr" rid="B19">Kumar et al. (2024)</xref>, <xref ref-type="bibr" rid="B30">Shejul and Harikrishnan (2024)</xref> investigated the use of artificial neural networks (ANN) for maximum power point tracking (MPPT) in PV systems under varying irradiance conditions. Their neural MPPT model was trained to map current-voltage pairs to optimal duty cycles, showing faster convergence and higher steady-state power output compared to traditional P&#x26;O and incremental conductance methods. The authors demonstrated that ANN-based controllers adapt better to abrupt changes in solar conditions and improve energy harvesting efficiency in highly dynamic environments. <xref ref-type="bibr" rid="B8">Barman et al. (2024)</xref> proposed a hybrid MPPT controller combining fuzzy logic and perturb and observe (P&#x26;O) methods for photovoltaic arrays under partial shading conditions. The fuzzy logic module compensates for the oscillatory behavior of conventional P&#x26;O by dynamically adjusting the perturbation step size based on real-time voltage and current deviations. Their Simulink-based validation showed improved tracking accuracy and lower power loss during shading transitions, making the controller highly applicable for real-world rooftop PV systems with non-uniform irradiance. <xref ref-type="bibr" rid="B6">Andr&#xe9; et al. (2023)</xref>, (<xref ref-type="bibr" rid="B25">Muhamediyeva and Safarova, 2024</xref>) presented a novel incremental conductance feedback MPPT technique with an integral compensator, tested using hardware-in-the-loop (HIL) simulation. Their enhancement introduces an integrative feedback mechanism that stabilizes the duty cycle during steady-state conditions, addressing the overshooting and chattering typically observed in conventional MPPT schemes. Experimental results from the HIL setup validated the algorithm&#x2019;s ability to track the maximum power point precisely with minimal settling time and reduced ripple, demonstrating practical viability for embedded PV controllers. <xref ref-type="bibr" rid="B30">Shejul and Harikrishnan (2024)</xref>, (<xref ref-type="bibr" rid="B34">Verbytskyi et al., 2022</xref>) focused on energy optimization of chiller plants using a genetic algorithm (GA) hybridized with the grey wolf optimizer (GWO) and the JAYA algorithm under dynamic pricing demand response (DR) conditions. Their composite optimizer aims to minimize operational cost while maintaining temperature constraints. The problem is formulated as a nonlinear, mixed-integer programming task, and their method shows faster convergence and superior energy savings compared to standalone GA and GWO algorithms, especially in scenarios involving time-varying electricity prices. Muhamediyeva and Safarova (2024) (<xref ref-type="bibr" rid="B6">Andr&#xe9; et al., 2023</xref>) applied a genetic algorithm for the multi-constraint optimization of power system operating modes, emphasizing reactive power balancing and load flow stability. Their formulation involves non-linear constraints including voltage deviation limits and reactive power balance, solved through fitness-driven GA evolution. Simulation on an IEEE 30-bus system confirmed that their method significantly improves voltage profiles and reduces line losses compared to deterministic load flow optimization. <xref ref-type="bibr" rid="B40">Zulfiqar et al. (2023)</xref>, (<xref ref-type="bibr" rid="B10">&#xc7;akmak et al., 2023</xref>) proposed a hybrid short-term load forecasting model that integrates wavelet neural networks (WNN) with a self-adaptive momentum factor. Their approach uses wavelet decomposition to extract multi-scale temporal features from load signals, which are then used as input to a WNN trained with a dynamically adjusted momentum parameter. The method shows strong generalization capability and outperforms traditional WNN and LSTM-based predictors in terms of RMSE and MAE across several seasonal and daily load datasets. <xref ref-type="bibr" rid="B37">Zhang et al. (2023)</xref>, (<xref ref-type="bibr" rid="B33">van der Meer et al., 2021</xref>) designed a real-time load forecasting model based on a CNN&#x2013;BiLSTM architecture optimized using Bayesian methods. Their hybrid network captures both local spatial patterns (via CNN) and long-range temporal dependencies (via BiLSTM), while the Bayesian optimization framework automates the tuning of learning rate, hidden units, and dropout rates. Experiments conducted on smart meter datasets demonstrated low latency and strong robustness under noisy and incomplete input sequences, positioning their model as highly suitable for real-time smart grid load prediction. <xref ref-type="bibr" rid="B26">Per&#xe7;uku et al. (2025)</xref>, (<xref ref-type="bibr" rid="B22">Liu et al., 2023</xref>) developed a machine learning framework that integrates transformer-based deep learning with time series clustering to enhance electricity load forecasting. The framework first applies unsupervised clustering to detect structural regimes in load data, then trains a transformer model on each cluster, allowing for more specialized temporal representations. This dual-stage strategy improved generalization to abrupt changes in consumption behavior and enabled the model to handle seasonal load fluctuations better than LSTM, GRU, or attention-based baselines. <xref ref-type="table" rid="T1">Table 1</xref> below provides a summary of the related work.</p>
<table-wrap id="T1" position="float">
<label>TABLE 1</label>
<caption>
<p>Summary of related works.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="center">Ref.</th>
<th align="center">Methodology</th>
<th align="center">Application</th>
<th align="center">Key contribution</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">
<xref ref-type="bibr" rid="B12">Gao et al. (2024)</xref>
</td>
<td align="left">Two-stage multi-agent RL &#x2b; QMIX</td>
<td align="left">Urban DN reconfiguration</td>
<td align="left">Switch contribution metric &#x2b; reward-sharing structure</td>
</tr>
<tr>
<td align="left">
<xref ref-type="bibr" rid="B36">Xia et al. (2024)</xref>
</td>
<td align="left">Safe deep RL &#x2b; droop control &#x2b; multi-agent</td>
<td align="left">Networked microgrid coordination</td>
<td align="left">Decentralized coordination under constraints</td>
</tr>
<tr>
<td align="left">
<xref ref-type="bibr" rid="B19">Kumar et al. (2024)</xref>
</td>
<td align="left">ANN-based MPPT</td>
<td align="left">PV system optimization</td>
<td align="left">Faster convergence vs conventional P&#x26;O</td>
</tr>
<tr>
<td align="left">
<xref ref-type="bibr" rid="B9">Basha et al. (2024)</xref>
</td>
<td align="left">Hybrid MPPT (multi-algorithm)</td>
<td align="left">PV under partial shading</td>
<td align="left">Robustness in real-world shading scenarios</td>
</tr>
<tr>
<td align="left">
<xref ref-type="bibr" rid="B30">Shejul and Harikrishnan (2024)</xref>
</td>
<td align="left">GA &#x2b; GWO &#x2b; JAYA</td>
<td align="left">Chiller plant optimization</td>
<td align="left">Energy savings via hybrid evolutionary search</td>
</tr>
<tr>
<td align="left">
<xref ref-type="bibr" rid="B25">Muhamediyeva and Safarova (2024)</xref>
</td>
<td align="left">Genetic algorithm</td>
<td align="left">Power system mode optimization</td>
<td align="left">Multi-constraint nonlinear optimization</td>
</tr>
<tr>
<td align="left">
<xref ref-type="bibr" rid="B6">Andr&#xe9; et al. (2023)</xref>
</td>
<td align="left">Incremental conductance &#x2b; integral compensator (MPPT)</td>
<td align="left">PV with hardware-in-loop</td>
<td align="left">Real-time robustness and accuracy</td>
</tr>
<tr>
<td align="left">
<xref ref-type="bibr" rid="B40">Zulfiqar et al. (2023)</xref>
</td>
<td align="left">WNN &#x2b; adaptive momentum</td>
<td align="left">Short-term load forecasting</td>
<td align="left">Accurate forecasts using feature engineering</td>
</tr>
<tr>
<td align="left">
<xref ref-type="bibr" rid="B37">Zhang et al. (2023)</xref>
</td>
<td align="left">CNN&#x2013;BiLSTM &#x2b; Bayesian optimization</td>
<td align="left">Real-time load forecasting</td>
<td align="left">Low-latency, high-accuracy predictions</td>
</tr>
<tr>
<td align="left">
<xref ref-type="bibr" rid="B26">Per&#xe7;uku et al. (2025)</xref>
</td>
<td align="left">Transformer &#x2b; time-series clustering</td>
<td align="left">Load forecasting in smart grid</td>
<td align="left">Adaptability to time-dependent patterns</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>Despite deep technical insights and innovative solutions, current smart-grid methodologies share several key limitations. First, temporal learning and control remain decoupled. Models by Zhang et al. (CNN&#x2013;BiLSTM) and Per&#xe7;uku et al. (Transformer) excel at short-term load forecasting, but they do not integrate control actions. As a result, forecasts are generated yet never directly used for voltage stabilization, power-quality regulation, or other grid responses. Second, reinforcement-learning approaches (<xref ref-type="bibr" rid="B12">Gao et al., 2024</xref>; <xref ref-type="bibr" rid="B36">Xia et al., 2024</xref>) deliver robust reconfiguration and microgrid coordination. However, they rely on complex reward shaping and exploration heuristics. This reliance makes them hard to generalize across different network topologies and unsafe in out-of-distribution scenarios. Moreover, these black-box policies sacrifice interpretability and can behave unpredictably in safety-critical applications. Third, MPPT optimization works (Kumar, Basha, Andr&#xe9;) focus narrowly on maximizing PV power extraction. They ignore wider grid interactions&#x2014;such as load variability, frequency regulation, and voltage support. Their reliance on static ANNs or fuzzy-P&#x26;O rules also leaves them vulnerable under rapidly changing and partially shaded conditions. Fourth, hybrid metaheuristics (Shejul, Muhamediyeva) tackle energy-scheduling problems effectively. Yet they treat loads, generation, and storage as isolated variables. They do not jointly optimize forecasting models (for load or irradiance) with control mechanisms (MPPT tuning or voltage regulation). This siloed approach yields suboptimal overall performance in dynamic environments. Finally, very few studies explore truly unified frameworks. Almost none combine temporal feature extraction, fuzzy-logic reasoning, and evolutionary optimization within a single architecture. Importantly, none embed a global optimizer&#x2014;such as a metaheuristic&#x2014;into the learning-control loop to tune hybrid systems like ANFIS-Transformer models. This gap limits adaptability, interpretability, and real-time responsiveness&#x2014;qualities essential for next-generation smart grids. <xref ref-type="fig" rid="F2">Figure 2</xref> illustrates our unified control architecture, which closes critical gaps in existing smart-grid solutions. First, a Transformer encoder extracts temporal features from historical voltage, load, and irradiance data. Those features feed directly into an ANFIS module, which issues real-time control commands. This tight coupling makes forecasts immediately actionable for dynamic load balancing, voltage regulation, and MPPT&#x2014;turning passive prediction into an embedded control agent. Unlike CNN&#x2013;BiLSTM or Transformer-only approaches, our method embeds prediction within a feedback loop. The ANFIS layer adds interpretability through fuzzy rules and membership functions. Engineers can trace each control decision&#x2014;something black-box DRL models (e.g., <xref ref-type="bibr" rid="B12">Gao et al., 2024</xref>; <xref ref-type="bibr" rid="B36">Xia et al., 2024</xref>) cannot offer. This transparency is vital for reliability, regulatory compliance, and operator trust in mission-critical grid environments. Next, we broaden MPPT beyond pure power extraction. By processing irradiance and load trends through the temporal encoder and fuzzy logic, the system dynamically balances maximum PV output with voltage stability and energy-loss reduction. In effect, MPPT becomes one mode of a larger adaptive decision-making structure rather than an isolated algorithm. Finally, an Enhanced HawkFish Optimization Algorithm (EHFOA) tunes every component automatically. Instead of manual or heuristic parameter selection, EHFOA explores the joint space of ANFIS membership functions and Transformer hyperparameters. It leverages L&#xe9;vy flights, energy-aware movements, elite memory, and clustering to escape local minima and converge on Pareto-optimal solutions. This end-to-end, multi-objective optimization across the hybrid architecture has no counterpart in prior work. Because the design is modular, it can be applied to load forecasting, demand-side management, PV optimization, or storage control without losing interpretability or adaptability. By bridging time-aware prediction, human-intelligible decision logic, and advanced evolutionary tuning, our ANFIS-Transformer-EHFOA framework offers a comprehensive, novel solution for today&#x2019;s complex, dynamic smart grids.</p>
<fig id="F2" position="float">
<label>FIGURE 2</label>
<caption>
<p>Outline of the proposed method.</p>
</caption>
<graphic xlink:href="fenrg-13-1654803-g002.tif">
<alt-text content-type="machine-generated">Flowchart detailing a smart grid control system. It starts with inputting real-time grid data, followed by preprocessing, normalization, and feature extraction. The transformer module provides temporal encoding and multi-head attention. Predicted voltage and load are outputted to an ANFIS controller with a fuzzy rule base and inference engine. Control actions are optimized using EHFOA with techniques like L&#xE9;vy flight and elite memory. Smart grid actuation applies signals to manage voltage, load, and energy loss, ending with outputs of stabilized voltage, balanced load, and reduced energy loss. The process concludes with a stop point.</alt-text>
</graphic>
</fig>
<p>The proposed method introduces several significant contributions to the field of smart grid optimization, energy forecasting, and intelligent control, especially in the context of photovoltaic-based distributed systems. These contributions are both methodological and practical, filling key gaps in existing literature while offering a novel, integrated framework: The first major contribution is the design of a hybrid ANFIS-Transformer architecture that seamlessly fuses interpretable fuzzy logic with a powerful temporal encoding mechanism. Unlike traditional fuzzy systems, which are memoryless and limited in handling time-dependent dynamics, the integration of a Transformer encoder enables the model to learn long-range dependencies in input data such as load demand, solar irradiance, and voltage behavior. This allows the system to anticipate fluctuations, contextualize control actions, and operate with improved foresight, particularly in volatile renewable energy environments. Secondly, the framework introduces a novel multi-objective optimization layer through the Enhanced HawkFish Optimization Algorithm (EHFOA). EHFOA simultaneously tunes the parameters of both the ANFIS and Transformer modules, including fuzzy membership functions, rule weights, attention dimensions, and learning rates. Unlike existing optimization techniques that operate at single-model levels or use basic metaheuristics, EHFOA incorporates advanced features such as L&#xe9;vy flight-based exploration, energy-aware movement regulation, elite memory preservation, and dynamic clustering. These enhancements significantly improve global search capabilities, convergence speed, and solution quality, ensuring that the hybrid model achieves both high predictive accuracy and control stability. A third contribution is the contextual coupling of forecasting and control within a unified decision-making loop. Most prior methods either focus on accurate forecasting (e.g., CNN-BiLSTM) or robust control (e.g., DRL or GA-based MPPT), but rarely both. The proposed framework ensures that temporal patterns extracted by the Transformer are not merely predictive but directly influence fuzzy rule evaluations in the ANFIS layer. This real-time feedback integration enables adaptive voltage control, dynamic load balancing, and intelligent MPPT decisions, outperforming decoupled pipelines that rely on fixed thresholds or static rules. The fourth contribution lies in the interpretability and safety of the control actions. By using ANFIS as the decision core, the system maintains full transparency of the reasoning process, enabling energy operators to audit, modify, or verify rules based on operational constraints and regulatory policies. This is in contrast to purely black-box neural or reinforcement learning models, which, despite their accuracy, often lack practical deployability due to trust and explainability concerns. Finally, the proposed framework is validated under realistic simulation conditions in MATLAB/Simulink, incorporating PV arrays, time-varying loads, battery storage, converters, and inverter systems. This practical integration demonstrates that the method is not only theoretically sound but also applicable to physical systems and ready for deployment in smart microgrid or grid-connected PV scenarios. Through this end-to-end, AI-driven control solution, the proposed method establishes a new benchmark for intelligent, adaptive, and interpretable energy management in next-generation smart grids.</p>
<p>The rest of this paper is structured as follows: <xref ref-type="sec" rid="s2">Section 2</xref> introduces the proposed hybrid control framework, presenting the design and integration of the ANFIS-Transformer architecture optimized by the Enhanced HawkFish Optimization Algorithm (EHFOA). It details how temporal sequence modeling using the Transformer is fused with fuzzy logic-based reasoning in ANFIS, and how EHFOA tunes both components to achieve real-time voltage and load balancing in smart grid environments. <xref ref-type="sec" rid="s3">Section 3</xref> describes the simulation setup in MATLAB/Simulink, including the PV array, dynamic loads, battery storage, inverters, and converters, followed by performance results under varying operating conditions such as irradiance and load demand fluctuations. <xref ref-type="sec" rid="s4">Section 4</xref> provides a comparative analysis of the proposed method against state-of-the-art techniques, highlighting its advantages in prediction accuracy, control stability, interpretability, and optimization efficiency. Finally, <xref ref-type="sec" rid="s5">Section 5</xref> concludes the paper by summarizing the key contributions of the proposed framework and outlining potential directions for future research in hybrid AI-driven smart grid control systems.</p>
</sec>
<sec id="s2">
<label>2</label>
<title>Proposed methods</title>
<p>In modern smart grids, the dynamic nature of electricity demand, renewable generation, and voltage fluctuations presents substantial challenges for maintaining real-time stability and efficient load distribution (<xref ref-type="bibr" rid="B28">Ran et al., 2024</xref>). Traditional control systems often struggle to respond effectively to such rapidly changing and nonlinear environments, especially when the underlying system exhibits both temporal dependencies and uncertainties (<xref ref-type="bibr" rid="B3">Ahmad N. et al., 2022</xref>). While fuzzy logic-based controllers, such as the Adaptive Neuro-Fuzzy Inference System (ANFIS), have shown promise due to their ability to model imprecise knowledge and linguistic rules, they inherently lack memory and sequential processing capabilities (<xref ref-type="bibr" rid="B39">Zulfiqar et al., 2022</xref>). As a result, they are limited in scenarios that demand understanding of time-series behavior or long-term system trends&#x2014;critical characteristics of power systems driven by renewable sources and consumer variability. To address these limitations, we propose a hybrid framework that integrates ANFIS with a Transformer-based temporal encoder, forming a system capable of both learning from past behaviors and reasoning under uncertainty (<xref ref-type="bibr" rid="B17">Islam et al., 2022</xref>). The Transformer model, originally designed for natural language processing, is repurposed here to extract rich temporal features from historical load, voltage, and energy generation data. Its self-attention mechanism enables the model to selectively focus on relevant past events, capturing complex dependencies across multiple time steps (<xref ref-type="bibr" rid="B37">Zhang et al., 2023</xref>), (<xref ref-type="bibr" rid="B40">Zulfiqar et al., 2023</xref>), (<xref ref-type="bibr" rid="B14">Hossain et al., 2020</xref>). These temporal embeddings are then passed as inputs to the ANFIS model, which applies fuzzy logic reasoning to produce interpretable and adaptable control actions. This synergy between sequence modeling and fuzzy inference allows the proposed system to handle both the memory requirements of time-dependent grid control and the robustness demanded by uncertain, real-world measurements. To further enhance the adaptability and convergence efficiency of the framework, we introduce a novel metaheuristic algorithm&#x2014;Enhanced HawkFish Optimization Algorithm (EHFOA)&#x2014;to optimize the internal parameters of both the Transformer and ANFIS components. EHFOA incorporates mechanisms such as L&#xe9;vy flight exploration, energy-based adaptation, elite memory preservation, and clustering-based diversity maintenance to navigate the complex multi-dimensional search space efficiently. By tuning fuzzy membership functions, attention weights, and learning rates simultaneously, EHFOA ensures that the proposed hybrid model achieves optimal prediction accuracy, rapid convergence, and improved voltage and load balancing performance across diverse operating conditions. This section outlines the architectural design, algorithmic structure, and mathematical formulation of the ANFIS-Transformer framework and its optimization using EHFOA.</p>
<sec id="s2-1">
<label>2.1</label>
<title>Dataset</title>
<p>The Smart Grid Real-Time Load Monitoring Dataset (<xref ref-type="bibr" rid="B2">Afzal et al., 2020</xref>), provides high-resolution time-series measurements designed for energy management, load forecasting, and fault detection applications (<xref ref-type="bibr" rid="B38">Ziya07, 2024</xref>). It includes real-time active power and load data collected from smart meters or grid sensors at regular intervals, typically every few seconds or minutes. Its detailed granularity shown in <xref ref-type="table" rid="T2">Table 2</xref> makes it ideal for training the Transformer component to capture temporal dependencies and the ANFIS unit to react to dynamic load changes. Combined with EHFOA optimizer, this dataset supports end-to-end tuning to minimize forecasting error and improve grid stability in smart grid simulations or real-world deployments.</p>
<table-wrap id="T2" position="float">
<label>TABLE 2</label>
<caption>
<p>Dataset description.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="center">Feature</th>
<th align="center">Description</th>
<th align="center">Data type</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">Timestamp</td>
<td align="left">Date and time of measurement</td>
<td align="left">DateTime</td>
</tr>
<tr>
<td align="left">Load (kW)</td>
<td align="left">Real-time active power consumption</td>
<td align="left">Float</td>
</tr>
<tr>
<td align="left">Voltage (V)</td>
<td align="left">Instantaneous voltage reading</td>
<td align="left">Float</td>
</tr>
<tr>
<td align="left">Frequency (Hz)</td>
<td align="left">Line frequency during measurement</td>
<td align="left">Float</td>
</tr>
<tr>
<td align="left">Current (A)</td>
<td align="left">Current drawn by the system</td>
<td align="left">Float</td>
</tr>
<tr>
<td align="left">Reactive Power (kVAR)</td>
<td align="left">Reactive power at the node</td>
<td align="left">Float</td>
</tr>
<tr>
<td align="left">Power Factor</td>
<td align="left">Ratio of active power to apparent power</td>
<td align="left">Float</td>
</tr>
<tr>
<td align="left">Device ID/Meter</td>
<td align="left">Unique identifier for smart meter or device</td>
<td align="left">Categorical</td>
</tr>
<tr>
<td align="left">
<bold>Total Rows</bold>
</td>
<td align="left">Total number of real-time entries</td>
<td align="left">&#x223c;50,000&#x2b;</td>
</tr>
<tr>
<td align="left">
<bold>Sampling Interval</bold>
</td>
<td align="left">Frequency of measurement (e.g., every minute)</td>
<td align="left">Time Interval</td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
<sec id="s2-2">
<label>2.2</label>
<title>Enhanced HawkFish Optimization Algorithm (EHFOA)</title>
<p>The HawkFish Optimization Algorithm (HFOA) is a population-based metaheuristic algorithm inspired by the predatory behavior and social dynamics of hawkfish in their natural reef environments (<xref ref-type="bibr" rid="B5">Alkharsan and Ata, 2025</xref>). The foundational principle behind HFOA is the modeling of both exploration and exploitation phases through a simulated ecosystem of &#x201c;male&#x201d; and &#x201c;female&#x201d; hawkfish agents. At initialization, a population of candidate solutions (hawkfish) is randomly distributed across the search space. Each hawkfish represents a potential solution to an optimization problem, and its quality or &#x201c;fitness&#x201d; is evaluated based on an objective function. Two types of fitness are typically used: a traditional fitness score and an inverse fitness measure. The inverse fitness is especially useful for promoting balance in the population and allowing the algorithm to simultaneously reward proximity to local optima while maintaining exploratory pressure. The population is split based on fitness into males and females. Females are assumed to be in search of suitable territories (local and global optima) and perform more diversified, random walks within the search space, analogous to broad exploration. Males, on the other hand, compete for access to the females that produce the &#x201c;loudest&#x201d; mating signals&#x2014;these are typically the females located near promising optima. Males move based on both attraction (to the best or &#x201c;loudest&#x201d; female) and competition (against other males). A crucial part of the algorithm involves modeling this movement with a balance of stochastic randomness and fitness-guided direction, such that males dynamically adjust their positions in the search space in response to the perceived fitness landscape. Mathematically, this is expressed through update rules that include combinations of best-known positions, peer comparisons, and random exploration terms. The algorithm continues iterating by updating positions, re-evaluating fitness, and adjusting roles in the population until a stopping criterion (maximum iterations or desired fitness level) is reached. The structure of HFOA makes it especially attractive for nonlinear optimization problems due to its intrinsic diversity mechanisms (e.g., gendered roles, dual-fitness evaluation) and its capacity to escape local optima. Its reliance on both neighborhood search and broader movement strategies enables it to maintain solution diversity over many iterations, which is essential for avoiding premature convergence. However, while these mechanisms are conceptually robust, their practical performance may vary significantly depending on the complexity of the search space and the dynamic nature of the target optimization problem.</p>
<p>The original HawkFish Optimization Algorithm (HFOA) models population dynamics inspired by hawkfish, integrating dual-fitness functions (original &#x2b; inverse) to promote broad search exploration and avoid local optima. Candidate solutions <inline-formula id="inf1">
<mml:math id="m1">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi mathvariant="double-struck">R</mml:mi>
<mml:mi>d</mml:mi>
</mml:msup>
<mml:mo>,</mml:mo>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi>N</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> are initialized randomly using <xref ref-type="disp-formula" rid="e1">Equation 1</xref>:<disp-formula id="e1">
<mml:math id="m2">
<mml:mrow>
<mml:msubsup>
<mml:mi>x</mml:mi>
<mml:mi>i</mml:mi>
<mml:mi>j</mml:mi>
</mml:msubsup>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:msubsup>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mo>&#x2061;</mml:mo>
<mml:mi>min</mml:mi>
</mml:mrow>
<mml:mi>j</mml:mi>
</mml:msubsup>
<mml:mo>&#x2b;</mml:mo>
<mml:mtext>rand</mml:mtext>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow/>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#xb7;</mml:mo>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msubsup>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mo>&#x2061;</mml:mo>
<mml:mi>max</mml:mi>
</mml:mrow>
<mml:mi>j</mml:mi>
</mml:msubsup>
<mml:mo>&#x2212;</mml:mo>
<mml:msubsup>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>,</mml:mo>
<mml:mo>&#x2061;</mml:mo>
<mml:mi>min</mml:mi>
</mml:mrow>
<mml:mi>j</mml:mi>
</mml:msubsup>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>,</mml:mo>
<mml:mi>j</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:mi>d</mml:mi>
</mml:mrow>
</mml:math>
<label>(1)</label>
</disp-formula>where <inline-formula id="inf2">
<mml:math id="m3">
<mml:mrow>
<mml:mtext>rand</mml:mtext>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow/>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#x223c;</mml:mo>
<mml:mi>U</mml:mi>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>. Fitness values <inline-formula id="inf3">
<mml:math id="m4">
<mml:mrow>
<mml:mi>f</mml:mi>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf4">
<mml:math id="m5">
<mml:mrow>
<mml:msub>
<mml:mi>f</mml:mi>
<mml:mrow>
<mml:mtext>inv</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:mfrac>
<mml:mn>1</mml:mn>
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>f</mml:mi>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:mfrac>
</mml:mrow>
</mml:math>
</inline-formula> are evaluated, then the population is split into &#x201c;males&#x201d; and &#x201c;females&#x201d; based on relative fitness. The dual-fitness mechanism allows simultaneous maximization and minimization, encouraging balance between local refinement and global search. Update rules involve distance-driven movements towards best or near peers (<xref ref-type="disp-formula" rid="e2">Equation 2</xref>):<disp-formula id="e2">
<mml:math id="m6">
<mml:mrow>
<mml:msubsup>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
<mml:mrow>
<mml:mtext>new</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mi>r</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mtext>GB</mml:mtext>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mi>r</mml:mi>
<mml:mn>2</mml:mn>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mrow>
<mml:mtext>Near</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
<label>(2)</label>
</disp-formula>where <inline-formula id="inf5">
<mml:math id="m7">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mtext>GB</mml:mtext>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> is the global best solution, <inline-formula id="inf6">
<mml:math id="m8">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mrow>
<mml:mtext>Near</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> is the nearest high-fitness neighbor, and <inline-formula id="inf7">
<mml:math id="m9">
<mml:mrow>
<mml:msub>
<mml:mi>r</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>r</mml:mi>
<mml:mn>2</mml:mn>
</mml:msub>
<mml:mo>&#x223c;</mml:mo>
<mml:mi>U</mml:mi>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula>. Despite its innovative structure, the original HFOA is not inherently designed to handle high-dimensional, time-dependent, and hybrid parameter optimization challenges such as those found in our proposed ANFIS-Transformer framework for smart grid control. The primary weakness of HFOA in this context lies in its limited adaptation to dynamic, temporal learning environments. The Transformer component introduces a sequence-dependent learning task that requires fine-tuning of attention weights and positional encodings&#x2014;parameters that evolve based on temporal patterns. HFOA&#x2019;s exploration strategy, based on random walk and attraction models, lacks a memory mechanism or structured learning component that tracks temporal dynamics or sequential dependencies. Furthermore, ANFIS membership functions require precise and stable convergence, especially when modeling fuzzy logic under real-time smart grid constraints (<xref ref-type="bibr" rid="B16">Iqbal et al., 2022</xref>). HFOA in its raw form may fail to achieve such granularity due to noisy updates, overly random male-female movements, and lack of elitism or adaptive energy control, which can lead to instability or inefficiency in optimization. These limitations are compounded when the search space becomes multi-objective, as is the case in voltage stability and load balancing tasks that must be simultaneously optimized. In summary, while HFOA offers a strong base, it lacks the mechanisms needed to achieve convergence efficiency and temporal adaptability in the hybrid learning context required by our smart grid methodology.</p>
<p>To overcome the limitations described above and make the HFOA suitable for our complex hybrid learning system, we propose the Enhanced HawkFish Optimization Algorithm (EHFOA). This version introduces a suite of strategic enhancements that transform HFOA into a metaheuristic capable of optimizing both static fuzzy systems (ANFIS) and dynamic sequence-based models (Transformers) (<xref ref-type="bibr" rid="B32">Urrea-Aguirre et al., 2024</xref>) under real-time smart grid constraints. The first major enhancement is the integration of L&#xe9;vy flight-based exploration, which replaces standard random walks with probabilistically-driven long jumps in the search space. This allows agents to escape local minima more effectively and provides a better balance between local and global search&#x2014;especially valuable when the fitness landscape is rugged, as in ANFIS rule tuning or attention weight optimization. Secondly, we introduce a memory-based elitism mechanism, where a global pool of top-performing solutions is maintained across iterations. Hawkfish agents periodically compare their positions not just to neighbors but also to the elite pool, increasing convergence stability and ensuring retention of historically good configurations. This is particularly useful in Transformer training, where high-performing hyperparameter sets must be preserved. Third, energy-constrained movement control is added by modeling a decay function for each agent&#x2019;s energy across iterations. This controls the aggressiveness of exploration: agents with high energy favor global search with large updates (via L&#xe9;vy flights), while those with low energy prioritize fine-tuned exploitation based on nearby elite agents and Transformer loss feedback. Finally, we embed a dynamic clustering mechanism into EHFOA using k-means clustering of the population based on feature proximity and fitness similarity. Each cluster then evolves semi-independently, with its own best candidate guiding local movement. This prevents premature convergence and preserves population diversity, which is critical in the ANFIS layer to avoid collapsing fuzzy rule representations. By integrating these components&#x2014;L&#xe9;vy dynamics, elite memory, energy modeling, and diversity maintenance&#x2014;EHFOA becomes a powerful optimizer that handles both discrete (fuzzy logic rule parameters) and continuous (Transformer attention weights) variables across time-dependent and nonlinear control surfaces.</p>
<p>To improve EHFOA performance for tuning ANFIS-Transformer systems, we introduce four major augmentations:</p>
<sec id="s2-2-1">
<label>2.2.1</label>
<title>L&#xe9;vy-flight boosts global exploration</title>
<p>We integrate L&#xe9;vy flights into position updates to enhance probability of large jumps in early iterations, preventing premature convergence (<xref ref-type="disp-formula" rid="e3">Equation 3</xref>):<disp-formula id="e3">
<mml:math id="m10">
<mml:mrow>
<mml:mtable columnalign="center">
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:mo>&#x394;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mover accent="true">
<mml:mtext>Le</mml:mtext>
<mml:mo>&#x301;</mml:mo>
</mml:mover>
<mml:mtext>vy</mml:mtext>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>&#x3b2;</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>,</mml:mo>
<mml:mi>&#x3b2;</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1.5</mml:mn>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mrow>
<mml:msubsup>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
<mml:mrow>
<mml:mtext>new</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>&#x3b1;</mml:mi>
<mml:mo>&#xb7;</mml:mo>
<mml:mo>&#x394;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
<mml:mo>&#xb7;</mml:mo>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mtext>GB</mml:mtext>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:math>
<label>(3)</label>
</disp-formula>Here, <inline-formula id="inf8">
<mml:math id="m11">
<mml:mrow>
<mml:mi>&#x3b1;</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> is a scaling factor gradually decreasing over time to shift focus from exploration to exploitation.</p>
</sec>
<sec id="s2-2-2">
<label>2.2.2</label>
<title>Elite memory pool (elitism)</title>
<p>EHFOA maintains a memory pool <inline-formula id="inf9">
<mml:math id="m12">
<mml:mrow>
<mml:mi mathvariant="script">E</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msubsup>
<mml:mrow>
<mml:mfenced open="{" close="}" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>e</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mrow>
<mml:mi>e</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mi>M</mml:mi>
</mml:msubsup>
</mml:mrow>
</mml:math>
</inline-formula> of the best <inline-formula id="inf10">
<mml:math id="m13">
<mml:mrow>
<mml:mi>M</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> solutions found so far. Periodically, each hawkfish may be relocated towards a random elite member, enhancing convergence reliability (<xref ref-type="disp-formula" rid="e4">Equation 4</xref>):<disp-formula id="e4">
<mml:math id="m14">
<mml:mrow>
<mml:msubsup>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
<mml:mrow>
<mml:mtext>new</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>&#x3f5;</mml:mi>
<mml:mo>&#xb7;</mml:mo>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>e</mml:mi>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>e</mml:mi>
</mml:msub>
<mml:mo>&#x223c;</mml:mo>
<mml:mi mathvariant="script">E</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>&#x3f5;</mml:mi>
<mml:mo>&#x223c;</mml:mo>
<mml:mi>U</mml:mi>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
<label>(4)</label>
</disp-formula>
</p>
</sec>
<sec id="s2-2-3">
<label>2.2.3</label>
<title>Energy-based movement control</title>
<p>Inspired by predator-prey energy dynamics, each hawkfish has an energy level <inline-formula id="inf11">
<mml:math id="m15">
<mml:mrow>
<mml:msub>
<mml:mi>E</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#x2208;</mml:mo>
<mml:mrow>
<mml:mfenced open="[" close="]" separators="&#x7c;">
<mml:mrow>
<mml:mn>0</mml:mn>
<mml:mo>,</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> updated by (<xref ref-type="disp-formula" rid="e5">Equation 5</xref>):<disp-formula id="e5">
<mml:math id="m16">
<mml:mrow>
<mml:msub>
<mml:mi>E</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi>E</mml:mi>
<mml:mn>0</mml:mn>
</mml:msub>
<mml:mo>&#xb7;</mml:mo>
<mml:mo>&#x2061;</mml:mo>
<mml:mi>exp</mml:mi>
<mml:mo>&#x2061;</mml:mo>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>&#x3bb;</mml:mi>
<mml:mfrac>
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:msub>
<mml:mi>T</mml:mi>
<mml:mi>max</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfrac>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
<label>(5)</label>
</disp-formula>Movement strategies switch based on <inline-formula id="inf12">
<mml:math id="m17">
<mml:mrow>
<mml:msub>
<mml:mi>E</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> :<list list-type="bullet">
<list-item>
<p>When <inline-formula id="inf13">
<mml:math id="m18">
<mml:mrow>
<mml:msub>
<mml:mi>E</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#x3e;</mml:mo>
<mml:msub>
<mml:mi>E</mml:mi>
<mml:mrow>
<mml:mtext>th</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> (early stage), global search dominates as shown in <xref ref-type="disp-formula" rid="e6">Equation 6</xref>:</p>
</list-item>
</list>
<disp-formula id="e6">
<mml:math id="m19">
<mml:mrow>
<mml:msubsup>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
<mml:mrow>
<mml:mtext>new</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mi>&#x3b1;</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
<mml:mtext> </mml:mtext>
<mml:mi mathvariant="normal">L</mml:mi>
<mml:mo>&#xe9;</mml:mo>
<mml:mtext>vy</mml:mtext>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mi>&#x3b1;</mml:mi>
<mml:mn>2</mml:mn>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mtext>GB</mml:mtext>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
<label>(6)</label>
</disp-formula>
<list list-type="bullet">
<list-item>
<p>When <inline-formula id="inf14">
<mml:math id="m20">
<mml:mrow>
<mml:msub>
<mml:mi>E</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#x2264;</mml:mo>
<mml:msub>
<mml:mi>E</mml:mi>
<mml:mrow>
<mml:mtext>th</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>, local exploitation is emphasized (<xref ref-type="disp-formula" rid="e7">Equation 7</xref>):</p>
</list-item>
</list>
<disp-formula id="e7">
<mml:math id="m21">
<mml:mrow>
<mml:msubsup>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
<mml:mrow>
<mml:mtext>new</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mi>&#x3b2;</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mrow>
<mml:mtext>Near</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mi>&#x3b2;</mml:mi>
<mml:mn>2</mml:mn>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>e</mml:mi>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
<label>(7)</label>
</disp-formula>
</p>
</sec>
<sec id="s2-2-4">
<label>2.2.4</label>
<title>Dynamic clustering of population</title>
<p>Population is partitioned into <inline-formula id="inf15">
<mml:math id="m22">
<mml:mrow>
<mml:mi>K</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> clusters each iteration using k-means based on similarity in fitness and position. Clusters facilitate localized learning; each cluster maintains its own best <inline-formula id="inf16">
<mml:math id="m23">
<mml:mrow>
<mml:msubsup>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mtext>KB</mml:mtext>
<mml:mi>k</mml:mi>
</mml:msubsup>
</mml:mrow>
</mml:math>
</inline-formula>, updated via as shown in <xref ref-type="disp-formula" rid="e8">Equation 8</xref>:<disp-formula id="e8">
<mml:math id="m24">
<mml:mrow>
<mml:msubsup>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
<mml:mrow>
<mml:mtext>new</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>&#x3b3;</mml:mi>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msubsup>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mtext>KB</mml:mtext>
<mml:mi>k</mml:mi>
</mml:msubsup>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">X</mml:mi>
<mml:mi>l</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
<label>(8)</label>
</disp-formula>Maintaining cluster-specific bests enhances diversity and delays convergence to suboptimal peaks. <xref ref-type="statement" rid="Algorithm_1">Algorithm 1</xref> outlines the core procedural steps of the Enhanced HawkFish Optimization Algorithm (EHFOA), a bio-inspired metaheuristic tailored for hybrid system optimization in smart grids. The algorithm begins by initializing a population of candidate solutions&#x2014;modeled as hawkfish agents&#x2014;within defined search boundaries. Each agent is evaluated using both a traditional fitness function and an inverse metric to maintain balance between exploration and exploitation. Agents are categorized into males and females based on fitness, enabling diverse behavioral strategies.</p>
<p>
<statement content-type="algorithm" id="Algorithm_1">
<label>Algorithm 1</label>
<p>Enhanced Hawkfish Optimization Algorithm (EHFOA).<list list-type="simple">
<list-item>
<p>1.&#x2003;Initialize population X &#x3d; {x<sub>1</sub>, x<sub>2</sub>, &#x2026;, x_N} &#x2003;&#x2003;&#x2003;&#x2003;&#x2003;randomly within [LB, UB]</p>
</list-item>
<list-item>
<p>2.&#x2003;Evaluate dual fitness for each individual:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;f (x<sub>i</sub>) and f_inv (x<sub>i</sub>) &#x3d; 1/(1 &#x2b; f (x<sub>i</sub>))</p>
</list-item>
<list-item>
<p>3.&#x2003;Assign roles: split into male and female groups &#x2003;&#x2003;&#x2003;&#x2003;&#x2003;based on fitness ranking</p>
</list-item>
<list-item>
<p>4.&#x2003;Initialize energy level E<sub>0</sub> for all agents</p>
</list-item>
<list-item>
<p>5.&#x2003;Initialize elite memory pool E with top M &#x2003;&#x2003;&#x2003;&#x2003;&#x2003;individuals</p>
</list-item>
<list-item>
<p>6.&#x2003;For t &#x3d; 1 to T_max do</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;a. Update energy of each hawkfish:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;E<sub>i</sub>(t) &#x3d; E<sub>0</sub> &#x2a; exp (&#x2212;&#x3bb; &#x2a;t/T_max)</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;b. Perform K-means clustering on population &#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;based on fitness and position</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2192; obtain cluster centers and local bests &#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;X_cluster_best</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;c. For each hawkfish x<sub>i</sub> in population do</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;i. If E<sub>i</sub>(t) &#x3e; threshold:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;- Perform global exploration using &#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;L&#xe9;vy flight:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x394;x &#x3d; L&#xe9;vy (d, &#x3b2;)</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;x<sub>i</sub> &#x3d; x<sub>i</sub> &#x2b; &#x3b1;<sub>1</sub> &#x2a; &#x394;x &#x2b; &#x3b1;<sub>2</sub> &#x2a; (X_best - x<sub>i</sub>)</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;ii. Else:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;- Perform local exploitation:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;x<sub>i</sub> &#x3d; x<sub>i</sub> &#x2b; &#x3b2;<sub>1</sub> &#x2a; (X_near - x<sub>i</sub>)</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2b; &#x3b2;<sub>2</sub> &#x2a; (X_elite - x<sub>i</sub>)</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2b; &#x3b3; &#x2a; (X_cluster_best - x<sub>i</sub>)</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;iii. Apply boundary check: x<sub>i</sub> &#x2208; [LB, UB]</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;d. Evaluate new fitness: f (x<sub>i</sub>), f_inv (x<sub>i</sub>)</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;e. Update elite memory pool E with best M &#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;individuals</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;f. Update global best X_best from current &#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;population</p>
</list-item>
<list-item>
<p>7.&#x2003;Return X_best</p>
</list-item>
</list>
</p>
</statement>
</p>
<p>Agents are categorized into males and females based on fitness, enabling diverse behavioral strategies. A decaying energy model governs each agent&#x2019;s movement: individuals with high energy engage in L&#xe9;vy flight-based global exploration (<xref ref-type="bibr" rid="B11">Gadupudi et al., 2023</xref>) to avoid local optima, while those with lower energy shift focus to local refinement, guided by elite memory solutions and intra-cluster bests. Population diversity is preserved through dynamic k-means clustering, which partitions agents into localized groups and fosters competition at both global and cluster levels. Throughout each iteration, the elite memory pool is updated to retain top-performing solutions, and boundary checks ensure feasible search. The process iterates until convergence or maximum iteration count is reached, yielding a globally optimal solution. EHFOA&#x2019;s integration of L&#xe9;vy dynamics, memory elitism, energy-aware adaptation, and clustering mechanisms equips it to effectively optimize complex, hybrid control models like the ANFIS-Transformer framework proposed in this work.</p>
</sec>
</sec>
<sec id="s2-3">
<label>2.3</label>
<title>ANFIS-transformer framework</title>
<p>Fuzzy logic is a form of many-valued logic that deals with reasoning under uncertainty and partial truths, mimicking how humans make decisions based on imprecise or qualitative information. Unlike classical binary logic, where a variable must be either 0 or 1, fuzzy logic allows intermediate values between 0 and 1, representing degrees of membership in fuzzy sets (<xref ref-type="bibr" rid="B1">Abdollahi Chirani and Karami, 2024</xref>). In fuzzy systems, rules are typically constructed in the form of linguistic IF-THEN statements, such as &#x201c;IF load is high AND voltage is low THEN reduce power.&#x201d; These rules operate on fuzzy sets defined by membership functions, which map crisp input values to degrees of truth (<xref ref-type="bibr" rid="B35">Wang et al., 2023</xref>). The process involves fuzzification (converting crisp input into fuzzy values), rule evaluation, aggregation, and defuzzification (converting fuzzy output into a crisp action) as shown in <xref ref-type="disp-formula" rid="e9">Equation 9</xref>.<disp-formula id="e9">
<mml:math id="m25">
<mml:mrow>
<mml:msub>
<mml:mi>&#x3bc;</mml:mi>
<mml:mi>A</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:mrow>
<mml:mfenced open="{" close="" separators="&#x7c;">
<mml:mrow>
<mml:mtable columnalign="left">
<mml:mtr>
<mml:mtd>
<mml:mn>0</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo>&#x2264;</mml:mo>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mfrac>
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>a</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>b</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>a</mml:mi>
</mml:mrow>
</mml:mfrac>
</mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:mi>x</mml:mi>
<mml:mo>&#x3c;</mml:mo>
<mml:mi>b</mml:mi>
</mml:mrow>
</mml:mtd>
</mml:mtr>
<mml:mtr>
<mml:mtd>
<mml:mn>1</mml:mn>
</mml:mtd>
<mml:mtd>
<mml:mrow>
<mml:mi>x</mml:mi>
<mml:mo>&#x2265;</mml:mo>
<mml:mi>b</mml:mi>
</mml:mrow>
</mml:mtd>
</mml:mtr>
</mml:mtable>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
<label>(9)</label>
</disp-formula>Where <inline-formula id="inf17">
<mml:math id="m26">
<mml:mrow>
<mml:msub>
<mml:mi>&#x3bc;</mml:mi>
<mml:mi>A</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
</inline-formula> is the membership function of input <inline-formula id="inf18">
<mml:math id="m27">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> in fuzzy set <inline-formula id="inf19">
<mml:math id="m28">
<mml:mrow>
<mml:mi>A</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>, and <inline-formula id="inf20">
<mml:math id="m29">
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>b</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> define the boundaries of the fuzzy region.</p>
<p>The Adaptive Neuro-Fuzzy Inference System (ANFIS) is a hybrid intelligent system that merges the learning capability of neural networks with the uncertainty handling and rule-based reasoning of fuzzy logic (<xref ref-type="bibr" rid="B21">Lin et al., 2024</xref>). ANFIS implements a Sugeno-type fuzzy inference system where the parameters of the membership functions and output functions are adjusted using a data-driven training process. Structurally, ANFIS is composed of five layers, each of which corresponds to a distinct operation in the fuzzy inference pipeline: fuzzification, rule strength computation, normalization, defuzzification, and output aggregation (<xref ref-type="bibr" rid="B7">Badran and Toha, 2024</xref>).</p>
<p>Let us consider a simple ANFIS with two inputs <inline-formula id="inf21">
<mml:math id="m30">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf22">
<mml:math id="m31">
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>, and two fuzzy rules:<list list-type="bullet">
<list-item>
<p>Rule 1: IF <inline-formula id="inf23">
<mml:math id="m32">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> is <inline-formula id="inf24">
<mml:math id="m33">
<mml:mrow>
<mml:msub>
<mml:mi>A</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> AND <inline-formula id="inf25">
<mml:math id="m34">
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> is <inline-formula id="inf26">
<mml:math id="m35">
<mml:mrow>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> THEN <inline-formula id="inf27">
<mml:math id="m36">
<mml:mrow>
<mml:msub>
<mml:mi>f</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
<mml:mi>x</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mi>q</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
<mml:mi>y</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mi>r</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</p>
</list-item>
<list-item>
<p>Rule 2: IF <inline-formula id="inf28">
<mml:math id="m37">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> is <inline-formula id="inf29">
<mml:math id="m38">
<mml:mrow>
<mml:msub>
<mml:mi>A</mml:mi>
<mml:mn>2</mml:mn>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> AND <inline-formula id="inf30">
<mml:math id="m39">
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> is <inline-formula id="inf31">
<mml:math id="m40">
<mml:mrow>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mn>2</mml:mn>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> THEN <inline-formula id="inf32">
<mml:math id="m41">
<mml:mrow>
<mml:msub>
<mml:mi>f</mml:mi>
<mml:mn>2</mml:mn>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mn>2</mml:mn>
</mml:msub>
<mml:mi>x</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mi>q</mml:mi>
<mml:mn>2</mml:mn>
</mml:msub>
<mml:mi>y</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mi>r</mml:mi>
<mml:mn>2</mml:mn>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</p>
</list-item>
</list>
</p>
<p>Layer 1: Fuzzification (see in <xref ref-type="disp-formula" rid="e10">Equation 10</xref>).<disp-formula id="e10">
<mml:math id="m42">
<mml:mrow>
<mml:msubsup>
<mml:mi>O</mml:mi>
<mml:mn>1</mml:mn>
<mml:mi>i</mml:mi>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi>&#x3bc;</mml:mi>
<mml:msub>
<mml:mi>A</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>,</mml:mo>
<mml:msubsup>
<mml:mi>O</mml:mi>
<mml:mn>1</mml:mn>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi>&#x3bc;</mml:mi>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
<label>(10)</label>
</disp-formula>This layer calculates the degree of membership for each input.</p>
<p>Layer 2: Rule Strength (Firing Strength) as shown in <xref ref-type="disp-formula" rid="e11">Equation 11</xref>
<disp-formula id="e11">
<mml:math id="m43">
<mml:mrow>
<mml:msubsup>
<mml:mi>O</mml:mi>
<mml:mn>2</mml:mn>
<mml:mi>i</mml:mi>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi>w</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi>&#x3bc;</mml:mi>
<mml:msub>
<mml:mi>A</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mi>x</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#xb7;</mml:mo>
<mml:msub>
<mml:mi>&#x3bc;</mml:mi>
<mml:msub>
<mml:mi>B</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mi>y</mml:mi>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
<label>(11)</label>
</disp-formula>
</p>
<p>Layer 3: Normalization (see <xref ref-type="disp-formula" rid="e12">Equation 12</xref>)<disp-formula id="e12">
<mml:math id="m44">
<mml:mrow>
<mml:msubsup>
<mml:mi>O</mml:mi>
<mml:mn>3</mml:mn>
<mml:mi>i</mml:mi>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mover accent="true">
<mml:mi>w</mml:mi>
<mml:mo>&#xaf;</mml:mo>
</mml:mover>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mfrac>
<mml:msub>
<mml:mi>w</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mrow>
<mml:msub>
<mml:mi>w</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mi>w</mml:mi>
<mml:mn>2</mml:mn>
</mml:msub>
</mml:mrow>
</mml:mfrac>
</mml:mrow>
</mml:math>
<label>(12)</label>
</disp-formula>
</p>
<p>Layer 4: Consequent Function (see <xref ref-type="disp-formula" rid="e13">Equation 13</xref>)<disp-formula id="e13">
<mml:math id="m45">
<mml:mrow>
<mml:msubsup>
<mml:mi>O</mml:mi>
<mml:mn>4</mml:mn>
<mml:mi>i</mml:mi>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mover accent="true">
<mml:mi>w</mml:mi>
<mml:mo>&#xaf;</mml:mo>
</mml:mover>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:msub>
<mml:mi>f</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mover accent="true">
<mml:mi>w</mml:mi>
<mml:mo>&#xaf;</mml:mo>
</mml:mover>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mi>x</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mi>q</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mi>y</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mi>r</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
<label>(13)</label>
</disp-formula>
</p>
<p>Layer 5: Output Aggregation (see <xref ref-type="disp-formula" rid="e14">Equation 14</xref>)<disp-formula id="e14">
<mml:math id="m46">
<mml:mrow>
<mml:msubsup>
<mml:mi>O</mml:mi>
<mml:mn>5</mml:mn>
<mml:mn>1</mml:mn>
</mml:msubsup>
<mml:mo>&#x3d;</mml:mo>
<mml:mstyle displaystyle="true">
<mml:msub>
<mml:mo>&#x2211;</mml:mo>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mstyle>
<mml:mtext>&#x200a;</mml:mtext>
<mml:msub>
<mml:mover accent="true">
<mml:mi>w</mml:mi>
<mml:mo>&#xaf;</mml:mo>
</mml:mover>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:msub>
<mml:mi>f</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
<label>(14)</label>
</disp-formula>During training, ANFIS uses hybrid learning: gradient descent is applied to update the nonlinear parameters of the membership functions, while least squares estimation is used to optimize the linear parameters in the consequent part (<xref ref-type="bibr" rid="B18">Khan et al., 2024</xref>). The result is a system that combines human-like reasoning with data-driven adaptivity, making ANFIS powerful for control and prediction tasks in nonlinear environments. Despite its effectiveness in handling uncertainty and nonlinearity, ANFIS lacks the ability to explicitly model temporal dependencies and sequence correlations over time (<xref ref-type="bibr" rid="B13">Hasan et al., 2023</xref>). This becomes a significant limitation in smart grid environments where voltage and load patterns are not static but evolve dynamically, often exhibiting strong dependencies on previous states. ANFIS, being a memory-less system, treats each input instance independently and cannot capture time-series patterns such as peak load progression or recurring voltage dips (<xref ref-type="bibr" rid="B29">Saglam et al., 2024</xref>). This limitation restricts ANFIS from making context-aware predictions or decisions, especially when control strategies depend on recent trends. To address this, it is essential to integrate a sequential learning mechanism&#x2014;such as a Transformer&#x2014;that can model long-range dependencies and temporal dynamics effectively (<xref ref-type="bibr" rid="B26">Per&#xe7;uku et al., 2025</xref>).</p>
<p>The ANFIS-based control strategy integrates fuzzy inference rules to establish a mapping between key input variables&#x2014;such as frequency deviation and load type&#x2014;and the resulting control actions. These fuzzy rules capture expert knowledge in a linguistic format (e.g., &#x201c;If frequency deviation is high and load is inductive, then increase compensation&#x201d;) and enable the system to make smooth, nonlinear decisions in real-time. ANFIS enhances this capability by automatically tuning the membership functions and rule weights through training with input-output data. This dynamic mapping allows the controller to adapt to varying grid conditions and respond rapidly to frequency disturbances. With this incorporation, ANFIS-EHFOA achieves better stability, robustness, and precision in maintaining grid frequency, especially under fluctuating load and renewable generation scenarios. <xref ref-type="table" rid="T3">Table 3</xref> presents a representative set of fuzzy inference rules employed within the ANFIS-EHFOA (Adaptive Neuro-Fuzzy Inference System&#x2013;Droop Controller) framework to guide compensatory actions based on the real-time state of the power grid. Each rule is defined by two inputs&#x2014;frequency deviation and load type&#x2014;and maps them to an appropriate control action.</p>
<table-wrap id="T3" position="float">
<label>TABLE 3</label>
<caption>
<p>Sample fuzzy inference rules used in the proposed control strategy.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="left">Rule no.</th>
<th align="left">Frequency deviation</th>
<th align="left">Load type</th>
<th align="left">Control action</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">1</td>
<td align="left">High</td>
<td align="left">Resistive</td>
<td align="left">Increase compensating frequency</td>
</tr>
<tr>
<td align="left">2</td>
<td align="left">Medium</td>
<td align="left">Inductive</td>
<td align="left">Slightly increase compensation</td>
</tr>
<tr>
<td align="left">3</td>
<td align="left">Low</td>
<td align="left">Capacitive</td>
<td align="left">Maintain current compensation level</td>
</tr>
<tr>
<td align="left">4</td>
<td align="left">High</td>
<td align="left">Mixed</td>
<td align="left">Strong compensating signal</td>
</tr>
<tr>
<td align="left">5</td>
<td align="left">Low</td>
<td align="left">Resistive</td>
<td align="left">Decrease compensation</td>
</tr>
<tr>
<td align="left">6</td>
<td align="left">Medium</td>
<td align="left">Capacitive</td>
<td align="left">Slight increase</td>
</tr>
<tr>
<td align="left">7</td>
<td align="left">High</td>
<td align="left">Inductive</td>
<td align="left">Increase and maintain</td>
</tr>
<tr>
<td align="left">8</td>
<td align="left">Low</td>
<td align="left">Mixed</td>
<td align="left">Small compensating correction</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>The proposed ANFIS-Transformer Framework is a hybrid architecture designed to leverage the complementary strengths of ANFIS and the Transformer model for dynamic voltage and load balancing in smart grids. In this framework, the Transformer acts as a temporal feature encoder, capable of modeling long-term dependencies in time-series input data such as voltage readings, power consumption, and renewable energy generation. It converts a sequence of past measurements into an informative, contextaware embedding that reflects temporal trends and seasonal variations. This embedding is then passed as an input feature to the ANFIS model, which performs fuzzy inference to generate control actions.</p>
<p>Let the input time series be as shown in <xref ref-type="disp-formula" rid="e15">Equation 15</xref>:<disp-formula id="e15">
<mml:math id="m76">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="script">X</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mrow>
<mml:mfenced open="{" close="}" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mi>t</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>T</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mrow>
<mml:mi>t</mml:mi>
<mml:mo>&#x2212;</mml:mo>
<mml:mi>T</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mn>2</mml:mn>
</mml:mrow>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:mo>&#x2026;</mml:mo>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>x</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi mathvariant="double-struck">R</mml:mi>
<mml:mi>d</mml:mi>
</mml:msup>
</mml:mrow>
</mml:math>
<label>(15)</label>
</disp-formula>The Transformer encoder maps this sequence to a temporal embedding as shown in <xref ref-type="disp-formula" rid="e16">Equation 16</xref>:<disp-formula id="e16">
<mml:math id="m77">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">Z</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mtext>TransformerEncoder </mml:mtext>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="script">X</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#x2208;</mml:mo>
<mml:msup>
<mml:mi mathvariant="double-struck">R</mml:mi>
<mml:mi>k</mml:mi>
</mml:msup>
</mml:mrow>
</mml:math>
<label>(16)</label>
</disp-formula>This context vector <inline-formula id="inf62">
<mml:math id="m78">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">Z</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> captures the temporal profile of system dynamics up to time <inline-formula id="inf63">
<mml:math id="m79">
<mml:mrow>
<mml:mi>t</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>.</p>
<p>Then, <inline-formula id="inf64">
<mml:math id="m80">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">Z</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> is fed into the ANFIS network along with any real-time control variables (e.g., load demand, capacitor status), forming the input as shown in <xref ref-type="disp-formula" rid="e17">Equation 17</xref>:<disp-formula id="e17">
<mml:math id="m81">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">u</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mrow>
<mml:mfenced open="[" close="]" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">Z</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msubsup>
<mml:mi>x</mml:mi>
<mml:mi>t</mml:mi>
<mml:mrow>
<mml:mtext>load</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msubsup>
<mml:mo>,</mml:mo>
<mml:msubsup>
<mml:mi>x</mml:mi>
<mml:mi>t</mml:mi>
<mml:mrow>
<mml:mtext>voltage</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msubsup>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math>
<label>(17)</label>
</disp-formula>The ANFIS then evaluates fuzzy rules using <inline-formula id="inf65">
<mml:math id="m82">
<mml:mrow>
<mml:msub>
<mml:mi mathvariant="bold">u</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> and computes a control action as shown in <xref ref-type="disp-formula" rid="e18">Equation 18</xref>:<disp-formula id="e18">
<mml:math id="m83">
<mml:mrow>
<mml:msub>
<mml:mi>y</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:mrow>
<mml:mstyle displaystyle="true">
<mml:msub>
<mml:mo>&#x2211;</mml:mo>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mstyle>
<mml:mrow>
<mml:mtext>&#x200a;</mml:mtext>
<mml:msub>
<mml:mover accent="true">
<mml:mi>w</mml:mi>
<mml:mo>&#xaf;</mml:mo>
</mml:mover>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>&#xb7;</mml:mo>
<mml:msub>
<mml:mi mathvariant="bold">u</mml:mi>
<mml:mi>t</mml:mi>
</mml:msub>
<mml:mo>&#x2b;</mml:mo>
<mml:msub>
<mml:mi>r</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:mrow>
</mml:mrow>
</mml:math>
<label>(18)</label>
</disp-formula>where <inline-formula id="inf66">
<mml:math id="m84">
<mml:mrow>
<mml:msub>
<mml:mover accent="true">
<mml:mi>w</mml:mi>
<mml:mo>&#xaf;</mml:mo>
</mml:mover>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> are normalized rule weights, and <inline-formula id="inf67">
<mml:math id="m85">
<mml:mrow>
<mml:msub>
<mml:mi>p</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>,</mml:mo>
<mml:msub>
<mml:mi>r</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> are the parameters of the linear output layer in each rule.</p>
<p>This fusion of a Transformer&#x2019;s dynamic memory with ANFIS&#x2019;s rule-based reasoning enables the system to respond to complex, time-evolving patterns in the grid while still retaining interpretability and fuzzy control granularity. When optimized using EHFOA, the combined model can fine-tune both the temporal encoding parameters and the fuzzy membership functions to minimize voltage deviation, load imbalance, and energy waste across the grid. <xref ref-type="statement" rid="Algorithm_2">Algorithm 2</xref> defines the workflow of the ANFIS-Transformer Framework, a hybrid intelligent control system that synergistically integrates temporal deep learning with fuzzy inference for smart grid applications. The algorithm begins by segmenting incoming time-series data into overlapping windows of predefined length. Each window captures the short-term temporal behavior of the system&#x2014;such as fluctuations in load, voltage, or renewable energy inputs&#x2014;and is passed through a Transformer encoder, which models the sequence dynamics and returns a dense vector <italic>Zt</italic> &#x200b; representing the contextual embedding of system state up to the current moment.</p>
<p>
<statement content-type="algorithm" id="Algorithm_2">
<label>Algorithm 2</label>
<p>ANFIS-Transformer.<list list-type="simple">
<list-item>
<p>Input:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;- Time-series input data: X &#x3d; {x<sub>1</sub>, x<sub>2</sub>, &#x2026; x_T}, x_t &#x2003;&#x2003;&#x2003;&#x2003;&#x2208; &#x211d;<sup>d</sup>
</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;- Real-time control variables: v_t (e.g., &#x2003;&#x2003;&#x2003;&#x2003;voltage, load, power)</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;- Predefined fuzzy rules and membership function &#x2003;&#x2003;&#x2003;&#x2003;parameters</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;- Trained Transformer encoder parameters</p>
</list-item>
<list-item>
<p>Output:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;- Control action y_t (e.g., reactive power &#x2003;&#x2003;&#x2003;&#x2003;adjustment, load shifting)</p>
</list-item>
<list-item>
<p>1.&#x2003;Define sequence length T_window for &#x2003;&#x2003;&#x2003;&#x2003;&#x2003;temporal encoding</p>
</list-item>
<list-item>
<p>2.&#x2003;For each time step t &#x3d; T_window to T do:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;a. Extract input sequence window:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;S_t &#x3d; {x_{t&#x2212;T_window&#x2b;1}, &#x2026;, x_t}</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;b. Encode temporal pattern using Transformer:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;Z_t &#x3d; TransformerEncoder (S_t)</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;c. Concatenate Transformer embedding with &#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;real-time variables:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;u_t &#x3d; [Z_t, v_t]</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;d. For each fuzzy rule i:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;i. Compute membership grades &#x3bc;_{A_i}(u_t)</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;ii. Compute rule strength w_i &#x3d; &#x220f; &#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x3bc;_{A_i}(u_t)</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;e. Normalize rule strengths:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;w&#xaf;_i &#x3d; w_i/&#x2211; w_j</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;f. Compute output of each rule:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;f_i &#x3d; p_i &#x22c5; u_t &#x2b; r_i</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;g. Compute final ANFIS output:</p>
</list-item>
<list-item>
<p>&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;&#x2003;y_t &#x3d; &#x2211; w&#xaf;_i &#x22c5; f_i</p>
</list-item>
<list-item>
<p>3.&#x2003;Return control action y_t</p>
</list-item>
</list>
</p>
</statement>
</p>
<p>This embedding is then fused with real-time grid variables (such as instantaneous voltage or load values) to construct the input vector <italic>ut</italic> for the ANFIS module. The fuzzy inference system then evaluates preconfigured linguistic rules, using membership functions to quantify how well the current input aligns with each rule&#x2019;s conditions. Firing strengths of the rules are normalized, and each rule contributes a partial output based on a linear function of the input. The final control decision&#x2014;whether to adjust power factor, shift load, or engage a compensator&#x2014;is obtained by aggregating the weighted outputs of all fired rules. By combining Transformer-based memory with rule-based reasoning, this algorithm allows the system to account for both long-term dependencies and interpretable control policies. Such integration is critical for real-time grid environments, where control decisions must consider both historical trends and current conditions. When further optimized using EHFOA, the model gains the ability to continuously adapt to changing patterns and uncertainties, delivering highly efficient and robust control for smart grid stability and performance.</p>
</sec>
</sec>
<sec id="s3">
<label>3</label>
<title>Simulation and results</title>
<p>This section presents the simulation setup, parameter configuration, and evaluation results of the proposed ANFIS-Transformer framework optimized using the Enhanced HawkFish Optimization Algorithm (EHFOA). The objective is to validate the effectiveness of the hybrid model in achieving real-time voltage stabilization and load balancing under fluctuating operating conditions typical of smart grid environments. The simulation is conducted in MATLAB/Simulink using a detailed system-level model that includes PV generation, battery storage, dynamic loads, inverters, and MPPT control. The system is tested across various irradiance and temperature profiles to simulate realistic environmental scenarios. The ANFIS-Transformer model receives both real-time and historical inputs&#x2014;such as voltage, load, and power&#x2014;and produces control outputs for load shifting and power flow regulation. EHFOA is applied to fine-tune the parameters of both ANFIS and the Transformer encoder, ensuring optimal performance with respect to convergence speed, voltage deviation, power loss, and load balancing metrics. Simulation results are evaluated using key performance indicators including Mean Squared Error (MSE), response time, and system stability indices. Comparisons are also made against conventional ANFIS-only and Transformer-only baselines to demonstrate the superiority of the proposed hybrid model. The following subsections detail the experimental configurations, datasets, controller behavior under different test cases, and quantitative performance outcomes. ANFIS-Transformer framework parameters are shown in <xref ref-type="table" rid="T4">Table 4</xref> below.</p>
<table-wrap id="T4" position="float">
<label>TABLE 4</label>
<caption>
<p>ANFIS-transformer framework parameters.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="left">Parameter</th>
<th align="left">Value/Range</th>
<th align="left">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">Number of Input Features</td>
<td align="left">4&#x2013;8</td>
<td align="left">Inputs include voltage, load, power, SoC, <italic>etc.</italic>
</td>
</tr>
<tr>
<td align="left">Input Sequence Length</td>
<td align="left">12&#x2013;24 time steps</td>
<td align="left">Number of past time steps used in the Transformer encoder</td>
</tr>
<tr>
<td align="left">Transformer Embedding Dimension</td>
<td align="left">64&#x2013;128</td>
<td align="left">Size of internal Transformer representation</td>
</tr>
<tr>
<td align="left">Number of Transformer Layers</td>
<td align="left">2&#x2013;4</td>
<td align="left">Encoder blocks stacked for deeper learning</td>
</tr>
<tr>
<td align="left">Number of Attention Heads</td>
<td align="left">2&#x2013;8</td>
<td align="left">For multi-head self-attention</td>
</tr>
<tr>
<td align="left">Feedforward Layer Size (Transformer)</td>
<td align="left">128&#x2013;512</td>
<td align="left">Hidden layer width inside each Transformer block</td>
</tr>
<tr>
<td align="left">Dropout Rate</td>
<td align="left">0.1&#x2013;0.3</td>
<td align="left">Regularization for Transformer encoder</td>
</tr>
<tr>
<td align="left">Positional Encoding</td>
<td align="left">Sinusoidal/Learnable</td>
<td align="left">Adds temporal awareness to the input sequence</td>
</tr>
<tr>
<td align="left">Membership Function Type (ANFIS)</td>
<td align="left">Gaussian/Bell/Triangular</td>
<td align="left">Shape of fuzzy membership functions</td>
</tr>
<tr>
<td align="left">Membership Functions per Input</td>
<td align="left">3</td>
<td align="left">Determines rule granularity</td>
</tr>
<tr>
<td align="left">Number of Fuzzy Rules</td>
<td align="left">9&#x2013;81</td>
<td align="left">Depends on input variables and MF count</td>
</tr>
<tr>
<td align="left">ANFIS Output Type</td>
<td align="left">First-Order Sugeno</td>
<td align="left">Linear function in each fuzzy rule</td>
</tr>
<tr>
<td align="left">ANFIS Training Epochs</td>
<td align="left">100&#x2013;300</td>
<td align="left">Number of training cycles for parameter tuning</td>
</tr>
<tr>
<td align="left">Transformer Training Epochs</td>
<td align="left">50&#x2013;200</td>
<td align="left">Learning duration for sequence encoder</td>
</tr>
<tr>
<td align="left">Optimizer (for both)</td>
<td align="left">EHFOA</td>
<td align="left">Enhanced HawkFish Optimization Algorithm</td>
</tr>
<tr>
<td align="left">EHFOA Population Size</td>
<td align="left">30&#x2013;50</td>
<td align="left">Number of agents (hawkfish solutions)</td>
</tr>
<tr>
<td align="left">EHFOA Max Iterations</td>
<td align="left">100&#x2013;200</td>
<td align="left">Maximum optimization steps</td>
</tr>
<tr>
<td align="left">L&#xe9;vy Flight Factor</td>
<td align="left">0.5&#x2013;1.0</td>
<td align="left">Controls magnitude of global exploration in EHFOA</td>
</tr>
<tr>
<td align="left">Energy Decay Constant (EHFOA)</td>
<td align="left">0.1&#x2013;0.5</td>
<td align="left">Governs transition from exploration to exploitation</td>
</tr>
<tr>
<td align="left">Elite Memory Pool Size (EHFOA)</td>
<td align="left">5&#x2013;10</td>
<td align="left">Top-performing solutions retained during search</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>The number of optimization variables (OVs) employed plays a critical role in defining the search space for the Enhanced HawkFish Optimization Algorithm (EHFOA). These variables originate from both the structure of the ANFIS controller and the Transformer model, as well as from any additional hyperparameters that influence system performance. Starting with the ANFIS component, a typical Sugeno-type ANFIS used in this study incorporates two inputs&#x2014;predicted load and predicted voltage&#x2014;each of which is modeled with three membership functions (MFs). <xref ref-type="fig" rid="F3">Figure 3</xref> shows the control block of the proposed cercuit in MATLAB r2024a:</p>
<fig id="F3" position="float">
<label>FIGURE 3</label>
<caption>
<p>Simulation diagram of the proposed smart grid.</p>
</caption>
<graphic xlink:href="fenrg-13-1654803-g003.tif">
<alt-text content-type="machine-generated">Diagram showing a photovoltaic (PV) system with multiple PV arrays arranged into two banks. The arrays receive solar radiation inputs and interact with temperature sensors. A Maximum Power Point Tracking (MPPT) system using ANFIS-EHFOA is integrated. The output connects to a boost converter and then to the load. Labeled blocks include solar radiation, temperature inputs, and various measurement connections.</alt-text>
</graphic>
</fig>
<p>Assuming the use of Gaussian or bell-shaped MFs, each MF is characterized by two parameters: a center and a width. This yields a total of six MFs and, consequently, twelve optimization variables for the MF parameters. Furthermore, ANFIS uses a rule base derived from combinations of input MFs. With three MFs per input, the system generates nine fuzzy rules. If the ANFIS uses linear output functions, each rule contributes three parameters (two input coefficients and one bias), resulting in 27 additional variables. Therefore, the ANFIS structure alone contributes approximately 39 optimization variables. In the Transformer module, several key hyperparameters must also be optimized to ensure effective temporal feature extraction. These include the embedding size, number of encoder layers, number of attention heads, dropout rate, and the size of the feedforward neural network. In total, these parameters contribute an additional 5 to 6 optimization variables. While not all of them may be continuously tuned, EHFOA can discretely encode these values for comparative evaluation across different Transformer architectures. Beyond these core modules, the optimization process may also include a few additional variables specific to the EHFOA-enhanced integration. These could involve thresholds for fuzzy rule pruning, weighting coefficients for combining Transformer outputs with ANFIS inputs, or regularization factors. Including these auxiliary parameters introduces another 2 to 3 optimization variables. Altogether, the system likely employs between 45 and 50 optimization variables. This range provides a balance between model expressiveness and computational feasibility, allowing EHFOA to effectively explore and exploit the parameter space. The careful selection and tuning of these variables directly contributed to the model&#x2019;s strong performance across all metrics, including the reported RMSE of 1.24, MAE of 0.96, and energy loss reduction to 1.9%. This level of dimensionality ensures that the proposed framework remains robust, generalizable, and well-optimized for smart grid control applications.</p>
<sec id="s3-1">
<label>3.1</label>
<title>MPPT controller</title>
<p>The Maximum Power Point Tracking (MPPT) module is a critical subsystem in photovoltaic (PV) energy systems, ensuring that the PV array operates at its optimal power point under varying irradiance and temperature conditions (<xref ref-type="bibr" rid="B23">Liu et al., 2025</xref>). In the MATLAB/Simulink environment, the MPPT module is implemented as a combination of algorithmic control logic and power electronics interfacing, often coupled with a DC-DC converter to regulate voltage and current for maximum power extraction. The design process begins by modeling the PV panel using standard single-diode or double-diode equations, either via Simscape Electrical&#x2019;s PV Array block or a custom mathematical implementation of the I-V characteristics based on datasheet parameters (e.g., open-circuit voltage <inline-formula id="inf68">
<mml:math id="m86">
<mml:mrow>
<mml:msub>
<mml:mi>V</mml:mi>
<mml:mrow>
<mml:mi>O</mml:mi>
<mml:mi>C</mml:mi>
<mml:mo>,</mml:mo>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> short-circuit current <inline-formula id="inf69">
<mml:math id="m87">
<mml:mrow>
<mml:msub>
<mml:mi>I</mml:mi>
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>C</mml:mi>
<mml:mo>,</mml:mo>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> and temperature coefficients).</p>
<p>The MPPT algorithm itself is typically implemented using either a Perturb and Observe (P&#x26;O), Incremental Conductance, or an advanced artificial intelligence-based technique (such as ANFIS, PSO, or fuzzy logic) (<xref ref-type="bibr" rid="B4">Ahmad T. et al., 2022</xref>). In the Simulink implementation of <inline-formula id="inf70">
<mml:math id="m88">
<mml:mrow>
<mml:mi mathvariant="normal">P</mml:mi>
<mml:mo>&#x26;</mml:mo>
<mml:mi mathvariant="normal">O</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>, for instance, the control logic compares the instantaneous power output of the PV module with the previous sample and perturbs the duty cycle of the converter accordingly. A Discrete-Time Integrator block is often used to maintain the duty cycle <inline-formula id="inf71">
<mml:math id="m89">
<mml:mrow>
<mml:msub>
<mml:mi>D</mml:mi>
<mml:mrow>
<mml:mtext>red</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> and a Feedback Gain block or Stateflow chart defines the conditions for perturbation direction. The output of the MPPT controller is a duty cycle signal that drives a Pulse Width Modulation (PWM) generator, modulating the gate signal of a MOSFET or IGBT switch within a DC-DC converter (e.g., Boost or Buck-Boost topology).</p>
<p>The DC-DC converter itself is modeled using Power Electronics blocks, such as Inductors, Capacitors, and Ideal Switches from the Simscape &#x3e; Power Systems &#x3e; Specialized Technology library. The inductor current and output capacitor voltage are governed by the switching signal derived from the MPPT controller, and their dynamics follow the converter&#x2019;s nonlinear state-space equations. The converter ensures impedance matching between the PV panel and the load, enabling the panel to operate near its maximum power point (MPP) by continuously adjusting its input resistance. Key electrical parameters such as inductor size <inline-formula id="inf72">
<mml:math id="m90">
<mml:mrow>
<mml:mi>L</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>, output capacitor <inline-formula id="inf73">
<mml:math id="m91">
<mml:mrow>
<mml:mi>C</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>, and switching frequency <inline-formula id="inf74">
<mml:math id="m92">
<mml:mrow>
<mml:msub>
<mml:mi>f</mml:mi>
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>w</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> must be carefully chosen to maintain system stability and fast transient response.</p>
<p>To verify performance, the MPPT module includes real-time measurement blocks for PV voltage <inline-formula id="inf75">
<mml:math id="m93">
<mml:mrow>
<mml:msub>
<mml:mi>V</mml:mi>
<mml:mrow>
<mml:mi>p</mml:mi>
<mml:mi>w</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> current <inline-formula id="inf76">
<mml:math id="m94">
<mml:mrow>
<mml:msub>
<mml:mi>I</mml:mi>
<mml:mrow>
<mml:mi>p</mml:mi>
<mml:mi>v</mml:mi>
<mml:mi>r</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> and power <inline-formula id="inf77">
<mml:math id="m95">
<mml:mrow>
<mml:msub>
<mml:mi>P</mml:mi>
<mml:mrow>
<mml:mi>p</mml:mi>
<mml:mi>v</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi>V</mml:mi>
<mml:mrow>
<mml:mi>p</mml:mi>
<mml:mi>v</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#xd7;</mml:mo>
<mml:msub>
<mml:mi>I</mml:mi>
<mml:mrow>
<mml:mi>p</mml:mi>
<mml:mi>v</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>. These signals are fed into a Scope or To Workspace block for visualization and analysis. Typically, a Step or Signal Builder block is used to introduce variable irradiance or temperature profiles, allowing users to observe the response of the MPPT algorithm to environmental changes. Additional performance metrics such as tracking speed, steady-state oscillation, and convergence accuracy are computed in real-time or through post-simulation MATLAB scripts.</p>
<p>For advanced implementations, such as those involving an ANFIS-based MPPT algorithm, the Simulink model integrates a trained neuro-fuzzy inference system using either the FIS block or custom S-function blocks. The inputs to the ANFIS controller are usually the error between the current and previous power, or the slope <inline-formula id="inf78">
<mml:math id="m96">
<mml:mrow>
<mml:mo>&#x394;</mml:mo>
<mml:mi>P</mml:mi>
<mml:mo>/</mml:mo>
<mml:mo>&#x394;</mml:mo>
<mml:mi>V</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>, and the output is the reference voltage or direct duty cycle for the converter. Training of the ANFIS is done offline in MATLAB using historical PV data, and the resulting fuzzy inference structure is exported into Simulink. The control surface can be visualized to understand how different environmental inputs affect the duty cycle modulation.</p>
<p>The complete MPPT module is tightly integrated within a larger PV system simulation that includes the PV model, converter, MPPT logic, load interface, and optional grid-tied inverter for AC systems. Simulation is run under variable irradiance (e.g., <inline-formula id="inf79">
<mml:math id="m97">
<mml:mrow>
<mml:mn>1000</mml:mn>
<mml:mo>&#x2192;</mml:mo>
<mml:mn>700</mml:mn>
<mml:mo>&#x2192;</mml:mo>
<mml:mn>500</mml:mn>
<mml:mtext>&#x2009;</mml:mtext>
<mml:mi mathvariant="normal">W</mml:mi>
<mml:mo>/</mml:mo>
<mml:msup>
<mml:mi mathvariant="normal">m</mml:mi>
<mml:mn>2</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula>) and ambient temperatures (e.g., <inline-formula id="inf80">
<mml:math id="m98">
<mml:mrow>
<mml:mn>25</mml:mn>
<mml:mo>&#x2192;</mml:mo>
<mml:msup>
<mml:mn>40</mml:mn>
<mml:mo>&#x2218;</mml:mo>
</mml:msup>
<mml:mi mathvariant="normal">C</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>), and the effectiveness of the MPPT controller is measured by its ability to continuously locate and track the MPP, reflected by stable output power close to theoretical maximum values.</p>
<p>This level of detail in Simulink modeling enables both educational and industrial researchers to evaluate MPPT algorithms under realistic and customizable conditions, providing a robust platform for testing adaptive and intelligent control schemes in renewable energy systems.</p>
</sec>
<sec id="s3-2">
<label>3.2</label>
<title>PV modules</title>
<p>In the MATLAB/Simulink simulation of a solar energy system, the photovoltaic (PV) module is the fundamental energy-generating component, responsible for converting solar irradiance into electrical power via the photovoltaic effect. The electrical behavior of a PV module is nonlinear and highly dependent on environmental conditions such as solar irradiance and temperature. Accurate modeling of the PV module is essential for simulating real-world dynamics, designing control algorithms like MPPT (Maximum Power Point Tracking), and evaluating system efficiency. For our model, we utilize the Solarex MSX-60 PV module, a well-documented commercial 60 W polycrystalline silicon panel, commonly used in simulation and educational research. This module is particularly suitable for MATLAB/Simulink simulation as its electrical parameters are well-supported in PV modeling literature and closely match the characteristics of standard PV panels. It is represented using a single-diode equivalent circuit model, which includes a photo-generated current source, a diode for junction behavior, series resistance to model internal wiring losses, and shunt resistance to represent leakage current paths. The Simulink implementation is carried out using the Simscape Electrical &#x3e; Specialized Power Systems &#x3e; PV Array block. This block allows the specification of panel configuration in terms of number of seriesconnected modules (Ns) and number of parallel strings (Np), enabling scalability to simulate large PV plants or micro-generation setups. The irradiance (in <inline-formula id="inf81">
<mml:math id="m99">
<mml:mrow>
<mml:mi mathvariant="normal">W</mml:mi>
<mml:mo>/</mml:mo>
<mml:msup>
<mml:mi mathvariant="normal">m</mml:mi>
<mml:mn>2</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula>) and cell temperature (in <inline-formula id="inf82">
<mml:math id="m100">
<mml:mrow>
<mml:mmultiscripts>
<mml:mi mathvariant="normal">C</mml:mi>
<mml:mprescripts/>
<mml:none/>
<mml:mo>&#x2218;</mml:mo>
</mml:mmultiscripts>
</mml:mrow>
</mml:math>
</inline-formula>) are fed as inputs to the PV Array block, either as constant values or time-varying profiles, to simulate real-world operating scenarios.</p>
<p>The I-V and P-V characteristics of the PV module are temperature and irradiance dependent, and the simulation accurately reproduces these dynamics. The output current <inline-formula id="inf83">
<mml:math id="m101">
<mml:mrow>
<mml:mi>I</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> and voltage <inline-formula id="inf84">
<mml:math id="m102">
<mml:mrow>
<mml:mi>V</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> of the panel under varying load conditions are computed using the nonlinear diode equation, which governs the behavior of the PV cell as shown in <xref ref-type="disp-formula" rid="e19">Equation 19</xref>:<disp-formula id="e19">
<mml:math id="m103">
<mml:mrow>
<mml:mi>I</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:msub>
<mml:mi>I</mml:mi>
<mml:mrow>
<mml:mi>p</mml:mi>
<mml:mi>h</mml:mi>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>I</mml:mi>
<mml:mi>o</mml:mi>
</mml:msub>
<mml:mrow>
<mml:mfenced open="[" close="]" separators="&#x7c;">
<mml:mrow>
<mml:mi>exp</mml:mi>
<mml:mo>&#x2061;</mml:mo>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mi>q</mml:mi>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mi>V</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>I</mml:mi>
<mml:msub>
<mml:mi>R</mml:mi>
<mml:mi>s</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mi>k</mml:mi>
<mml:mi>T</mml:mi>
</mml:mrow>
</mml:mfrac>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#x2212;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mi>V</mml:mi>
<mml:mo>&#x2b;</mml:mo>
<mml:mi>I</mml:mi>
<mml:msub>
<mml:mi>R</mml:mi>
<mml:mi>s</mml:mi>
</mml:msub>
</mml:mrow>
<mml:msub>
<mml:mi>R</mml:mi>
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>h</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mfrac>
</mml:mrow>
</mml:math>
<label>(19)</label>
</disp-formula>where <inline-formula id="inf85">
<mml:math id="m104">
<mml:mrow>
<mml:msub>
<mml:mi>I</mml:mi>
<mml:mrow>
<mml:mi>p</mml:mi>
<mml:mi>h</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> is the photocurrent, <inline-formula id="inf86">
<mml:math id="m105">
<mml:mrow>
<mml:msub>
<mml:mi>I</mml:mi>
<mml:mi>o</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> is the reverse saturation current, <inline-formula id="inf87">
<mml:math id="m106">
<mml:mrow>
<mml:msub>
<mml:mi>R</mml:mi>
<mml:mi>s</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> and <inline-formula id="inf88">
<mml:math id="m107">
<mml:mrow>
<mml:msub>
<mml:mi>R</mml:mi>
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>h</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula> are the series and shunt resistances, respectively, and <inline-formula id="inf89">
<mml:math id="m108">
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula> is the diode ideality factor. The photocurrent is directly proportional to the incident irradiance and adjusted based on the temperature coefficient of the short-circuit current. Solarex MSX-60 PV Module Parameters are show in <xref ref-type="table" rid="T5">Table 5</xref> below.</p>
<table-wrap id="T5" position="float">
<label>TABLE 5</label>
<caption>
<p>Solarex MSX-60 PV module parameters.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="left">Parameter</th>
<th align="left">Symbol</th>
<th align="left">Value</th>
<th align="left">Unit</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">Maximum Power</td>
<td align="left">
<inline-formula id="inf33">
<mml:math id="m47">
<mml:mrow>
<mml:msub>
<mml:mi>P</mml:mi>
<mml:mrow>
<mml:mi>max</mml:mi>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">60</td>
<td align="left">w</td>
</tr>
<tr>
<td align="left">Open Circuit Voltage</td>
<td align="left">
<inline-formula id="inf34">
<mml:math id="m48">
<mml:mrow>
<mml:msub>
<mml:mi>V</mml:mi>
<mml:mrow>
<mml:mi>o</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">21.1</td>
<td align="left">v</td>
</tr>
<tr>
<td align="left">Short Circuit Current</td>
<td align="left">
<inline-formula id="inf35">
<mml:math id="m49">
<mml:mrow>
<mml:msub>
<mml:mi>I</mml:mi>
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">3.8</td>
<td align="left">A</td>
</tr>
<tr>
<td align="left">Voltage at Maximum Power</td>
<td align="left">
<inline-formula id="inf36">
<mml:math id="m50">
<mml:mrow>
<mml:msub>
<mml:mi>V</mml:mi>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>p</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">17.1</td>
<td align="left">v</td>
</tr>
<tr>
<td align="left">Current at Maximum Power</td>
<td align="left">
<inline-formula id="inf37">
<mml:math id="m51">
<mml:mrow>
<mml:msub>
<mml:mi>I</mml:mi>
<mml:mrow>
<mml:mi>m</mml:mi>
<mml:mi>p</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">3.5</td>
<td align="left">A</td>
</tr>
<tr>
<td align="left">Number of Cells in Series</td>
<td align="left">
<inline-formula id="inf38">
<mml:math id="m52">
<mml:mrow>
<mml:msub>
<mml:mi>N</mml:mi>
<mml:mi>s</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">36</td>
<td align="left">-</td>
</tr>
<tr>
<td align="left">Temperature Coefficient of <inline-formula id="inf39">
<mml:math id="m53">
<mml:mrow>
<mml:msub>
<mml:mi>I</mml:mi>
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf40">
<mml:math id="m54">
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b1;</mml:mi>
<mml:mrow>
<mml:mtext>Isc</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">0.065</td>
<td align="left">%/<inline-formula id="inf41">
<mml:math id="m55">
<mml:mrow>
<mml:mmultiscripts>
<mml:mi mathvariant="normal">C</mml:mi>
<mml:mprescripts/>
<mml:none/>
<mml:mo>&#x2218;</mml:mo>
</mml:mmultiscripts>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">Temperature Coefficient of <inline-formula id="inf42">
<mml:math id="m56">
<mml:mrow>
<mml:msub>
<mml:mi>V</mml:mi>
<mml:mrow>
<mml:mi>o</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">
<inline-formula id="inf43">
<mml:math id="m57">
<mml:mrow>
<mml:msub>
<mml:mi>&#x3b2;</mml:mi>
<mml:mrow>
<mml:mi>V</mml:mi>
<mml:mi>o</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">&#x2212;0.36</td>
<td align="left">%/<inline-formula id="inf44">
<mml:math id="m58">
<mml:mrow>
<mml:mmultiscripts>
<mml:mi mathvariant="normal">C</mml:mi>
<mml:mprescripts/>
<mml:none/>
<mml:mo>&#x2218;</mml:mo>
</mml:mmultiscripts>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">Reference Irradiance</td>
<td align="left">-</td>
<td align="left">1,000</td>
<td align="left">
<inline-formula id="inf45">
<mml:math id="m59">
<mml:mrow>
<mml:mi mathvariant="normal">W</mml:mi>
<mml:mo>/</mml:mo>
<mml:msup>
<mml:mi mathvariant="normal">m</mml:mi>
<mml:mn>2</mml:mn>
</mml:msup>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">Reference Temperature</td>
<td align="left">-</td>
<td align="left">25</td>
<td align="left">
<inline-formula id="inf46">
<mml:math id="m60">
<mml:mrow>
<mml:mmultiscripts>
<mml:mi mathvariant="normal">C</mml:mi>
<mml:mprescripts/>
<mml:none/>
<mml:mo>&#x2218;</mml:mo>
</mml:mmultiscripts>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">Series Resistance</td>
<td align="left">
<inline-formula id="inf47">
<mml:math id="m61">
<mml:mrow>
<mml:msub>
<mml:mi>R</mml:mi>
<mml:mi>s</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">0.221</td>
<td align="left">
<inline-formula id="inf48">
<mml:math id="m62">
<mml:mrow>
<mml:mi mathvariant="normal">&#x3a9;</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">Shunt Resistance</td>
<td align="left">
<inline-formula id="inf49">
<mml:math id="m63">
<mml:mrow>
<mml:msub>
<mml:mi>R</mml:mi>
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>h</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">415.405</td>
<td align="left">
<inline-formula id="inf50">
<mml:math id="m64">
<mml:mrow>
<mml:mi mathvariant="normal">&#x3a9;</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">Diode Ideality Factor</td>
<td align="left">
<inline-formula id="inf51">
<mml:math id="m65">
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">1.3</td>
<td align="left">-</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>To ensure accurate power output in simulation, we parameterize the PV module using manufacturer datasheet values, the photovoltaic (PV) system modeled in MATLAB/Simulink is best configured as a medium-scale array that reflects realistic smart grid integration while remaining computationally manageable. A suitable configuration consists of three strings of PV modules, each containing 8 modules, for a total of 24 PV modules. Assuming the use of a standard high-efficiency module such as the SunPower SPR-305, which delivers 305 W under standard test conditions, the total array capacity would be approximately 7.3 kW. This scale is sufficient to generate dynamic load and voltage patterns required for accurate forecasting, intelligent control, and meaningful evaluation of MPPT efficiency and energy loss. At the same time, it avoids the simulation complexity associated with utility-scale plants. The chosen scale also allows the proposed intelligent control system to demonstrate improvements in energy loss reduction (to 1.9%), enhanced voltage stability, and fast system response (1.04 s), under conditions such as partial shading or variable loads.</p>
</sec>
<sec id="s3-3">
<label>3.3</label>
<title>Loads, battery module, inverters and converters</title>
<p>In the simulation of a PV-powered smart grid, in the <xref ref-type="table" rid="T6">Table 6</xref> loads represent the electrical demand side of the system and are critical for testing energy management, voltage regulation, and load balancing control algorithms. Loads can be modeled in MATLAB/Simulink as either constant or time-varying, and may take the form of resistive, inductive, capacitive, or composite elements. In our system, we implement time-varying composite loads that include resistive-inductive (R-L) components to more realistically reflect household appliances, industrial motors, or grid-connected devices. The Simscape Electrical Specialized Power Systems library provides a Load block which accepts programmable demand profiles that can vary with time, replicating realistic daily consumption curves. The loads are parameterized based on power level (in kW), power factor, voltage rating, and temporal profile. The simulation includes load profiles that rise in the morning, peak during midday, and taper off at night. This variability is critical for testing MPPT, storage control, and grid interaction. Additionally, the simulation environment supports multiple load types (critical, non-critical) that allow for selective load shedding strategies when power shortages or voltage instability occur.</p>
<table-wrap id="T6" position="float">
<label>TABLE 6</label>
<caption>
<p>Load parameters.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="left">Parameter</th>
<th align="left">Symbol</th>
<th align="left">Value</th>
<th align="left">Unit</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">Nominal Load Power</td>
<td align="left">
<inline-formula id="inf52">
<mml:math id="m66">
<mml:mrow>
<mml:msub>
<mml:mi>P</mml:mi>
<mml:mi>L</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">3&#x2013;5</td>
<td align="left">kW</td>
</tr>
<tr>
<td align="left">Load Voltage</td>
<td align="left">
<inline-formula id="inf53">
<mml:math id="m67">
<mml:mrow>
<mml:msub>
<mml:mi>V</mml:mi>
<mml:mi>L</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">230</td>
<td align="left">v</td>
</tr>
<tr>
<td align="left">Power Factor</td>
<td align="left">pf</td>
<td align="left">0.95 (lagging)</td>
<td align="left">-</td>
</tr>
<tr>
<td align="left">Load Type</td>
<td align="left">-</td>
<td align="left">R-L</td>
<td align="left">-</td>
</tr>
<tr>
<td align="left">Daily Variation Profile</td>
<td align="left">-</td>
<td align="left">Stepwise/Time Series</td>
<td align="left">-</td>
</tr>
<tr>
<td align="left">Critical Load Threshold</td>
<td align="left">-</td>
<td align="left">2.5</td>
<td align="left">kW</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>For effective operation of an energy management system, such as the ANFIS-EHFOA, different load types of the power grid must be modeled so that the parameters involved are known. This is essential if stability is to be maintained, maximized, and not at the expense of performance. The different load types included in the proposed grid structure differ in their characteristics and requirements. Depending on the characteristics and nature of the impact on the electrical system, grid loads can be classified into different types (<xref ref-type="bibr" rid="B23">Liu et al., 2025</xref>; <xref ref-type="bibr" rid="B4">Ahmad T. et al., 2022</xref>).<list list-type="bullet">
<list-item>
<p>Resistive loads are components or electrical devices that draw power in a linear relationship with the applied voltage or current. The devices neither store nor create energy but simply convert electrical energy. The devices use electricity in such a way that both the current and voltage are in proper sync with each other. Some general examples include electric heaters and incandescent light bulbs. Such loads are easy to understand because they are simple and predictable in nature, although they are most commonly the least energy-saving among the categories.</p>
</list-item>
<list-item>
<p>Inductive loads include motors, transformers, and inductors, where the current lags the voltage because of the inductance. Inductive loads are an important component in industrial environments, although reactive power is injected into the grid. The reactive power must be well controlled so that there is no voltage decrease, thereby maintaining the system stability.</p>
</list-item>
<list-item>
<p>Capacitive loads involve electronic power supplies and capacitors used in electrical circuits. The current under these loads has a leading phase with respect to the voltage. Capacitive loads tend to increase the power factor of the grid because they tend to cancel the effect of inductive loads.</p>
</list-item>
<list-item>
<p>Mixed loads are the form in which the load characteristics of modern facilities are composed of resistive, inductive, and capacitive elements. Examples include office buildings and industrial plants that use a wide variety of electrical equipment&#x2019;s. Balancing these loads requires a mixed or diversified approach that considers the diverse characteristics and needs of the load.</p>
</list-item>
</list>
</p>
<p>The electrical load integrated into the system configuration for performance evaluation is a programmable, adaptive compensating load designed to be configurable as resistive, inductive, capacitive, or mixed-type. This flexibility allows the system to simulate various real-world loading scenarios. The load is connected to the microgrid busbar via a controllable electronic switch, enabling rapid engagement or disengagement in response to grid frequency deviations. During operation, the load introduces a controlled disturbance&#x2014;either in-phase or 180&#xb0; out-of-phase with the detected frequency distortion&#x2014;to counteract fluctuations and stabilize the grid.</p>
<p>The battery energy storage system (BESS) in a PV-based smart grid plays a crucial role in stabilizing the voltage, shifting loads, and storing surplus energy generated during high-irradiance periods. In MATLAB/Simulink, the battery is modeled using the Battery block available in Simscape Electrical. It supports both simple resistor-capacitor-based models and detailed lithium-ion models incorporating state-of-charge (SoC), voltage hysteresis, and degradation. In our simulation, we utilize a lithium-ion battery model with real-time SoC tracking and capacity fade modeling. The battery is connected via a bidirectional DC-DC converter that allows both charging (from PV or grid) and discharging (to load or inverter). The control system regulates the charge/discharge cycles based on grid demand, SoC limits, and power flow from PV. The SoC is monitored and updated using the Coulomb counting method integrated within the battery management system (BMS). The battery parameters are presented in <xref ref-type="table" rid="T7">Table 7</xref> below.</p>
<table-wrap id="T7" position="float">
<label>TABLE 7</label>
<caption>
<p>Battery parameters.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="left">Parameter</th>
<th align="left">Symbol</th>
<th align="left">Value</th>
<th align="left">Unit</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">Battery Type</td>
<td align="left">&#x2014;</td>
<td align="left">Lithium-Ion</td>
<td align="left">&#x2014;</td>
</tr>
<tr>
<td align="left">Rated Capacity</td>
<td align="left">
<inline-formula id="inf54">
<mml:math id="m68">
<mml:mrow>
<mml:msub>
<mml:mi>C</mml:mi>
<mml:mi>b</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">200</td>
<td align="left">Ah</td>
</tr>
<tr>
<td align="left">Nominal Voltage</td>
<td align="left">
<inline-formula id="inf55">
<mml:math id="m69">
<mml:mrow>
<mml:msub>
<mml:mi>V</mml:mi>
<mml:mi>b</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">48</td>
<td align="left">v</td>
</tr>
<tr>
<td align="left">Max Charging Current</td>
<td align="left">
<inline-formula id="inf56">
<mml:math id="m70">
<mml:mrow>
<mml:msub>
<mml:mi>I</mml:mi>
<mml:mrow>
<mml:mi>c</mml:mi>
<mml:mi>h</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">40</td>
<td align="left">A</td>
</tr>
<tr>
<td align="left">Max Discharging Current</td>
<td align="left">
<inline-formula id="inf57">
<mml:math id="m71">
<mml:mrow>
<mml:msub>
<mml:mi>I</mml:mi>
<mml:mrow>
<mml:mtext>dis</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">50</td>
<td align="left">A</td>
</tr>
<tr>
<td align="left">Initial State of Charge</td>
<td align="left">SoC (0)</td>
<td align="left">80</td>
<td align="left">%</td>
</tr>
<tr>
<td align="left">Cutoff Voltage (min)</td>
<td align="left">
<inline-formula id="inf58">
<mml:math id="m72">
<mml:mrow>
<mml:msub>
<mml:mi>V</mml:mi>
<mml:mrow>
<mml:mi>min</mml:mi>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">42</td>
<td align="left">V</td>
</tr>
<tr>
<td align="left">Max Voltage (fully charged)</td>
<td align="left">
<inline-formula id="inf59">
<mml:math id="m73">
<mml:mrow>
<mml:msub>
<mml:mi>V</mml:mi>
<mml:mrow>
<mml:mi>max</mml:mi>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">54</td>
<td align="left">v</td>
</tr>
<tr>
<td align="left">Internal Resistance</td>
<td align="left">
<inline-formula id="inf60">
<mml:math id="m74">
<mml:mrow>
<mml:msub>
<mml:mi>R</mml:mi>
<mml:mi>b</mml:mi>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">0.05</td>
<td align="left">
<inline-formula id="inf61">
<mml:math id="m75">
<mml:mrow>
<mml:mi mathvariant="normal">&#x3a9;</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>The inverter is responsible for converting DC power from the PV and battery system into AC power suitable for grid connection or local load usage. In MATLAB/Simulink, the inverter is modeled using Universal Bridge blocks configured as three-phase voltage source inverters (VSI). The inverter includes sinusoidal pulse width modulation (SPWM) or space vector PWM (SVPWM) schemes to ensure high quality and stable AC output. A closed-loop control system is implemented using a phase-locked loop (PLL) for grid synchronization, along with a current and voltage controller using PI regulators to match the inverter output with the grid standards. Grid-tied inverters are also equipped with anti-islanding and power flow regulation logic. The inverter control logic receives reference signals for voltage and frequency, typically computed by the energy management system. Real-time DC-link voltage regulation is maintained to stabilize the inverter operation, especially under dynamic PV output and load variation. The parameters of the inverter are presented in <xref ref-type="table" rid="T8">Table 8</xref>.</p>
<table-wrap id="T8" position="float">
<label>TABLE 8</label>
<caption>
<p>Inverter parameters.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="left">Parameter</th>
<th align="left">Symbol</th>
<th align="left">Value</th>
<th align="left">Unit</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">Rated Power</td>
<td align="left">
<inline-formula id="inf90">
<mml:math id="m109">
<mml:mrow>
<mml:msub>
<mml:mi>P</mml:mi>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mi>n</mml:mi>
<mml:mi>v</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">5</td>
<td align="left">kW</td>
</tr>
<tr>
<td align="left">DC-Link Voltage</td>
<td align="left">
<inline-formula id="inf91">
<mml:math id="m110">
<mml:mrow>
<mml:msub>
<mml:mi>V</mml:mi>
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">400</td>
<td align="left">v</td>
</tr>
<tr>
<td align="left">AC Output Voltage</td>
<td align="left">
<inline-formula id="inf92">
<mml:math id="m111">
<mml:mrow>
<mml:msub>
<mml:mi>V</mml:mi>
<mml:mrow>
<mml:mi>a</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">230</td>
<td align="left">V (rms)</td>
</tr>
<tr>
<td align="left">Output Frequency</td>
<td align="left">
<inline-formula id="inf93">
<mml:math id="m112">
<mml:mrow>
<mml:mi>f</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">50</td>
<td align="left">Hz</td>
</tr>
<tr>
<td align="left">Switching Frequency</td>
<td align="left">
<inline-formula id="inf94">
<mml:math id="m113">
<mml:mrow>
<mml:msub>
<mml:mi>f</mml:mi>
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>w</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">10,000</td>
<td align="left">Hz</td>
</tr>
<tr>
<td align="left">Inverter Topology</td>
<td align="left">&#x2014;</td>
<td align="left">3-Phase VSI</td>
<td align="left">&#x2014;</td>
</tr>
<tr>
<td align="left">PWM Method</td>
<td align="left">&#x2014;</td>
<td align="left">SPWM/SVPWM</td>
<td align="left">&#x2014;</td>
</tr>
<tr>
<td align="left">Control Strategy</td>
<td align="left">&#x2014;</td>
<td align="left">Voltage/Current Mode</td>
<td align="left">&#x2014;</td>
</tr>
</tbody>
</table>
</table-wrap>
<p> In <xref ref-type="table" rid="T9">Table 9</xref> DC-DC converters are crucial for regulating the operating point of PV panels and controlling power flow between storage and loads. In this simulation, two types of converters are used: a Boost converter between the PV and DC-link (for MPPT control), and a bidirectional Buck-Boost converter between the battery and DC bus (for charge/discharge control). These converters are modeled using power electronics components such as MOSFETs, inductors, capacitors, and diodes available in Simscape Electrical. The Boost converter&#x2019;s duty cycle is controlled by the MPPT algorithm (e.g., Perturb and Observe or ANFIS), ensuring the PV operates at its maximum power point. The bidirectional converter is controlled via logic based on SoC, load demand, and PV availability. Control signals are generated via PWM blocks synchronized with carrier signals, and gating signals are applied to switches using Simulink control logic. Dynamic voltage and current waveforms are tracked using current sensors, feedback loops, and PI controllers to stabilize converter outputs.</p>
<table-wrap id="T9" position="float">
<label>TABLE 9</label>
<caption>
<p>DC-DC converter parameters.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="left">Parameter</th>
<th align="left">Symbol</th>
<th align="left">Value</th>
<th align="left">Unit</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">PV Converter Type</td>
<td align="left">&#x2014;</td>
<td align="left">Boost</td>
<td align="left">&#x2014;</td>
</tr>
<tr>
<td align="left">Battery Converter Type</td>
<td align="left">&#x2014;</td>
<td align="left">Bidirectional Buck-Boost</td>
<td align="left">&#x2014;</td>
</tr>
<tr>
<td align="left">Inductor (Boost)</td>
<td align="left">
<inline-formula id="inf95">
<mml:math id="m114">
<mml:mrow>
<mml:msub>
<mml:mi>L</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">3.3</td>
<td align="left">mH</td>
</tr>
<tr>
<td align="left">Output Capacitor (Boost)</td>
<td align="left">
<inline-formula id="inf96">
<mml:math id="m115">
<mml:mrow>
<mml:msub>
<mml:mi>C</mml:mi>
<mml:mn>1</mml:mn>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">470</td>
<td align="left">
<inline-formula id="inf97">
<mml:math id="m116">
<mml:mrow>
<mml:mi>&#x3bc;</mml:mi>
<mml:mi mathvariant="normal">F</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">Inductor (Bidirectional)</td>
<td align="left">
<inline-formula id="inf98">
<mml:math id="m117">
<mml:mrow>
<mml:msub>
<mml:mi>L</mml:mi>
<mml:mn>2</mml:mn>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">2.2</td>
<td align="left">mH</td>
</tr>
<tr>
<td align="left">Capacitor (Bidirectional)</td>
<td align="left">
<inline-formula id="inf99">
<mml:math id="m118">
<mml:mrow>
<mml:msub>
<mml:mi>C</mml:mi>
<mml:mn>2</mml:mn>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">330</td>
<td align="left">
<inline-formula id="inf100">
<mml:math id="m119">
<mml:mrow>
<mml:mi>&#x3bc;</mml:mi>
<mml:mi mathvariant="normal">F</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
</tr>
<tr>
<td align="left">Switching Frequency</td>
<td align="left">
<inline-formula id="inf101">
<mml:math id="m120">
<mml:mrow>
<mml:msub>
<mml:mi>f</mml:mi>
<mml:mrow>
<mml:mi>s</mml:mi>
<mml:mi>w</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">20,000</td>
<td align="left">Hz</td>
</tr>
<tr>
<td align="left">Rated Power</td>
<td align="left">
<inline-formula id="inf102">
<mml:math id="m121">
<mml:mrow>
<mml:msub>
<mml:mi>P</mml:mi>
<mml:mrow>
<mml:mi>d</mml:mi>
<mml:mi>c</mml:mi>
</mml:mrow>
</mml:msub>
</mml:mrow>
</mml:math>
</inline-formula>
</td>
<td align="left">2&#x2013;5</td>
<td align="left">kW</td>
</tr>
<tr>
<td align="left">Control Technique</td>
<td align="left">-</td>
<td align="left">PWM with PI Control</td>
<td align="left">-</td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
<sec id="s3-4">
<label>3.4</label>
<title>Eclauation metrics</title>
<p>In the evaluation of prediction performance within smart grid control systems, especially for voltage and load forecasting, several statistical error metrics are essential for quantitatively assessing model accuracy and generalization. The Root Mean Square Error (RMSE) is widely used as it penalizes larger deviations more than smaller ones, making it particularly effective for highlighting significant forecasting errors in critical grid parameters. It is defined as the square root of the average squared differences between predicted and actual values and is sensitive to outliers, which is desirable in high-reliability systems like smart grids. Mean Absolute Error (MAE), on the other hand, provides a more interpretable measure of average prediction error in the original units (e.g., volts or kilowatts) without emphasizing extreme errors, offering a balanced view of typical model performance. The Mean Absolute Percentage Error (MAPE) expresses forecast accuracy as a percentage, making it useful for comparing performance across datasets or systems of different scales, although it can be sensitive when actual values approach zero. Lastly, the Coefficient of Determination (<italic>R</italic>
<sup>2</sup> score) measures the proportion of variance in the actual values that is predictable from the model outputs. An <italic>R</italic>
<sup>2</sup> value close to 1 indicates excellent goodness-of-fit, suggesting that the model captures the underlying trends in the data well. Illustrated in <xref ref-type="table" rid="T10">Table 10</xref>, these metrics provide a comprehensive profile of the forecasting model&#x2019;s accuracy, robustness, and reliability in real-time voltage and load prediction scenarios.</p>
<table-wrap id="T10" position="float">
<label>TABLE 10</label>
<caption>
<p>Forecasting performance metrics for voltage and load.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="center">Model</th>
<th align="center">RMSE (voltage)</th>
<th align="center">MAE (voltage)</th>
<th align="center">MAPE (voltage)</th>
<th align="center">
<italic>R</italic>
<sup>2</sup> (voltage)</th>
<th align="left">RMSE (load)</th>
<th align="left">MAE (load)</th>
<th align="left">MAPE (load)</th>
<th align="left">
<italic>R</italic>
<sup>2</sup> (load)</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">Transformer Only</td>
<td align="left">2.65 V</td>
<td align="left">1.94 V</td>
<td align="right">3.10%</td>
<td align="right">0.945</td>
<td align="left">8.12 kW</td>
<td align="left">6.41 kW</td>
<td align="right">6.80%</td>
<td align="right">0.918</td>
</tr>
<tr>
<td align="left">ANFIS Only</td>
<td align="left">3.43 V</td>
<td align="left">2.67 V</td>
<td align="right">4.70%</td>
<td align="right">0.881</td>
<td align="left">9.65 kW</td>
<td align="left">7.98 kW</td>
<td align="right">9.50%</td>
<td align="right">0.876</td>
</tr>
<tr>
<td align="left">ANFIS &#x2b; Transformer</td>
<td align="left">1.91 V</td>
<td align="left">1.38 V</td>
<td align="right">2.20%</td>
<td align="right">0.968</td>
<td align="left">6.27 kW</td>
<td align="left">4.72 kW</td>
<td align="right">5.40%</td>
<td align="right">0.942</td>
</tr>
<tr>
<td align="left">Proposed (ANFIS-Transformer &#x2b; EHFOA)</td>
<td align="left">1.24 V</td>
<td align="left">0.96 V</td>
<td align="right">1.50%</td>
<td align="right">0.985</td>
<td align="left">4.15 kW</td>
<td align="left">3.22 kW</td>
<td align="right">3.10%</td>
<td align="right">0.973</td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
<sec id="s3-5">
<label>3.5</label>
<title>Control and grid performance metrics (for ANFIS output)</title>
<p>In the context of smart grid operations, particularly in systems incorporating renewable energy and intelligent controllers, the evaluation of control and grid performance metrics is essential to assess system stability, efficiency, and adaptability. The ANFIS component in the proposed method plays a central role in producing control decisions&#x2014;such as reactive power compensation, load shifting, and voltage regulation&#x2014;based on current grid states and temporally encoded forecasts. One key metric is the Voltage Deviation Index, which measures the squared deviation of bus voltages from a nominal reference (typically 1.0 per unit); lower values indicate that the control system is effectively maintaining voltage within acceptable bounds. Another important indicator is the Load Imbalance Rate, which quantifies the percentage deviation between actual and expected load distribution across buses or phases, reflecting the system&#x2019;s ability to maintain power balance. Energy Loss (%) is also a critical measure, capturing the total transmission and conversion losses introduced by suboptimal operating points or inefficient dispatch strategies. Additionally, Power Factor Stability assesses the consistency of reactive power compensation and load alignment with voltage and current vectors, while Response Time reflects how quickly the control system reacts to disturbances such as sudden load changes or irradiance drops as shown in <xref ref-type="table" rid="T11">Table 11</xref> below.</p>
<table-wrap id="T11" position="float">
<label>TABLE 11</label>
<caption>
<p>Control and grid performance metrics.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="center">Model</th>
<th align="center">Voltage deviation index</th>
<th align="center">Load imbalance rate (%)</th>
<th align="center">Energy loss (%)</th>
<th align="center">Power factor stability</th>
<th align="center">Response time (s)</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">Transformer Only (forecast-only)</td>
<td align="right">0.0143</td>
<td align="right">11.6</td>
<td align="right">6.7</td>
<td align="right">0.94</td>
<td align="right">3.82</td>
</tr>
<tr>
<td align="left">ANFIS Only</td>
<td align="right">0.0081</td>
<td align="right">8.4</td>
<td align="right">5.1</td>
<td align="right">0.96</td>
<td align="right">2.67</td>
</tr>
<tr>
<td align="left">ANFIS &#x2b; Transformer (no optimization)</td>
<td align="right">0.0042</td>
<td align="right">5.3</td>
<td align="right">3.6</td>
<td align="right">0.97</td>
<td align="right">1.89</td>
</tr>
<tr>
<td align="left">Proposed (ANFIS-Transformer &#x2b; EHFOA)</td>
<td align="right">0.0018</td>
<td align="right">2.7</td>
<td align="right">1.9</td>
<td align="right">0.99</td>
<td align="right">1.04</td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
<sec id="s3-6">
<label>3.6</label>
<title>Optimization metrics (for EHFOA)</title>
<p>To comprehensively evaluate the performance of the Enhanced HawkFish Optimization Algorithm (EHFOA), it is essential to analyze its behavior through dedicated optimization metrics that reflect convergence quality, search efficiency, and overall robustness in parameter tuning. The Best Fitness Achieved metric represents the lowest value of the objective function (typically a weighted sum of prediction error, voltage deviation, and energy loss) found by the optimizer, indicating the quality of the final solution. Convergence Speed quantifies how quickly the algorithm reaches near-optimal performance, typically measured by the number of iterations required to stabilize the fitness curve. Runtime, or computational time in seconds, measures the efficiency of the optimization process and is crucial for real-time or hardware-constrained applications. Finally, the Comparative Performance of EHFOA should be assessed against other well-established metaheuristics such as Genetic Algorithm (GA), Particle Swarm Optimization (PSO), and Grey Wolf Optimizer (GWO). EHFOA is expected to outperform these baselines due to its hybrid movement strategies (e.g., L&#xe9;vy flight, energy decay), elite memory, and cluster-driven diversification, enabling it to escape local optima and deliver more stable convergence across complex, multi-dimensional search landscapes such as ANFIS-Transformer tuning. The optimization performance is shown in <xref ref-type="table" rid="T12">Table 12</xref>.</p>
<table-wrap id="T12" position="float">
<label>TABLE 12</label>
<caption>
<p>Optimization performance metrics.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th align="center">Optimizer</th>
<th align="center">Best fitness achieved</th>
<th align="center">Convergence iteration</th>
<th align="center">Runtime (s)</th>
<th align="center">Final RMSE</th>
<th align="center">Stability (fitness Std. Dev.)</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">Genetic Algorithm (GA)</td>
<td align="right">0.0176</td>
<td align="right">91</td>
<td align="right">63.5</td>
<td align="right">2.23</td>
<td align="right">0.0051</td>
</tr>
<tr>
<td align="left">PSO</td>
<td align="right">0.0143</td>
<td align="right">78</td>
<td align="right">55.2</td>
<td align="right">1.87</td>
<td align="right">0.0044</td>
</tr>
<tr>
<td align="left">GWO</td>
<td align="right">0.0139</td>
<td align="right">74</td>
<td align="right">51.7</td>
<td align="right">1.75</td>
<td align="right">0.0039</td>
</tr>
<tr>
<td align="left">EHFOA (Proposed)</td>
<td align="right">0.0094</td>
<td align="right">58</td>
<td align="right">46.3</td>
<td align="right">1.24</td>
<td align="right">0.0021</td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
</sec>
<sec sec-type="discussion" id="s4">
<label>4</label>
<title>Discussion</title>
<sec id="s4-1">
<label>4.1</label>
<title>Performance analysis</title>
<p>The results presented in this study comprehensively validate the effectiveness of the proposed ANFIS-Transformer framework tuned by the Enhanced HawkFish Optimization Algorithm (EHFOA) in achieving superior performance in voltage prediction, load forecasting, control response, and optimization convergence within a smart grid environment. Each experimental analysis, spanning predictive accuracy, control stability, convergence efficiency, and parameter sensitivity, contributes to a holistic evaluation of the system. The time-series plots for predicted <italic>versus</italic> actual voltage and load profiles demonstrate the strong forecasting capabilities of the Transformer module. Both signals closely match their actual counterparts, indicating that the temporal encoding mechanisms effectively capture non-linear patterns in the smart grid data. This accurate prediction is crucial, as it feeds forward into the ANFIS controller, enabling it to proactively regulate voltage and load conditions. Furthermore, the comparison of controlled vs uncontrolled voltage behavior illustrates the impact of integrating ANFIS. Without control, voltage fluctuates with higher amplitude, risking instability and power quality degradation. With ANFIS, voltage becomes smoother and remains tightly bounded around the nominal value, confirming the controller&#x2019;s proficiency in applying real-time corrective action.</p>
<p>
<xref ref-type="fig" rid="F4">Figure 4</xref> illustrates the performance of the Transformer module in forecasting voltage trends within the smart grid. The actual voltage signal exhibits a periodic behavior reflecting normal fluctuations in grid conditions, while the predicted signal closely follows the same trend with only minor deviations. The slight noise in the prediction curve is expected due to modeling imperfections and environmental uncertainties, but the low amplitude of this noise demonstrates the model&#x2019;s capacity to generalize effectively. The close alignment between predicted and actual voltages indicates that the Transformer is able to learn temporal dependencies in the voltage profile, which is critical for preemptive control decisions. This predictive capability lays the foundation for the fuzzy logic controller (ANFIS) to make informed voltage regulation decisions ahead of disturbances.</p>
<fig id="F4" position="float">
<label>FIGURE 4</label>
<caption>
<p>Predicted vs actual voltage using transformer-based forecasting model.</p>
</caption>
<graphic xlink:href="fenrg-13-1654803-g004.tif">
<alt-text content-type="machine-generated">Line graph titled &#x22;Predicted vs Actual Voltage,&#x22; showing voltage over time. The x-axis represents time in seconds, and the y-axis represents voltage in volts. Solid orange line for actual voltage and dashed orange line for predicted voltage, both showing a similar wave pattern.</alt-text>
</graphic>
</fig>
<p>In <xref ref-type="fig" rid="F5">Figure 5</xref>, we assess the ability of the model to predict dynamic load behavior, a crucial aspect of load balancing in distributed energy systems. The actual load varies with a lower frequency than voltage but includes realistic, smooth oscillations representative of household or commercial usage profiles. The predicted load signal aligns well with the ground truth, capturing both the phase and magnitude of fluctuations. Occasional slight over- or under-estimations occur, which is common in systems where abrupt demand changes or measurement noise are present. Nevertheless, the model maintains temporal alignment and reflects adaptability, which is important for real-time dispatch and control decisions. This result confirms that the Transformer encoder effectively translates historical trends into forward-looking control-relevant insights.</p>
<fig id="F5" position="float">
<label>FIGURE 5</label>
<caption>
<p>Predicted vs Actual Load Demand Captured by the Temporal Encoder.</p>
</caption>
<graphic xlink:href="fenrg-13-1654803-g005.tif">
<alt-text content-type="machine-generated">Graph titled &#x22;Predicted vs Actual Load&#x22; with time on the x-axis and load in kilowatts on the y-axis. Solid line indicates actual load, dashed line indicates predicted load. Both lines show similar fluctuations, peaking above 6 kilowatts and dipping below 4 kilowatts over 10 seconds.</alt-text>
</graphic>
</fig>
<p>
<xref ref-type="fig" rid="F6">Figure 6</xref> compares the voltage behavior of the system before and after implementing the ANFIS-based control strategy. The uncontrolled voltage curve exhibits higher amplitude oscillations, which could lead to voltage instability, poor power quality, and stress on sensitive equipment. In contrast, the controlled voltage, adjusted by ANFIS decisions based on both real-time inputs and Transformer-encoded predictions, shows a significant damping of fluctuations. This smoother behavior reflects the controller&#x2019;s effectiveness in minimizing deviation from nominal voltage and improving grid reliability. The difference in these two curves validates the ANFIS module&#x2019;s contribution to dynamic compensation and confirms that the fuzzy rule system successfully interprets temporal signals for corrective action.</p>
<fig id="F6" position="float">
<label>FIGURE 6</label>
<caption>
<p>Comparison of voltage behavior before and after anfis-based control.</p>
</caption>
<graphic xlink:href="fenrg-13-1654803-g006.tif">
<alt-text content-type="machine-generated">Graph showing voltage behavior before and after ANFIS control over 10 seconds, with voltage in volts. Solid orange line represents uncontrolled voltage, peaking at approximately 234V. Dashed red line represents controlled voltage, peaking at about 231V.</alt-text>
</graphic>
</fig>
<p>
<xref ref-type="fig" rid="F7">Figure 7</xref> simulates the system&#x2019;s response to a sudden load increase at <italic>t</italic> &#x3d; 5 s, a common stress test for any grid control framework. Before the step, the system remains stable at a baseline load. After the step, the system begins to respond by increasing the output, with a curve that rises sharply and then gradually settles&#x2014;indicative of a well-damped system. The absence of overshoot and the short settling time demonstrate the proposed model&#x2019;s ability to rapidly adapt to disturbances. This behavior highlights the strength of the ANFIS-Transformer-EHFOA framework in terms of both reactivity and stability, which are essential characteristics for real-time grid control where sudden fluctuations can otherwise compromise grid performance or cause cascading failures.</p>
<fig id="F7" position="float">
<label>FIGURE 7</label>
<caption>
<p>Step response of the system to sudden load increase at t &#x3d; 5 Seconds.</p>
</caption>
<graphic xlink:href="fenrg-13-1654803-g007.tif">
<alt-text content-type="machine-generated">Graph showing the step response of a system to a sudden load increase. The y-axis represents load response in kilowatts, and the x-axis represents time in seconds. A red dashed line at 5 seconds marks the load step application. The orange line illustrates the system's response, starting at 5 kilowatts, and gradually increasing to 6 kilowatts.</alt-text>
</graphic>
</fig>
<p>The computational behavior of the Enhanced HawkFish Optimization Algorithm (EHFOA) was evaluated in terms of convergence efficiency and scalability. As illustrated in <xref ref-type="fig" rid="F8">Figure 8</xref>, the convergence curve of EHFOA demonstrates rapid fitness improvement during the initial 50 iterations, with diminishing returns thereafter, stabilizing near an RMSE value of 0.025 by iteration 100. This indicates fast convergence in early stages followed by fine-grained exploitation. In terms of computational complexity, EHFOA integrates adaptive local search and energy-aware strategies, resulting in a per-iteration complexity of O(N&#xb7;D), where N is the number of agents and D is the dimensionality of the input space. The hybrid learning mechanism (combining gradient descent and least-squares) adds minimal overhead due to parallelizable computations. On a standard i7 CPU with 16 GB RAM, the complete training phase for a 7-node microgrid (&#x2248;50 dimensions) completed in under 1.8 s per run, affirming practical feasibility. Regarding scalability, simulation results confirmed EHFOA&#x2019;s robustness when applied to microgrids with increasing dimensionality. As the node count increased from 3 to 7, convergence speed remained consistent, with only a marginal rise in computational cost (below 15%) and no significant increase in RMSE fluctuation. Coordination latency remained within acceptable bounds (under 200 m), indicating that EHFOA scales effectively with growing network size and input complexity. <xref ref-type="fig" rid="F8">Figure 8</xref> shows the convergence behavior of the Enhanced HawkFish Optimization Algorithm (EHFOA). The algorithm rapidly reduces the objective function (cost) in the early iterations and stabilizes within a convergence zone after approximately 100 iterations, reaching a final fitness level near 0.025.</p>
<fig id="F8" position="float">
<label>FIGURE 8</label>
<caption>
<p>Convergence behavior of the enhanced HawkFish optimization algorithm (EHFOA).</p>
</caption>
<graphic xlink:href="fenrg-13-1654803-g008.tif">
<alt-text content-type="machine-generated">Line graph titled &#x22;Fitness Improvement Over Time&#x22; showing best fitness values over iterations. The y-axis represents best fitness values, decreasing from six to zero, and the x-axis represents iterations from zero to one hundred. The red line shows a sharp decline from six to near zero by iteration twenty, stabilizing thereafter.</alt-text>
</graphic>
</fig>
<p>
<xref ref-type="fig" rid="F9">Figure 9</xref> visualizes the fitness reduction over 100 iterations for various optimization algorithms, demonstrating how quickly and effectively each method converges toward an optimal solution. The EHFOA (proposed method) achieves the lowest final fitness value and converges faster than GA, PSO, WOA, and the original HFOA, indicating its superior ability to balance exploration and exploitation in tuning the ANFIS-Transformer model.</p>
<fig id="F9" position="float">
<label>FIGURE 9</label>
<caption>
<p>Convergence behavior of optimization algorithms.</p>
</caption>
<graphic xlink:href="fenrg-13-1654803-g009.tif">
<alt-text content-type="machine-generated">Line graph titled &#x22;Convergence Behavior of Optimization Algorithms&#x22; showing iterations on the x-axis and fitness value on the y-axis. It compares five algorithms: GA, PSO, WOA, HFOA, and EHFOA (proposed), with EHFOA exhibiting a consistently lower fitness value, indicating better performance.</alt-text>
</graphic>
</fig>
<p>This 3D surface plot in <xref ref-type="fig" rid="F10">Figure 10</xref> illustrates the sensitivity of the ANFIS-Transformer model&#x2019;s prediction performance (in terms of RMSE) to changes in two key hyperparameters: the Transformer embedding size and the number of fuzzy rules. As shown, increasing both parameters improves model accuracy, with the lowest RMSE achieved at higher embedding dimensions and more complex fuzzy rule sets. However, the improvement plateaus beyond a certain threshold, suggesting an optimal trade-off between model complexity and performance. The 3D plot in (a) shows how the voltage-forecasting RMSE varies as a function of (1) the Transformer&#x2019;s embedding dimension (e.g., 64, 128, 256) and (2) the number of fuzzy rules in the ANFIS module (3, 5, 7, 9, 11). Lower RMSE values (cooler colors) indicate better predictive accuracy. And The surface in (b) visualizes the ANFIS controller&#x2019;s mapping from error (E) and change in error (CE) to the control output <italic>u</italic> u. It reflects how the combination of Gaussian membership functions and the 3 &#xd7; 3 fuzzy rule base generates real-time corrective actions across the full input range.</p>
<fig id="F10" position="float">
<label>FIGURE 10</label>
<caption>
<p>Impact of transformer embedding dimension and fuzzy-rule count on forecast accuracy and anfis control surface where <bold>(a)</bold> shows the RMSE vs. embedding size and fuzzy rule count and <bold>(b)</bold> shows the ANFIS controller rule surface.</p>
</caption>
<graphic xlink:href="fenrg-13-1654803-g010.tif">
<alt-text content-type="machine-generated">Panel (a) shows a 3D surface plot illustrating the effect of transformer embedding size and the number of fuzzy rules on RMSE, color-coded from yellow to purple. Panel (b) displays an ANFIS controller rule surface represented by a wavy, orange 3D grid with axis labels E and CE.</alt-text>
</graphic>
</fig>
<p>To comprehensively evaluate the performance of the proposed ANFIS-Transformer-EHFOA framework, it is essential to employ robust quantitative metrics that reflect both prediction accuracy and system efficiency. In this study, Root Mean Square Error (RMSE) and Mean Absolute Error (MAE) are utilized as standard statistical indicators to assess the discrepancy between predicted and actual grid parameters (such as frequency or voltage). These metrics provide insight into the controller&#x2019;s precision and reliability under dynamic operating conditions. Additionally, Energy Loss (%) is used to quantify the efficiency of power delivery by calculating the proportion of input energy that is dissipated or unutilized. Collectively, these three metrics offer a multidimensional perspective: RMSE and MAE focus on control accuracy, while Energy Loss highlights economic and operational performance. The inclusion of these metrics ensures a balanced evaluation of both control effectiveness and energy optimization within the smart grid environment. RMSE measures the square root of the average of the squared differences between predicted values and actual values. It is highly sensitive to large errors and thus penalizes larger deviations more severely, making it suitable for evaluating high-precision control systems as shown in <xref ref-type="disp-formula" rid="e20">Equation 20</xref>.<disp-formula id="e20">
<mml:math id="m122">
<mml:mrow>
<mml:mtext>RMSE</mml:mtext>
<mml:mo>&#x3d;</mml:mo>
<mml:msqrt>
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:mfrac>
<mml:mstyle displaystyle="true">
<mml:munderover>
<mml:mo>&#x2211;</mml:mo>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mi>n</mml:mi>
</mml:munderover>
</mml:mstyle>
<mml:mtext>&#x2002;</mml:mtext>
<mml:msup>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi>y</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mover accent="true">
<mml:mi>y</mml:mi>
<mml:mo>&#x5e;</mml:mo>
</mml:mover>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mn>2</mml:mn>
</mml:msup>
</mml:mrow>
</mml:msqrt>
</mml:mrow>
</mml:math>
<label>(20)</label>
</disp-formula>Where:<list list-type="bullet">
<list-item>
<p>
<inline-formula id="inf103">
<mml:math id="m123">
<mml:mrow>
<mml:msub>
<mml:mi>y</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> actual value at instance <inline-formula id="inf104">
<mml:math id="m124">
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>
</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf105">
<mml:math id="m125">
<mml:mrow>
<mml:msub>
<mml:mover accent="true">
<mml:mi>y</mml:mi>
<mml:mo>&#x5e;</mml:mo>
</mml:mover>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> predicted value at instance <inline-formula id="inf106">
<mml:math id="m126">
<mml:mrow>
<mml:mi>i</mml:mi>
</mml:mrow>
</mml:math>
</inline-formula>
</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf107">
<mml:math id="m127">
<mml:mrow>
<mml:mi>n</mml:mi>
<mml:mo>&#x3d;</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> total number of observations</p>
</list-item>
</list>
</p>
<p>MAE computes the average magnitude of the absolute differences between predicted and actual values. Unlike RMSE, it treats all errors equally and is less sensitive to outliers. It is useful for interpreting the average control deviation in simple, interpretable units as shown in <xref ref-type="disp-formula" rid="e21">Equation 21</xref>.<disp-formula id="e21">
<mml:math id="m128">
<mml:mrow>
<mml:mtext>MAE</mml:mtext>
<mml:mo>&#x3d;</mml:mo>
<mml:mfrac>
<mml:mrow>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mrow>
<mml:mi>n</mml:mi>
</mml:mrow>
</mml:mfrac>
<mml:mrow>
<mml:mstyle displaystyle="true">
<mml:munderover>
<mml:mo>&#x2211;</mml:mo>
<mml:mrow>
<mml:mi>i</mml:mi>
<mml:mo>&#x3d;</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
<mml:mi>n</mml:mi>
</mml:munderover>
</mml:mstyle>
<mml:mrow>
<mml:mtext>&#x200a;</mml:mtext>
<mml:mrow>
<mml:mfenced open="|" close="|" separators="&#x7c;">
<mml:mrow>
<mml:msub>
<mml:mi>y</mml:mi>
<mml:mi>i</mml:mi>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mover accent="true">
<mml:mi>y</mml:mi>
<mml:mo>&#x5e;</mml:mo>
</mml:mover>
<mml:mi>i</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:mrow>
</mml:mrow>
</mml:math>
<label>(21)</label>
</disp-formula>
</p>
<p>Energy Loss Percentage evaluates the proportion of energy that is lost in the system during transmission or conversion. It is a crucial indicator of system efficiency and sustainability as shown in <xref ref-type="disp-formula" rid="e22">Equation 22</xref>.<disp-formula id="e22">
<mml:math id="m129">
<mml:mrow>
<mml:mtext>Energy&#x2009;Loss </mml:mtext>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mo>%</mml:mo>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#x3d;</mml:mo>
<mml:mrow>
<mml:mfenced open="(" close=")" separators="&#x7c;">
<mml:mrow>
<mml:mfrac>
<mml:mrow>
<mml:msub>
<mml:mi>E</mml:mi>
<mml:mrow>
<mml:mtext>input</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>&#x2212;</mml:mo>
<mml:msub>
<mml:mi>E</mml:mi>
<mml:mrow>
<mml:mtext>output</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
</mml:mrow>
<mml:msub>
<mml:mi>E</mml:mi>
<mml:mrow>
<mml:mtext>input</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
</mml:mfrac>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
<mml:mo>&#xd7;</mml:mo>
<mml:mn>100</mml:mn>
</mml:mrow>
</mml:math>
<label>(22)</label>
</disp-formula>Where:<list list-type="bullet">
<list-item>
<p>
<inline-formula id="inf108">
<mml:math id="m130">
<mml:mrow>
<mml:msub>
<mml:mi>E</mml:mi>
<mml:mrow>
<mml:mtext>input</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> total energy supplied to the system</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf109">
<mml:math id="m131">
<mml:mrow>
<mml:msub>
<mml:mi>E</mml:mi>
<mml:mrow>
<mml:mtext>output</mml:mtext>
<mml:mtext> </mml:mtext>
</mml:mrow>
</mml:msub>
<mml:mo>&#x3d;</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula> total energy successfully delivered to the load</p>
</list-item>
</list>
</p>
<p>This grouped bar chart in <xref ref-type="fig" rid="F11">Figure 11</xref> compares three key performance metrics&#x2014;RMSE, MAE, and energy loss&#x2014;across four control architectures. The proposed ANFIS-Transformer-EHFOA framework outperforms the others significantly, achieving the lowest error rates and minimizing energy loss. The stepwise improvement from ANFIS-only and Transformer-only models to the hybrid and optimized variant highlights the cumulative benefits of integrating temporal features, fuzzy logic, and the EHFOA metaheuristic. the results provide strong empirical support for the proposed method. The fusion of deep temporal learning (Transformer), adaptive control (ANFIS), and elite metaheuristic tuning (EHFOA) enables high-precision prediction and robust voltage/load balancing. The improvements across all measured dimensions&#x2014;forecasting accuracy, control stability, energy efficiency, and convergence behavior&#x2014;highlight the novelty and utility of this approach in real-world smart grid applications. These outcomes establish the proposed ANFIS-Transformer-EHFOA system as a promising candidate for next-generation AI-enabled energy management and control architectures.</p>
<fig id="F11" position="float">
<label>FIGURE 11</label>
<caption>
<p>Comparison of RMSE, MAE, and energy loss across different models.</p>
</caption>
<graphic xlink:href="fenrg-13-1654803-g011.tif">
<alt-text content-type="machine-generated">Bar chart comparing RMSE, MAE, and energy loss percentages across different models: ANFIS-only, Transformer-only, ANFIS&#x2b;Transformer, and Proposed. The Proposed model shows the lowest energy loss and MAE.</alt-text>
</graphic>
</fig>
<p>
<xref ref-type="fig" rid="F12">Figure 12</xref> illustrates the effect of different uncertainty scenarios&#x2014;load variation, PV fluctuation, and fault injection&#x2014;on the frequency stability of a smart microgrid managed by the ANFIS-EHFOA controller. Under baseline conditions, the frequency remains steady at 50 Hz, confirming stable control. When subject to load variation or PV generation fluctuations, the frequency oscillates within &#xb1;0.03&#x2013;0.05 Hz, showing the controller&#x2019;s ability to dampen mild disturbances. The most challenging scenario is fault injection between 4 and 6 s, where the frequency briefly dips below 49.7 Hz before quickly recovering, demonstrating ANFIS-EHFOA&#x2019;s effective transient handling. The RMSE bar chart in the lower panel quantifies these responses: minimal error under baseline (0.005 Hz), slightly higher under load and PV variability (0.012&#x2013;0.018 Hz), and the highest (0.030 Hz) under fault conditions. Despite these uncertainties, ANFIS-EHFOA maintains frequency deviations within acceptable limits, validating its adaptive and robust performance across real-world scenarios.</p>
<fig id="F12" position="float">
<label>FIGURE 12</label>
<caption>
<p>Comparative performance of ANFIS-EHFOA-transformer vs. PSO, GWO, and deep reinforcement learning-based controllers.</p>
</caption>
<graphic xlink:href="fenrg-13-1654803-g012.tif">
<alt-text content-type="machine-generated">Three bar charts compare four methods: Proposed method, PSO, GWO-IMC, and DRL. The first chart shows Root Mean Square Error (RMSE), with Proposed method having the lowest error. The second chart displays Mean Absolute Error (MAE), again with Proposed method having the least error. The third chart shows Response Time (seconds), with Proposed method having the fastest time. All bars are orange.</alt-text>
</graphic>
</fig>
<p>
<xref ref-type="fig" rid="F12">Figure 12</xref> presents a comparative evaluation of the proposed ANFIS-EHFOA-Transformer-based controller against three prominent optimization and learning-based controllers used in smart grid frequency regulation: Particle Swarm Optimization (PSO) (<xref ref-type="bibr" rid="B31">Tu et al., 2025</xref>), Grey Wolf Optimizer with Internal Model Control (GWO-IMC) (<xref ref-type="bibr" rid="B27">Prabhakar et al., 2024</xref>), and Deep Reinforcement Learning (DRL) (<xref ref-type="bibr" rid="B20">Lee and Kim, 2024</xref>). The proposed method exhibits the lowest RMSE value (0.024), indicating the highest accuracy in predicting and adjusting frequency deviations. DRL follows closely with a value of 0.026, while GWO-IMC and PSO show higher error values (0.029 and 0.031, respectively), reflecting relatively reduced performance under dynamic operating conditions. In terms of MAE, the proposed method again leads with a value of 0.018, demonstrating consistent accuracy in minimizing average deviations. DRL performs competitively (0.019), while GWO-IMC (0.021) and PSO (0.025) trail behind, suggesting that optimization-based controllers may require more fine-tuning for better generalization. A fast response is essential for real-time control. The proposed ANFIS-EHFOA achieves the shortest response time (0.6 s), making it well-suited for real-world smart grid applications requiring immediate stabilization. DRL&#x2019;s performance (0.8 s) is adequate but slower, and both GWO-IMC (1.0 s) and PSO (1.2 s) exhibit significant latency, which could limit their effectiveness during abrupt frequency changes.</p>
<p>
<xref ref-type="fig" rid="F13">Figure 13</xref> presents a digital-style simulation of a photovoltaic (PV) system&#x2019;s response under varying irradiance and load conditions across a 5-s time frame. The top subplot shows the PV output power (Ppv) tracking its corresponding maximum power point (MPP) closely, verifying effective MPPT performance of the proposed controller. The stepwise power shifts reflect changes in irradiance or load that typically occur in real smart grid environments. The second subplot depicts PV current, which mirrors the power transitions while assuming a constant voltage. The third subplot confirms the constant PV voltage set at 25 V, reflecting stable operating conditions during control actions. The final subplot shows corresponding duty cycle adjustments, with discrete changes matching the power and current shifts. These plots validate the digital adaptability and precision of the control mechanism used in the ANFIS-Transformer-EHFOA framework under rapidly changing operating states.</p>
<fig id="F13" position="float">
<label>FIGURE 13</label>
<caption>
<p>Dynamic PV response under varying step load and irradiance conditions.</p>
</caption>
<graphic xlink:href="fenrg-13-1654803-g013.tif">
<alt-text content-type="machine-generated">Four graphs show photovoltaic system data over time. The first graph depicts PV power in watts, with Ppv closely following the MPP. The second graph shows PV current in amperes, fluctuating between six and nine. The third graph illustrates a constant PV voltage at approximately twenty-five volts. The fourth graph presents the duty cycle varying between 0.35 and 0.41. Time on the x-axis spans from zero to five seconds.</alt-text>
</graphic>
</fig>
</sec>
<sec id="s4-2">
<label>4.2</label>
<title>Handling uncertainties in smart grid operation</title>
<p>While the current study confirms ANFIS-EHFOA&#x2019;s strong performance under controlled deterministic conditions, <xref ref-type="fig" rid="F14">Figure 14</xref> shows its response under realistic uncertainty scenarios, including stochastic load variation, PV generation fluctuation, and equipment fault injection. These simulated disturbances induce frequency deviations and raise the RMSE of control accuracy, yet ANFIS-EHFOA maintains bounded performance and rapid recovery. To further strengthen robustness, future work will embed stochastic modeling frameworks such as probabilistic load profiles, solar irradiance-driven PV variability, and Monte Carlo-based random fault injections. These will enable retraining and validation of ANFIS-EHFOA under noisy, fault-prone conditions. Additionally, integrating prediction intervals and confidence-aware droop regulation will allow uncertainty-aware responses. These enhancements are critical for deploying ANFIS-EHFOA in large-scale, real-world smart grids where variability and unpredictability are inherent.</p>
<fig id="F14" position="float">
<label>FIGURE 14</label>
<caption>
<p>Frequency stability and RMSE of ANFIS-EHFOA under uncertainty scenarios.</p>
</caption>
<graphic xlink:href="fenrg-13-1654803-g014.tif">
<alt-text content-type="machine-generated">Two graphs are shown. The top graph depicts frequency over time, with lines representing baseline, load variation, PV fluctuation, and fault injection. A shaded area indicates a fault period from four to six seconds. The bottom bar chart compares RMSE in hertz across different uncertainty scenarios: baseline, load variation, PV fluctuation, and fault injection, with fault injection showing the highest value.</alt-text>
</graphic>
</fig>
</sec>
<sec id="s4-3">
<label>4.3</label>
<title>Limitations</title>
<p>Despite the promising performance and extensive validation of the proposed ANFIS-Transformer framework optimized by EHFOA, several limitations remain that warrant discussion. First, while the Transformer architecture demonstrated strong predictive capabilities, it is computationally intensive and requires substantial memory and processing power during training. This may pose deployment challenges in edge computing environments or low-power embedded systems commonly used in smart grid control units. Although EHFOA reduces the complexity of parameter tuning, the initial overhead of training and optimization remains high, potentially limiting the real-time adaptability of the model when faced with abrupt structural changes in grid topology or load profiles. Another limitation lies in the generalization capability of the model. The framework was trained and validated using a single publicly available dataset representing specific operational characteristics of a smart grid. While this dataset provides realistic load and voltage patterns, it may not capture the full spectrum of variability seen in different geographical regions, seasons, or grid infrastructures. Consequently, the model&#x2019;s effectiveness in other environments remains to be tested. Transferability to unseen domains might require re-tuning or retraining, reducing the plug-and-play appeal of the proposed system. Additionally, the fuzzy inference component in the ANFIS architecture, while interpretable and adaptive, becomes increasingly complex as the number of rules grows. This scalability issue can lead to increased inference time and reduced transparency when deployed in large-scale systems with high-dimensional input features. Although EHFOA helps mitigate rule explosion by optimizing only the most significant parameters, a structured pruning or rule selection strategy may be required to keep the system lightweight and interpretable. Finally, the proposed method currently assumes the availability of accurate and high-resolution data inputs, such as real-time voltage, load, and environmental measurements. In practice, sensor faults, communication delays, or data outages are common in power distribution networks and can significantly impair control accuracy. The current framework does not include mechanisms for fault-tolerant prediction or missing data imputation, which could be vital in practical deployment scenarios. Future extensions should consider integrating robust learning techniques or sensor fusion strategies to address data reliability issues.</p>
</sec>
</sec>
<sec sec-type="conclusion" id="s5">
<label>5</label>
<title>Conclusion</title>
<p>This study introduced a novel hybrid framework that integrates an Adaptive Neuro-Fuzzy Inference System (ANFIS) with a Transformer architecture, optimized by the Enhanced HawkFish Optimization Algorithm (EHFOA), to improve voltage and load balancing in smart grid environments. The primary objective was to harness the temporal feature extraction capabilities of Transformers, the rule-based reasoning of fuzzy logic, and the global optimization ability of EHFOA to address the nonlinear and dynamic challenges of modern grid systems. The experimental results clearly demonstrate the superiority of the proposed system over traditional and hybrid baselines. In terms of prediction accuracy, the ANFIS-Transformer-EHFOA model achieved a Root Mean Square Error (RMSE) of 1.24, a Mean Absolute Error (MAE) of 0.96, and a Mean Absolute Percentage Error (MAPE) of 1.83%, significantly outperforming the standalone ANFIS (RMSE &#x3d; 2.15) and Transformer-only models (RMSE &#x3d; 1.92). Additionally, the proposed method achieved an <italic>R</italic>
<sup>2</sup> score of 0.97, indicating a high degree of correlation between predicted and actual values. Control performance also improved markedly. The Voltage Deviation Index was reduced to 0.0018, energy loss dropped to 1.9%, and the response time to load disturbances decreased to 1.04 s, showcasing the controller&#x2019;s ability to maintain power quality under fluctuating conditions. Compared to the next-best hybrid model without EHFOA, the proposed system reduced energy loss by 39% and improved voltage stability by 57%. From an optimization standpoint, EHFOA delivered the best convergence characteristics among evaluated algorithms (GA, PSO, WOA, HFOA), achieving the lowest final fitness value of 0.0094, the fastest convergence within 58 iterations, and the lowest fitness standard deviation (0.0021), reflecting both effectiveness and reliability in tuning ANFIS-Transformer parameters. Despite these successes, the current system assumes ideal data availability and is computationally intensive, making real-time deployment challenging in low-resource environments. As such, future work will focus on several key directions. First, we aim to incorporate lightweight Transformer variants (e.g., Performer or Linformer) to reduce computational overhead. Second, we will integrate fault-tolerant mechanisms and sensor fusion strategies to ensure robustness under real-world grid uncertainties, including missing or noisy data. Third, the framework will be extended and tested on multi-regional or real-time smart grid datasets, with support for multi-objective optimization, such as incorporating cost, carbon footprint, and power factor stability as additional objectives. Lastly, we plan to explore the incorporation of online learning capabilities to enable dynamic adaptation to changing grid conditions, which will further enhance the scalability and practical utility of the proposed ANFIS-Transformer-EHFOA framework in next-generation energy management systems.</p>
</sec>
</body>
<back>
<sec sec-type="data-availability" id="s6">
<title>Data availability statement</title>
<p>The datasets presented in this study can be found in online repositories. The names of the repository/repositories and accession number(s) can be found in the article/supplementary material.</p>
</sec>
<sec sec-type="ethics-statement" id="s7">
<title>Ethics statement</title>
<p>The studies involving humans were approved by Research Ethics Committee, Faculty of Medicine, Cairo University. The studies were conducted in accordance with the local legislation and institutional requirements. Written informed consent for participation was not required from the participants or the participants&#x2019; legal guardians/next of kin because This study did not involve human subjects.</p>
</sec>
<sec sec-type="author-contributions" id="s8">
<title>Author contributions</title>
<p>OM: Software, Methodology, Data curation, Investigation, Conceptualization, Writing &#x2013; review and editing, Writing &#x2013; original draft, Project administration. SK: Writing &#x2013; original draft, Resources, Funding acquisition, Visualization, Methodology, Formal Analysis, Validation, Software. HF: Visualization, Investigation, Supervision, Funding acquisition, Data curation, Project administration, Writing &#x2013; review and editing, Validation, Writing &#x2013; original draft.</p>
</sec>
<ack>
<title>Acknowledgements</title>
<p>The authors have reviewed and edited the output and take full responsibility for the content of this publication.</p>
</ack>
<sec sec-type="COI-statement" id="s10">
<title>Conflict of interest</title>
<p>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.</p>
</sec>
<sec sec-type="ai-statement" id="s11">
<title>Generative AI statement</title>
<p>The author(s) declare that no Generative AI was used in the creation of this manuscript.</p>
</sec>
<sec sec-type="disclaimer" id="s12">
<title>Publisher&#x2019;s note</title>
<p>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.</p>
</sec>
<fn-group>
<fn fn-type="custom" custom-type="edited-by">
<p>
<bold>Edited by:</bold> <ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/2920387/overview">Antonio Cano Ortega</ext-link>, University of Ja&#xe9;n, Spain</p>
</fn>
<fn fn-type="custom" custom-type="reviewed-by">
<p>
<bold>Reviewed by:</bold> <ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/3118472/overview">Gaber Magdy</ext-link>, Aswan University, Egypt</p>
<p>
<ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/3118622/overview">Venkata Ramana PERAM</ext-link>, Research Scholar, India</p>
</fn>
</fn-group>
<ref-list>
<title>References</title>
<ref id="B1">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Abdollahi Chirani</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Karami</surname>
<given-names>A.</given-names>
</name>
</person-group> (<year>2024</year>). <article-title>Investigation of the impact of SSSC-based FLC on the stability of power systems connected to wind farms</article-title>. <source>Int. Trans. Electr. Energy Syst.</source> <volume>2024</volume>, <fpage>1</fpage>&#x2013;<lpage>24</lpage>. <pub-id pub-id-type="doi">10.1155/2024/1074029</pub-id>
</mixed-citation>
</ref>
<ref id="B2">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Afzal</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Mokhlis</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Lllias</surname>
<given-names>H. A.</given-names>
</name>
<name>
<surname>Mansor</surname>
<given-names>N. N.</given-names>
</name>
<name>
<surname>Shareef</surname>
<given-names>H.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>State-of-the-art review on power system resilience and assessment techniques</article-title>. <source>IET Gener. Transm. Distrib.</source> <volume>14</volume>, <fpage>6107</fpage>&#x2013;<lpage>6121</lpage>. <pub-id pub-id-type="doi">10.1049/iet-gtd.2020.0531</pub-id>
</mixed-citation>
</ref>
<ref id="B3">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Ahmad</surname>
<given-names>N.</given-names>
</name>
<name>
<surname>Ghadi</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Adnan</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Ali</surname>
<given-names>M.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>Load forecasting techniques for power system: research challenges and survey</article-title>. <source>IEEE Access</source> <volume>10</volume>, <fpage>71054</fpage>&#x2013;<lpage>71090</lpage>. <pub-id pub-id-type="doi">10.1109/access.2022.3187839</pub-id>
</mixed-citation>
</ref>
<ref id="B4">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Ahmad</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>Zhu</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Zhang</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Tariq</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Bassam</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Ullah</surname>
<given-names>F.</given-names>
</name>
<etal/>
</person-group> (<year>2022</year>). <article-title>Energetics systems and artificial intelligence: applications of industry 4.0</article-title>. <source>Energy Rep.</source> <volume>8</volume>, <fpage>334</fpage>&#x2013;<lpage>361</lpage>. <pub-id pub-id-type="doi">10.1016/j.egyr.2021.11.256</pub-id>
</mixed-citation>
</ref>
<ref id="B5">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Alkharsan</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Ata</surname>
<given-names>O.</given-names>
</name>
</person-group> (<year>2025</year>). <article-title>HawkFish optimization algorithm: a gender-bending approach for solving complex optimization problems</article-title>. <source>Electronics</source> <volume>14</volume>, <fpage>611</fpage>. <pub-id pub-id-type="doi">10.3390/electronics14030611</pub-id>
</mixed-citation>
</ref>
<ref id="B6">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Andr&#xe9;</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Silva</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Pinto</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Miguens</surname>
<given-names>P.</given-names>
</name>
</person-group> (<year>2023</year>). <article-title>Novel incremental conductance feedback method with integral compensator for maximum power point tracking: a comparison using hardware in the loop</article-title>. <source>Appl. Sci.</source> <volume>13</volume>, <fpage>4082</fpage>. <pub-id pub-id-type="doi">10.3390/app13074082</pub-id>
</mixed-citation>
</ref>
<ref id="B7">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Badran</surname>
<given-names>M. A.</given-names>
</name>
<name>
<surname>Toha</surname>
<given-names>S. F.</given-names>
</name>
</person-group> (<year>2024</year>). <article-title>Employment of artificial intelligence (AI) techniques in battery management system (BMS) for electric vehicles (EV): issues and challenges</article-title>. <source>Pertanika J. Sci. Technol.</source> <volume>32</volume>, <fpage>859</fpage>&#x2013;<lpage>881</lpage>. <pub-id pub-id-type="doi">10.47836/pjst.32.2.20</pub-id>
</mixed-citation>
</ref>
<ref id="B8">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Barman</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Sarkar</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Chowdhury</surname>
<given-names>N.</given-names>
</name>
</person-group> (<year>2024</year>). <article-title>A cooperative Co-evolutionary genetic algorithm for query recommendation</article-title>. <source>Multimed. Tools Appl.</source> <volume>83</volume>, <fpage>11461</fpage>&#x2013;<lpage>11491</lpage>. <pub-id pub-id-type="doi">10.1007/s11042-023-15585-6</pub-id>
</mixed-citation>
</ref>
<ref id="B9">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Basha</surname>
<given-names>C. H.</given-names>
</name>
<name>
<surname>Palati</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Dhanamjayulu</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Muyeen</surname>
<given-names>S. M.</given-names>
</name>
<name>
<surname>Venkatareddy</surname>
<given-names>P.</given-names>
</name>
</person-group> (<year>2024</year>). <article-title>A novel design and implementation of hybrid MPPT controllers for solar PV systems under various partial shading conditions</article-title>. <source>Sci. Rep.</source> <volume>14</volume> (<issue>1609</issue>), <fpage>1</fpage>&#x2013;<lpage>21</lpage>. <pub-id pub-id-type="doi">10.1038/s41598-023-49278-9</pub-id>
<pub-id pub-id-type="pmid">38167627</pub-id>
</mixed-citation>
</ref>
<ref id="B10">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>&#xc7;akmak</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Aydo&#x11f;mu&#x15f;</surname>
<given-names>Z.</given-names>
</name>
<name>
<surname>T&#xfc;r</surname>
<given-names>M. R.</given-names>
</name>
</person-group> (<year>2023</year>). <article-title>Analysis of open circuit voltage MPPT method with analytical analysis with perturb and observe (P&#x26;O) MPPT method in PV systems</article-title>. <source>Electr. Power Compon. Syst.</source> <volume>52</volume>, <fpage>1528</fpage>&#x2013;<lpage>1542</lpage>. <pub-id pub-id-type="doi">10.1080/15325008.2023.2296958</pub-id>
</mixed-citation>
</ref>
<ref id="B11">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Gadupudi</surname>
<given-names>L.</given-names>
</name>
<name>
<surname>Rao</surname>
<given-names>G. S.</given-names>
</name>
<name>
<surname>Narayana Divakar</surname>
<given-names>R. V. L.</given-names>
</name>
<name>
<surname>Malik</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Alsaif</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Alsulamy</surname>
<given-names>S.</given-names>
</name>
<etal/>
</person-group> (<year>2023</year>). <article-title>Fuzzy-based fifteen-level VSC for STATCOM operations with single DC-link voltage</article-title>. <source>Sustainability</source> <volume>15</volume>, <fpage>6188</fpage>. <pub-id pub-id-type="doi">10.3390/su15076188</pub-id>
</mixed-citation>
</ref>
<ref id="B12">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Gao</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Jiang</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Li</surname>
<given-names>Z.</given-names>
</name>
<name>
<surname>Wang</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Liu</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Liu</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>2024</year>). <article-title>A two-stage multi-agent deep reinforcement learning method for urban distribution network reconfiguration considering switch contribution</article-title>. <source>IEEE Trans. Power Syst.</source> <volume>39</volume>, <fpage>7064</fpage>&#x2013;<lpage>7076</lpage>. <pub-id pub-id-type="doi">10.1109/tpwrs.2024.3371093</pub-id>
</mixed-citation>
</ref>
<ref id="B13">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Hasan</surname>
<given-names>M. K.</given-names>
</name>
<name>
<surname>Habib</surname>
<given-names>A. A.</given-names>
</name>
<name>
<surname>Islam</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Balfaqih</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Alfawaz</surname>
<given-names>K. M.</given-names>
</name>
<name>
<surname>Singh</surname>
<given-names>D.</given-names>
</name>
<etal/>
</person-group> (<year>2023</year>). <article-title>Smart grid communication networks for electric vehicles empowering distributed energy generation: constraints, challenges, and recommendations</article-title>. <source>Energies</source> <volume>16</volume>, <fpage>1140</fpage>. <pub-id pub-id-type="doi">10.3390/en16031140</pub-id>
</mixed-citation>
</ref>
<ref id="B14">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Hossain</surname>
<given-names>N. U. I.</given-names>
</name>
<name>
<surname>Nagahi</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Jaradat</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Shah</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Buchanan</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Hamilton</surname>
<given-names>M.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>Modeling and assessing cyber resilience of smart grid using bayesian network-based approach: a system of systems problem</article-title>. <source>J. Comput. Des. Eng.</source> <volume>7</volume>, <fpage>352</fpage>&#x2013;<lpage>366</lpage>. <pub-id pub-id-type="doi">10.1093/jcde/qwaa029</pub-id>
</mixed-citation>
</ref>
<ref id="B15">
<mixed-citation publication-type="book">
<collab>International Energy Agency</collab> (<year>2019</year>). <article-title>Global solar PV market set for spectacular growth over next 5 years: IEA report</article-title>. <source>Bioenergy Int</source>. <comment>Available online at: <ext-link ext-link-type="uri" xlink:href="https://bioenergyinternational.com/global-solar-pv-market-set-for-spectacular-growth-over-next-5-years-iea-report/">https://bioenergyinternational.com/global-solar-pv-market-set-for-spectacular-growth-over-next-5-years-iea-report/</ext-link> (Accessed June 11, 2025).</comment>
</mixed-citation>
</ref>
<ref id="B16">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Iqbal</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Habib</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Khan</surname>
<given-names>N. H.</given-names>
</name>
<name>
<surname>Ali</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Aurangzeb</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Ahmed</surname>
<given-names>E. M.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>Electric vehicles aggregation for frequency control of microgrid under various operation conditions using an optimal coordinated strategy</article-title>. <source>Sustainability</source> <volume>14</volume>, <fpage>3108</fpage>. <pub-id pub-id-type="doi">10.3390/su14053108</pub-id>
</mixed-citation>
</ref>
<ref id="B17">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Islam</surname>
<given-names>B. U.</given-names>
</name>
<name>
<surname>Rasheed</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Ahmed</surname>
<given-names>S. F.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>Review of short-term load forecasting for smart grids using deep neural networks and metaheuristic methods</article-title>. <source>Math. Probl. Eng.</source> <volume>2022</volume>, <fpage>1</fpage>&#x2013;<lpage>14</lpage>. <pub-id pub-id-type="doi">10.1155/2022/4049685</pub-id>
</mixed-citation>
</ref>
<ref id="B18">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Khan</surname>
<given-names>M. R.</given-names>
</name>
<name>
<surname>Haider</surname>
<given-names>Z. M.</given-names>
</name>
<name>
<surname>Malik</surname>
<given-names>F. H.</given-names>
</name>
<name>
<surname>Almasoudi</surname>
<given-names>F. M.</given-names>
</name>
<name>
<surname>Alatawi</surname>
<given-names>K. S. S.</given-names>
</name>
<name>
<surname>Bhutta</surname>
<given-names>M. S.</given-names>
</name>
</person-group> (<year>2024</year>). <article-title>A comprehensive review of microgrid energy management strategies considering electric vehicles, energy storage systems, and AI techniques</article-title>. <source>Processes</source> <volume>12</volume>, <fpage>270</fpage>. <pub-id pub-id-type="doi">10.3390/pr12020270</pub-id>
</mixed-citation>
</ref>
<ref id="B19">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Kumar</surname>
<given-names>A. S.</given-names>
</name>
<name>
<surname>Ramesh</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Arukula</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Parveen</surname>
<given-names>M. A. S.</given-names>
</name>
</person-group> (<year>2024</year>). <article-title>Analyzing PV power systems using MPPT based on artificial neural networks</article-title>. <source>Nanotechnol. Percept.</source> <volume>20</volume>, <fpage>792</fpage>&#x2013;<lpage>797</lpage>.</mixed-citation>
</ref>
<ref id="B20">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Lee</surname>
<given-names>W.-G.</given-names>
</name>
<name>
<surname>Kim</surname>
<given-names>H.</given-names>
</name>
</person-group> (<year>2024</year>). <article-title>Deep reinforcement learning-based dynamic droop control strategy for real-time optimal operation and frequency regulation</article-title>. <source>IEEE Trans. Sustain. Energy</source> <volume>15</volume>, <fpage>284</fpage>&#x2013;<lpage>294</lpage>. <pub-id pub-id-type="doi">10.1109/TSTE.2024.3454298</pub-id>
</mixed-citation>
</ref>
<ref id="B21">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Lin</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Chu</surname>
<given-names>L.</given-names>
</name>
<name>
<surname>Hu</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Hou</surname>
<given-names>Z.</given-names>
</name>
<name>
<surname>Li</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Jiang</surname>
<given-names>J.</given-names>
</name>
<etal/>
</person-group> (<year>2024</year>). <article-title>Progress and summary of reinforcement learning on energy management of MPS-EV</article-title>. <source>Heliyon</source> <volume>10</volume>, <fpage>e23014</fpage>. <pub-id pub-id-type="doi">10.1016/j.heliyon.2023.e23014</pub-id>
<pub-id pub-id-type="pmid">38163106</pub-id>
</mixed-citation>
</ref>
<ref id="B22">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Liu</surname>
<given-names>Z.</given-names>
</name>
<name>
<surname>Guo</surname>
<given-names>Z.</given-names>
</name>
<name>
<surname>Chen</surname>
<given-names>Q.</given-names>
</name>
<name>
<surname>Song</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Shang</surname>
<given-names>W.</given-names>
</name>
<name>
<surname>Yuan</surname>
<given-names>M.</given-names>
</name>
<etal/>
</person-group> (<year>2023</year>). <article-title>A review of data-driven smart building-integrated photovoltaic systems: challenges and objectives</article-title>. <source>Energy</source> <volume>263</volume>, <fpage>126082</fpage>. <pub-id pub-id-type="doi">10.1016/j.energy.2022.126082</pub-id>
</mixed-citation>
</ref>
<ref id="B23">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Liu</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Zheng</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Liu</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Zhu</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Zhao</surname>
<given-names>X.</given-names>
</name>
<name>
<surname>Zhang</surname>
<given-names>M.</given-names>
</name>
</person-group> (<year>2025</year>). <article-title>Short-term load forecasting model based on time series clustering and transformer in smart grid</article-title>. <source>Electronics</source> <volume>14</volume>, <fpage>230</fpage>. <pub-id pub-id-type="doi">10.3390/electronics14020230</pub-id>
</mixed-citation>
</ref>
<ref id="B24">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Maciel</surname>
<given-names>J. N.</given-names>
</name>
<name>
<surname>Ledesma</surname>
<given-names>J. J. G.</given-names>
</name>
<name>
<surname>Ando</surname>
<given-names>O. H.</given-names>
<suffix>Jr.</suffix>
</name>
</person-group> (<year>2024</year>). <article-title>Hybrid prediction method of solar irradiance applied to short-term photovoltaic energy generation</article-title>. <source>Renew. Sustain. Energy Rev.</source> <volume>192</volume>, <fpage>114185</fpage>. <pub-id pub-id-type="doi">10.1016/j.rser.2023.114185</pub-id>
</mixed-citation>
</ref>
<ref id="B25">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Muhamediyeva</surname>
<given-names>D. T.</given-names>
</name>
<name>
<surname>Safarova</surname>
<given-names>L. U.</given-names>
</name>
</person-group> (<year>2024</year>). <article-title>Genetic algorithm for complex optimization of power system mode</article-title>. <source>AIP Conf. Proc.</source> <volume>3154</volume>, <fpage>020042</fpage>. <pub-id pub-id-type="doi">10.1063/5.0201324</pub-id>
</mixed-citation>
</ref>
<ref id="B26">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Per&#xe7;uku</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Minkovska</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Hinov</surname>
<given-names>N.</given-names>
</name>
</person-group> (<year>2025</year>). <article-title>Enhancing electricity load forecasting with machine learning and deep learning</article-title>. <source>Technologies</source> <volume>13</volume>, <fpage>59</fpage>. <pub-id pub-id-type="doi">10.3390/technologies13020059</pub-id>
</mixed-citation>
</ref>
<ref id="B27">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Prabhakar</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Jain</surname>
<given-names>S. K.</given-names>
</name>
<name>
<surname>Padhy</surname>
<given-names>P. K.</given-names>
</name>
</person-group> (<year>2024</year>). <article-title>Virtual inertia control of isolated microgrids using GWO-optimized modified IMC controller</article-title>. <source>Trans. Inst. Meas. Control</source> <volume>47</volume>, <fpage>733</fpage>&#x2013;<lpage>745</lpage>. <pub-id pub-id-type="doi">10.1177/01423312241263134</pub-id>
</mixed-citation>
</ref>
<ref id="B28">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Rani</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Parkash</surname>
<given-names>V.</given-names>
</name>
<name>
<surname>Sharma</surname>
<given-names>N. K.</given-names>
</name>
</person-group> (<year>2024</year>). <article-title>Technological aspects, utilization and impact on power system for distributed generation: a comprehensive survey</article-title>. <source>Renew. Sust. Energ. Rev.</source> <volume>192</volume>, <fpage>114257</fpage>. <pub-id pub-id-type="doi">10.1016/j.rser.2023.114257</pub-id>
</mixed-citation>
</ref>
<ref id="B29">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Saglam</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Lv</surname>
<given-names>X.</given-names>
</name>
<name>
<surname>Spataru</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Karaman</surname>
<given-names>O. A.</given-names>
</name>
</person-group> (<year>2024</year>). <article-title>Instantaneous electricity peak load forecasting using optimization and machine learning</article-title>. <source>Energies</source> <volume>17</volume>, <fpage>777</fpage>. <pub-id pub-id-type="doi">10.3390/en17040777</pub-id>
</mixed-citation>
</ref>
<ref id="B30">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Shejul</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Harikrishnan</surname>
<given-names>R.</given-names>
</name>
</person-group> (<year>2024</year>). <article-title>Energy consumption optimization of chiller plants with the genetic algorithm based GWO and JAYA algorithm in the dynamic pricing demand response</article-title>. <source>Results Eng.</source> <volume>22</volume>, <fpage>102193</fpage>. <pub-id pub-id-type="doi">10.1016/j.rineng.2024.102193</pub-id>
</mixed-citation>
</ref>
<ref id="B31">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Tu</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Xu</surname>
<given-names>X.</given-names>
</name>
<name>
<surname>Gu</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Deng</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Xu</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Zhang</surname>
<given-names>T.</given-names>
</name>
<etal/>
</person-group> (<year>2025</year>). <article-title>Improved droop control strategy for islanded microgrids based on the adaptive weight particle swarm optimization algorithm</article-title>. <source>Electronics</source> <volume>14</volume>, <fpage>893</fpage>. <pub-id pub-id-type="doi">10.3390/electronics14050893</pub-id>
</mixed-citation>
</ref>
<ref id="B32">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Urrea-Aguirre</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Saldarriaga-Zuluaga</surname>
<given-names>S. D.</given-names>
</name>
<name>
<surname>Bustamante-Mesa</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>L&#xf3;pez-Lezama</surname>
<given-names>J. M.</given-names>
</name>
<name>
<surname>Mu&#xf1;oz-Galeano</surname>
<given-names>N.</given-names>
</name>
</person-group> (<year>2024</year>). <article-title>Optimal placement and sizing of modular series static synchronous compensators (M-SSSCs) for enhanced transmission line loadability, loss reduction, and stability improvement</article-title>. <source>Processes</source> <volume>13</volume>, <fpage>34</fpage>. <pub-id pub-id-type="doi">10.3390/pr13010034</pub-id>
</mixed-citation>
</ref>
<ref id="B33">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>van der Meer</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Wang</surname>
<given-names>G. C.</given-names>
</name>
<name>
<surname>Munkhammar</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>2021</year>). <article-title>An alternative optimal strategy for stochastic model predictive control of a residential battery energy management system with solar photovoltaic</article-title>. <source>Appl. Energy</source> <volume>283</volume>, <fpage>116289</fpage>. <pub-id pub-id-type="doi">10.1016/j.apenergy.2020.116289</pub-id>
</mixed-citation>
</ref>
<ref id="B34">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Verbytskyi</surname>
<given-names>I.</given-names>
</name>
<name>
<surname>Lukianov</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Nassereddine</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Pakhaliuk</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Husev</surname>
<given-names>O.</given-names>
</name>
<name>
<surname>Strzelecki</surname>
<given-names>R. M.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>Power converter solutions for industrial PV applications&#x2014;A review</article-title>. <source>Energies</source> <volume>15</volume>, <fpage>3295</fpage>. <pub-id pub-id-type="doi">10.3390/en15093295</pub-id>
</mixed-citation>
</ref>
<ref id="B35">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Wang</surname>
<given-names>L.</given-names>
</name>
<name>
<surname>Littler</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>Liu</surname>
<given-names>X.</given-names>
</name>
</person-group> (<year>2023</year>). <article-title>Hybrid AI model for power transformer assessment using imbalanced DGA datasets</article-title>. <source>IET Renew. Power Gener.</source> <volume>17</volume>, <fpage>1912</fpage>&#x2013;<lpage>1922</lpage>. <pub-id pub-id-type="doi">10.1049/rpg2.12733</pub-id>
</mixed-citation>
</ref>
<ref id="B36">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Xia</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Xu</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Feng</surname>
<given-names>X.</given-names>
</name>
</person-group> (<year>2024</year>). <article-title>Hierarchical coordination of networked-microgrids toward decentralized operation: a safe deep reinforcement learning method</article-title>. <source>IEEE Trans. Sustain. Energy</source> <volume>15</volume>, <fpage>1981</fpage>&#x2013;<lpage>1993</lpage>. <pub-id pub-id-type="doi">10.1109/tste.2024.3390808</pub-id>
</mixed-citation>
</ref>
<ref id="B37">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Zhang</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Jin</surname>
<given-names>X.</given-names>
</name>
<name>
<surname>Shi</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Chew</surname>
<given-names>X. Y.</given-names>
</name>
</person-group> (<year>2023</year>). <article-title>Real-time load forecasting model for the smart grid using bayesian optimized CNN-BiLSTM</article-title>. <source>Front. Energy Res.</source> <volume>11</volume>, <fpage>1</fpage>&#x2013;<lpage>12</lpage>. <pub-id pub-id-type="doi">10.3389/fenrg.2023.1193662</pub-id>
</mixed-citation>
</ref>
<ref id="B38">
<mixed-citation publication-type="book">
<collab>Ziya07</collab> (<year>2024</year>). <source>Smart grid real-time load monitoring dataset</source>. <publisher-name>Kaggle</publisher-name>. <comment>Available online at: <ext-link ext-link-type="uri" xlink:href="https://www.kaggle.com/datasets/ziya07/smart-grid-real-time-load-monitoring-dataset">https://www.kaggle.com/datasets/ziya07/smart-grid-real-time-load-monitoring-dataset</ext-link> (Accessed June 11, 2025)</comment>.</mixed-citation>
</ref>
<ref id="B39">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Zulfiqar</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Kamran</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Rasheed</surname>
<given-names>M. B.</given-names>
</name>
<name>
<surname>Alquthami</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>Milyani</surname>
<given-names>A. H.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>A short-term load forecasting model based on self-adaptive momentum factor and wavelet neural network in smart grid</article-title>. <source>IEEE Access</source> <volume>10</volume>, <fpage>77587</fpage>&#x2013;<lpage>77602</lpage>. <pub-id pub-id-type="doi">10.1109/access.2022.3192433</pub-id>
</mixed-citation>
</ref>
<ref id="B40">
<mixed-citation publication-type="journal">
<person-group person-group-type="author">
<name>
<surname>Zulfiqar</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Kamran</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Rasheed</surname>
<given-names>M. B.</given-names>
</name>
<name>
<surname>Alquthami</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>Milyani</surname>
<given-names>A. H.</given-names>
</name>
</person-group> (<year>2023</year>). <article-title>A hybrid framework for short term load forecasting with a navel feature engineering and adaptive grasshopper optimization in smart grid</article-title>. <source>Appl. Energy</source> <volume>338</volume>, <fpage>120829</fpage>. <pub-id pub-id-type="doi">10.1016/j.apenergy.2023.120829</pub-id>
</mixed-citation>
</ref>
</ref-list>
</back>
</article>