%D 2025 %V 15 %K Power systems; Smart grid; Hardware-in-the-loop systems %X The increasing complexity of modern power systems requires engineers to design, build, and test equipment with a high degree of accuracy. The demand for precise equipment design, testing, and evaluation has reached extraordinary levels within modern power systems. To meet this challenge, engineers rely heavily on real-time simulators, which are essential tools for assessing power network dynamics. This study introduces a novel approach, an adaptable and cost-effective simulator, poised to revolutionize traditional hardware-in-the-loop (HIL) systems. Leveraging field-programmable gate arrays (FPGAs) and a comprehensive implementation of Heun and Piecewise analytic methods (PAM), provided simulator offers unparalleled capabilities for embedded real-time simulation of smart grids, ensuring swift and accurate measurements. Augmented by Python-based process simulation and integrated with industry-standard tools like Modelica and MATLAB, the proposed system promises versatility and efficiency. Through comprehensive testing, including rigorous evaluations of excitation system responses to diverse scenarios such as voltage set-point variations, automatic voltage regulator step responses, and fault conditions, we demonstrate the simulator’s robustness and precision. Experimental findings underscore its potential as an effective alternative to conventional HIL systems, marking a significant advancement in smart grid simulation technology. %T Enhanced FPGA-based smart power grid simulation using Heun and Piecewise analytic method %L unic17859 %A Urfa Gul %A Hafiz Muhammad Raza Ur Rehman %A Muhammad Junaid Gul %A Gerardo Méndez Mezquita %A Alina Eugenia Pascual Barrera %A Imran Ashraf %J Scientific Reports %N 1 %R doi:10.1038/s41598-025-18105-8