Agentic Application in Power Grid Static Analysis: Automatic Code Generation and Error Correction
Qinjuan Wang, Shan Yang, Yongli Zhu

TL;DR
This paper presents an LLM-based system that automates power grid analysis by generating and debugging MATLAB code from natural language, achieving high accuracy and reliability.
Contribution
It introduces a novel framework combining LLMs, OCR, and multi-tier error correction for automated power grid static analysis.
Findings
Achieves 82.38% code fidelity accuracy.
Effectively eliminates hallucinations in code generation.
Enables asynchronous debugging and validation in MATLAB.
Abstract
This paper introduces an LLM agent that automates power grid static analysis by converting natural language into MATPOWER scripts. The framework utilizes DeepSeek-OCR to build an enhanced vector database from MATPOWER manuals. To ensure reliability, it devises a three-tier error-correction system: a static pre-check, a dynamic feedback loop, and a semantic validator. Operating via the Model Context Protocol, the tool enables asynchronous execution and automatically debugging in MATLAB. Experimental results demonstrate that the system achieves a 82.38% accuracy regarding the code fidelity, effectively eliminating hallucinations even in complex analysis tasks.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
