**6. Conclusions**

The optimal and coordinated performance of a STATCOM and microgrid using LSTM– genetic algorithm has been evaluated in this article using simulation methods under normal and abnormal operating conditions. Both the AC and DC voltage gains of the STATCOM were optimized using LSTM–GA. It was observed that when carefully tuning the parameters, the DC offset for the LSTM–GA STATCOM was reduced significantly to 0.07%, compared to 0.21%, and it also avoids SSR to an extent of 17%.

The harmonic and inter-harmonic components using the LSTM–GA methodology reduce the burden on the transmission line and thereby reduce the overheating of the conductor in a microgrid system under load variation conditions. In order to maintain a proper system balance with respect to the IEC and IEEE standards, the notching level of the broad band range has been maintained. During time-domain analysis, the proposed LSTM– PI–GA model shows a shorter settling time as compared to the other two benchmarking models under the step-changing mode of operation.

The optimized STATCOM device has been presented as a dependable solution to improve the stability of microgrid systems, regardless of whether they are functioning normally or abnormally. This device is capable of suppressing transient oscillations in power and frequency while managing voltage fluctuations caused by external disturbances or changes in load demand. Overall, the STATCOM is a highly effective resource in ensuring the consistent and stable performance of microgrid systems.

**Author Contributions:** Conceptualization, D.S.; Methodology, D.S.; Software, D.S. and K.J.R.; Validation, M.V., K.J.R., A.G. and M.R.; Formal analysis, D.S., M.V., R.D., K.J.R., A.G., B.K. and M.R.; Investigation, D.S., M.V., R.D., K.J.R. and D.C.; Resources, K.J.R., D.C., A.G., B.K. and M.R.; Data curation, D.S., M.V., R.D., K.J.R., A.G. and B.K.; Writing—original draft, D.S., R.D., D.C. and B.K.; Writing—review & editing, D.S., M.V., R.D., K.J.R., D.C. and M.R.; Visualization, D.C., A.G. and B.K.; Supervision, D.C.; Project administration, D.C.; Funding acquisition, B.K. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Data will be available on request.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**


**Disclaimer/Publisher's Note:** The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
