Multi-Step Prediction and Optimization of Harmonic Power Quality in Active Distribution Network of Urban Energy Internet Driven by PatchTST
Main Article Content
Abstract
The integration of high-density distributed energy, complex loads, and multi-energy flows in urban energy internets complicates the dynamic uncertainty of harmonic evolution, driven by high-frequency fluctuations from distributed energy sources and sudden load switching in industrial processes. To address the resulting inaccurate harmonic power quality prediction and optimization in active distribution networks, this paper proposes a multi-step prediction and collaborative optimization method based on PatchTST. The method enhances complex time series modeling via a localglobal feature fusion mechanism. It extracts local temporal characteristics of harmonic distortion using local time block coding, and mines long-range dependencies between multi-channel variables using a global self-attention network. This achieves multi-step prediction of the total harmonic distortion rate (THD) and individual harmonic components. The study then constructs a physical-information-embedded collaborative control model, combining prediction results with dynamic adjustment of inverter reactive compensation and optimization of energy storage strategies to form a closedloop control. Experiments show the PatchTST-based method achieves low MAE for THD multi-step prediction (0.077/0.119/0.140 for 12/24/48 steps), reduced active power loss (13.62kW), fast voltage deviation recovery (2.2–5s), and low control failure (1.2%). Physical constraint embedding improves optimization feasibility to 93.5% and limits SOC violations to 6. This research offers an integrated solution for complex power quality issues through the deep integration of deep learning and power electronic control, providing a framework directly applicable to improving the stable and reliable power supply required for continuous, high-quality production in the textile industry.
Downloads
Article Details

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).
References
D. Razmi, T. Lu, B. Papari, E. Akbari, G. Fathi, and M. Ghadamyari, “An overview on power quality issues and control strategies for distribution networks with the presence of distributed generation resources,” IEEE Access, vol. 11, pp. 10308-10325, 2023, doi: 10.1109/ACCESS.2023.3238685.
S. Fahad, A. Goudarzi, Y. Li, and J. Xiang, “A coordination control strategy for power quality enhancement of an active distribution network,” Energy Reports, vol. 8, pp. 5455-5471, 2022, doi: 10.1016/j.egyr.2022.04.014.
P. K. Verma and G. Goswami, “Mitigation of power quality issues in smart grids using shunt active power filter,” Water and Energy International, vol. 66, no. 12, pp. 42-48, 2024.
E. Tweve, B. Kichonge, and T. Kivevele, “Impacts of Nonlinear Loads on the Power Quality of Solar Microgrids and Proposed Mitigation Strategies,” Energy Science & Engineering, vol. 13, no. 4, pp. 1960-1982, 2025, doi: 10.1002/ese3.70019.
Y. Zhu, J. Wei, B. Wang, S. Hong, Y. Liu, and L. Lu, “Optimal robust sizing of distributed energy storage considering power quality management,” IET Renewable Power Generation, vol. 18, no. 16, pp. 3825-3838, 2024, doi: 10.1049/rpg2.13062.
S. Chapala, R. L. Narasimham, and G. T. R. Das, “Power Quality Analysis of ANFIS Based Distributed Generation System with UPQC,” International Journal of Engineering and Manufacturing (IJEM), vol. 14, no. 4, pp. 1-14, 2024, doi: 10.5815/ijem.2024.04.01.
Z. M. Ali, M. Ćalasan, F. Jurado, and S. H. E. A. Aleem, “Complexities of power quality and harmonic-induced overheating in modern power grids studies: Challenges and solutions,” IEEE Access, vol. 12, pp. 151554-151597, 2024, doi: 10.1109/ACCESS.2024.3477729.
T. Kale, D. Pagdhare, H. Karadkar, C. Sivalingam, and N. Bhitre, “A Review of Power Quality Measurement and Harmonic Distortion Reduction,” International Research Journal of Modernization in Engineering Technology and Science, vol. 6, no. 3, pp. 1429-1433, 2024, [Online]. Available: https://www.doi.org/10.56726/IRJMETS50389.
T. D. Makanju, T. Shongwe, and O. J. Famoriji, “Machine Learning Approaches for Power System Parameters Prediction: A Systematic Review,” IEEe Access, vol. 12, pp. 66646-66679, 2024, doi: 10.1109/ACCESS.2024.3397676.
S. Sahoo, S. C. Swain, R. Dash, and P. Samal, “Forecasting Tariff Rates and Enhancing Power Quality in Microgrids: The Synergistic Role of LSTM and UPQC,” Engineering, Technology & Applied Science Research, vol. 14, no. 1, pp. 12506-12511, 2024, doi: 10.48084/etasr.6481.
M. S. Priyadarshini, M. Bajaj, L. Prokop, and M. Berhanu, “Perception of power quality disturbances using Fourier, Short-Time Fourier, continuous and discrete wavelet transforms,” Scientific Reports, vol. 14, no. 1, pp. 3443-3482, 2024, doi: 10.1038/s41598-024-53792-9.
Y. Niu, T. Yang, F. Yang, X. Feng, P. Zhang, and W. Li, “Harmonic analysis in distributed power system based on IoT and dynamic compressed sensing,” Energy Reports, vol. 8, pp. 2363-2375, 2022, doi: 10.1016/j.egyr.2022.01.119.
X. Wang, S. Wang, J. Ren, W. Jing, M. Shi, and X. Zheng, “A Novel Harmonic Detection Method for Microgrids Based on Variational Mode Decomposition and Improved Harris Hawks Optimization Algorithm,” IEEE Access, vol. 12, pp. 60797-60807, 2024, doi: 10.1109/ACCESS.2024.3394931.
A. C. R. Klaar, L. O. Seman, V. C. Mariani, and L. S. Coelho, “Random convolutional kernel transform with empirical mode decomposition for classification of insulators from power grid,” Sensors, vol. 24, no. 4, pp. 1113-1137, 2024, doi: 10.3390/s24041113.
P. Makolo, F. Mwasilu, R. Zamora, et al., “Long-Range Inertia Prediction Considering Contemporary Evolution of Power Grid Networks,” Tanzania Journal of Engineering and Technology, vol. 43, no. 4, pp. 1-21, 2024, [Online]. Available: https://www.ajol.info/index.php/tjet/article/view/291859.
R. P. Permata and D. D. Prastyo, “Hybrid dynamic harmonic regression with calendar variation for Turkey shortterm electricity load forecasting,” Procedia Computer Science, vol. 197, pp. 25-33, 2022, doi: 10.1016/j.procs.2021.12.114.
O. A. Elkashaty, A. A. Daoud, and E. E. Elaraby, “Forecasting of short-term and long-term wind speed of ras gharib using time series analysis,” International Journal of Renewable Energy Research (IJRER), vol. 13, no. 1, pp. 258-272, 2023, doi: 10.20508/ijrer.v13i1.13785.g8680.
A. Saxena, A. M. Alshamrani, A. F. Alrasheedi, K. A. Alnowibet, and A. W. Mohamed, “A hybrid approach based on principal component analysis for power quality event classification using support vector machines,” Mathematics, vol. 10, no. 15, pp. 2780-2796, 2022, doi: 10.3390/math10152780.
P. Venkata, V. Pandya, K. Vala, and A. V. Santl, “Support vector machine for fast fault detection and classification in modern power systems using quarter cycle data,” Energy Reports, vol. 8, pp. 92-98, 2022, doi: 10.1016/j.egyr.2022.10.279.
V. Hoffmann, B. N. Torsæter, G. H. Rosenlund, and C. A. Andresen, “Lessons for Data-Driven Modelling from Harmonics in the Norwegian Grid,” Algorithms, vol. 15, no. 6, pp. 188-207, 2022, doi: 10.3390/a15060188.
S. Mishra, K. Mallick R, A. Gadanayak D, P. Nayak, A. Flah, C. Z. El-Bayeh, et al., “Islanding detection and power quality diagnosis of wind power integrated microgrid with reduced feature trained novel optimized random decision Forest,” International Journal of Energy Research, vol. 2024, no. 1, pp. 5198814-5198834, 2024, doi: 10.1155/2024/5198814.
F. M. Al Hadi, H. H. Aly, and T. Little, “Harmonics forecasting of wind and solar hybrid model based on deep machine learning,” IEEE Access, vol. 11, pp. 100438-100457, 2023, doi: 10.1109/ACCESS.2023.3314742.
A. Taghvaie, T. Warnakulasuriya, D. Kumar, F. Zare, R. Sharma, and D. M. Vilathgamuwa, “A comprehensive review of harmonic issues and estimation techniques in power system networks based on traditional and artificial intelligence/machine learning,” Ieee Access, vol. 11, pp. 31417-31442, 2023, doi: 10.1109/ACCESS.2023.3260768.
Y. Chu, S. Hou, C. Wang, and J. Fei, “Recurrent-neural-network-based fractional order sliding mode control for harmonic suppression of power grid,” IEEE Transactions on Industrial Informatics, vol. 19, no. 10, pp. 9979-9990, 2023, doi: 10.1109/TII.2023.3234305.
Z. Dawood and C. K. Babulal, “Red deer optimized recurrent neural network for the classification of power quality disturbance,” Electrical Engineering, vol. 105, no. 4, pp. 1937-1953, 2023, doi: 10.1007/s00202-022-01701-6.
E. M. Kuyumani, A. N. Hasan, and T. Shongwe, “A hybrid model based on CNN-LSTM to detect and forecast harmonics: A case study of an Eskom substation in South Africa,” Electric Power Components and Systems, vol. 51, no. 8, pp. 746-760, 2023, doi: 10.1080/15325008.2023.2181883.
L. Flores-Garrido J, P. Salmer, A. Gomez-Galan J, and A. Pérez-Vallés, “Deep Learning-Based Control of Active Power Filters Using LSTM and GRU Networks for Harmonic and Frequency Estimation,” IEEE Access, vol. 13, pp. 75332-75350, 2025, doi: 10.1109/ACCESS.2025.3564636.
T. Yunxue, S. Shuo, Z. Haonian, X. Shibiao, Y. Yuming, and Ming Z et al, “Identification of Intensive Oscillation Parameters of Power System Based on CS-CNN-GRU Network,” Electric Power Components and Systems, pp.:1-11, 2024, doi: 10.1080/15325008.2024.2307396.
J. Cai, K. Zhang, and H. Jiang, “Power quality disturbance classification based on parallel fusion of CNN and GRU,” Energies, vol. 16, no. 10, pp. 4029-4041, 2023, doi: 10.3390/en16104029.
H. Xiao, X. He, and C. Li, “Multi-step prediction of offshore wind power based on Transformer network and Huber loss,” International Journal of Electrical Power & Energy Systems, vol. 162, pp. 110229-110244, 2024, doi: 10.1016/j.ijepes.2024.110229.
J. Moon, “A Multi-Step-Ahead Photovoltaic Power Forecasting Approach Using One-Dimensional Convolutional Neural Networks and Transformer,” Electronics, vol. 13, no. 11, pp. 2007-2024, 2024, doi: 10.3390/electronics13112007.
Q. Fang, X. Liang, S. Li, J. Zhang, X. Yang, and Z. Guo, “A Novel Multi-Step Short-Term Power Forecasting Model for Electric Power Systems Based on Deep-Learning,” IEEE Transactions on Power Systems, pp.:1-13, 2025, doi: 10.1109/TPWRS.2025.3556129.
Z. Rao, J. Wu, G. Li, and H. Wang, “Voltage abnormity prediction method of lithium-ion energy storage power station using informer based on bayesian optimization,” Scientific Reports, vol. 14, no. 1, pp. 21404-21421, 2024, doi: 10.1038/s41598-024-72510-z.