Automating Modelica Module Generation Using Large Language Models: A Case Study on Building Control Description Language
Not on the map. Why?
Abstract (arXiv)
Dynamic energy systems and controls require advanced modeling frameworks to design and test supervisory and fault tolerant strategies. Modelica is a widely used equation based language, but developing control modules is labor intensive and requires specialized expertise. This paper examines the use of large language models (LLMs) to automate the generation of Control Description Language modules in the Building Modelica Library as a case study. We developed a structured workflow that combines standardized prompt scaffolds, library aware grounding, automated compilation with OpenModelica, and human in the loop evaluation. Experiments were carried out on four basic logic tasks (And, Or, Not, and Switch) and five control modules (chiller enable/disable, bypass valve control, cooling tower fan speed, plant requests, and relief damper control). The results showed that GPT 4o failed to produce executable Modelica code in zero shot mode, while Claude Sonnet 4 achieved up to full success for basic logic blocks with carefully engineered prompts. For control modules, success rates reached 83 percent, and failed outputs required medium level human repair (estimated one to eight hours). Retrieval augmented generation often produced mismatches in module selection (for example, And retrieved as Or), while a deterministic hard rule search strategy avoided these errors. Human evaluation also outperformed AI evaluation, since current LLMs cannot assess simulation results or validate behavioral correctness. Despite these limitations, the LLM assisted workflow reduced the average development time from 10 to 20 hours down to 4 to 6 hours per module, corresponding to 40 to 60 percent time savings. These results highlight both the potential and current limitations of LLM assisted Modelica generation, and point to future research in pre simulation validation, stronger grounding, and closed loop evaluation.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 5 of its 14 references that are in the map. First posted on arXiv 18 Sep 2025.
Builds on
5 of 14 references.
References · 5
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2025Text2Model: Generating dynamic chemical reactor models using large language models (LLMs)cited by 5
- 2025ModiGen: A Large Language Model-Based Workflow for Multi-Task Modelica Code Generationcited by 4
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2023Opportunities and Challenges of Applying Large Language Models in Building Energy Efficiency and Decarbonization Studies: An Exploratory Overview
- 2026Large Language Models for HVAC Operations in Building Energy Systems: A Critical Review of Methods, Applications, and Deployment Readiness
- 2023ChatGPT for PLC/DCS Control Logic Generation
- 2024Capabilities of Large Language Models in Control Engineering: A Benchmark Study on GPT-4, Claude 3 Opus, and Gemini 1.0 Ultra
- 2025Benchmark for Planning and Control with Large Language Model Agents: Blocksworld with Model Context Protocol
- 2024Agents4PLC: Automating Closed-loop PLC Code Generation and Verification in Industrial Control Systems using LLM-based Agents
- 2024MCCoder: Streamlining Motion Control with LLM-Assisted Code Generation and Rigorous Verification
- 2026Rethinking Scientific Modeling: Toward Physically Consistent and Simulation-Executable Programmatic Generation