[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-299114-105":59,"doc-detail-299114-en":130,"doc-similar-299114":163},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","automating-modelica-module-generation-using-large-language-models-a-case-study-on-building-control-description-language","Automating Modelica Module Generation Using Large Language Models - A Case Study on Building Control Description Language","","Dynamic energy systems and controls demand advanced modeling frameworks to design and validate supervisory and fault-tolerant strategies. Modelica is widely used as an equation-based language, yet control module development is time-consuming and requires specialized expertise. This study evaluates large language models to automate generating Control Description Language modules in a Building Modelica Library, using a structured prompt workflow, library-aware grounding, compilation with OpenModelica, and human-in-the-loop review. Experiments cover logic and building control modules, highlighting accuracy benefits and current limitations.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":40,"@type":76,"position":81},"https://docshare.wps.com/document/research-report/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/automating-modelica-module-generation-using-large-language-models-a-case-study-on-building-control-description-language/299114/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/automating-modelica-module-generation-using-large-language-models-a-case-study-on-building-control-description-language/299114.png","ImageObject",300,407,{"name":92,"@type":93},"Elsa","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-23","2026-09-18",true,{"@type":102,"interactionType":103,"userInteractionCount":52},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What is the main goal of this research on Modelica module generation?","Question",{"text":112,"@type":113},"To assess whether large language models can automate generating Control Description Language (CDL) modules for the Building Modelica Library, reducing manual effort while maintaining correctness.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"Which logic tasks and control modules are evaluated in the experiments?",{"text":117,"@type":113},"The experiments cover four logic tasks (And, Or, Not, Switch) and five building control modules: chiller enable/disable, bypass valve control, cooling-tower fan speed, plant requests, and relief-damper control.",{"name":119,"@type":110,"acceptedAnswer":120},"How effective are the tested LLMs, and what are their key failure modes?",{"text":121,"@type":113},"Claude-Sonnet-4 reaches up to 100% success on basic logic blocks with engineered prompts, while control modules reach about 83% success. Retrieval-augmented generation often mismatches modules, and GPT-4o fails to produce executable Modelica code in zero-shot mode.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},299114,1790465280,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":39,"category_name":40,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":52,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":144,"read_time":145,"preview_page_count":19,"preview_urls":146},137455077381,"https://ap-avatar.wpscdn.com/davatar_994ba38a5ba835b3df7d355c54d3ed8d","Automating Modelica Module Generation Using Large Language Models: A Case Study on Building Control Description Language  \nHanlong Wana*, Xing Lua, Yan Chena*, Karthik Devaprasada, Laura Hinklea  \na Pacific Northwest National Laboratory, 3335 Innovation Blvd, Richland, WA 99354, USA  \n*Corresponding Author  \nYan Chen ([yan.chen@pnnl.gov](yan.chen@pnnl.gov)), Hanlong Wan ([hanlong.wan@pnnl.gov](hanlong.wan@pnnl.gov))  \nThis research was supported by Battelle Memorial Institute under contract no. DE-AC05-76RL01830 with the U. S. Department of Energy (DOE) . The publisher, by accepting the article for publication, acknowledges that the U. S. government retains a nonexclusive, paid-up, irrevocable, worldwide license to publish or reproduce the published form of this manuscript, or allow others to do so, for U. S. government purposes. DOE will provide public access to these results of federally sponsored research in accordance with the DOE Public Access Plan ([http://energy.gov/downloads/doe-public-access-plan](http://energy.gov/downloads/doe-public-access-plan)).  \nHIGHLIGHTS  \n• Large language models were tested on four logic and five building control module tasks  \n• Claude-Sonnet-4 achieved a 100% success rate on logic blocks with the right prompts  \n• Control module generation achieved an 83% success rate with Claude  \n• Retrieval-augmented generation often failed; hard-rule search ensured correctness  \n• Productivity gains: 40%–60% time savings per module  \nABSTRACT  \nDynamic energy systems and controls require sophisticated modeling frameworks to design and test advanced supervisory and fault-tolerant strategies. Modelica is a widely adopted, equation-based language, but developing control modules remains labor-intensive and requires specialized expertise. This paper investigates the potential of large language models (LLMs) to automate the generation of Control Description Language modules in Building Modelica Library as a case study. We designed a structured workflow that combines standardized prompt scaffolds, library-aware grounding, automated compilation with OpenModelica, and human-in-the-loop evaluation. Experiments were conducted across 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 generate executable Modelica code in zero-shot mode, whereas Claude-Sonnet-4 achieved up to 100% success for basic logic blocks with carefully engineered prompts. For control modules, success rates reached 83%, and failed outputs required medium-level human repair (estimated 1–8 hours). Retrieval-augmented generation introduced frequent mismatches in selecting modules (e.g.,“And” retrieved as “Or”), while a deterministic hard-rule search strategy eliminated these errors. Human evaluation also outperformed AI evaluation, as current LLMs cannot assess simulation results or validate behavioral correctness. Despite these limitations, the LLM-assisted workflow reduced the average development time from 10–20 hours down to 4–6 hours per module, translating to 40%–60% time savings. These findings underscore both the potential and current constraints of LLM-assisted Modelica generation, pointing toward future research in pre-simulation validation, improved grounding, and closedloop evaluation.  \nKeywords:  \nBuilding controls; Modelica; control description language (CDL); large language models; prompt engineering; OpenModelica; vibe-coding  \nNOMENCLATURE  \nABBREVIATIONS  \nAHU  \nAPI  \nASHRAE  \nCDL  \nHVAC  \nLLM  \nMBL  \nRAG  \nOTHER TERMS  \ncooMod  \ndpBui  \nDymola OpenModelica TChi_CHWST  \nTChiSet TDeaBan VChiWat_flow VChiWatSet_flow yValPos TCWSupSet  \nTCWSup  \nTCHWSupSet  \nTCHWSupy TAirSup  \nTAirSupSet uChiWatPum  \nuCooCoi u1SupFanyChiWatResReq  \nyChiPlaReq yRelDam  \nair handling unit  \napplication programming interface  \nAmerican Society of Heating, Refrigera","cbCairT4dMYsWUSE","https://ap.wps.com/l/cbCairT4dMYsWUSE","pdf",1255192,28,"English","# Highlights\n# Abstract\n# Nomenclature\n# 1 Introduction\n## Background on dynamic energy systems and controls","[{\"question\":\"What is the main goal of this research on Modelica module generation?\",\"answer\":\"To assess whether large language models can automate generating Control Description Language (CDL) modules for the Building Modelica Library, reducing manual effort while maintaining correctness.\"},{\"question\":\"Which logic tasks and control modules are evaluated in the experiments?\",\"answer\":\"The experiments cover four logic tasks (And, Or, Not, Switch) and five building control modules: chiller enable/disable, bypass valve control, cooling-tower fan speed, plant requests, and relief-damper control.\"},{\"question\":\"How effective are the tested LLMs, and what are their key failure modes?\",\"answer\":\"Claude-Sonnet-4 reaches up to 100% success on basic logic blocks with engineered prompts, while control modules reach about 83% success. Retrieval-augmented generation often mismatches modules, and GPT-4o fails to produce executable Modelica code in zero-shot mode.\"}]","Automating Modelica Module Generation Using Large Language Models - A Case Study on Building Control Description Language | PDF",1789767139,71,[147,151,155,159],{"page_no":8,"url":148,"width":149,"height":150},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/15923b8c43bed41e5aa7de6e91c9801d.webp",983,1272,{"page_no":14,"url":152,"width":153,"height":154},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/a2f8eb65478e848f28e8d4ccf3b1ce4e.webp",982,1270,{"page_no":81,"url":156,"width":157,"height":158},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/24a8159794d4cacd74c446717ee8a456.webp",981,1269,{"page_no":19,"url":160,"width":161,"height":162},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/10994d41f43e02ccb2725d00cae15c8b.webp",980,1268,{"list":164,"token":66},[165,171,177,184,190,197,203,210,216,222],{"doc_id":166,"doc_title":167,"file_type":137,"home_preview_img_url":168,"slug":169,"view_count":41,"category_name":40,"create_tm":170},86516,"Model-Free Detection and Accommodation of Sensor Faults for a PEM Electrolyzer","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229809424473/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109839&Signature=bLK8bCnSC8oyF%2FO6QAkOPxYKdRQ%3D","model-free-detection-and-accommodation-of-sensor-faults-for-a-pem-electrolyzer",1784212325,{"doc_id":172,"doc_title":173,"file_type":137,"home_preview_img_url":174,"slug":175,"view_count":56,"category_name":40,"create_tm":176},463995,"Active Compensation Fault-Tolerant Control for Uncertain Systems with Both Actuator and Sensor Faults","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229926182782/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109839&Signature=P3Ge8YoFQYjqg6BjltB%2FZsGb3kE%3D","active-compensation-fault-tolerant-control-for-uncertain-systems-with-both-actuator-and-sensor-faults",1790767506,{"doc_id":178,"doc_title":179,"file_type":137,"home_preview_img_url":180,"slug":181,"view_count":182,"category_name":40,"create_tm":183},273848,"Free-Text Evaluation of LLMs for 5G Domain Knowledge and Fault Analysis using LLM-as-Judge","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229899969138/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109839&Signature=AEE6W%2FZ%2FMt6IF7tc7q30i2jhCUU%3D","free-text-evaluation-of-llms-for-5g-domain-knowledge-and-fault-analysis-using-llm-as-judge",21,1789472979,{"doc_id":185,"doc_title":186,"file_type":137,"home_preview_img_url":187,"slug":188,"view_count":44,"category_name":40,"create_tm":189},367601,"Simulation of Electromagnetic Transients with Modelica - Accuracy and Performance Assessment for Transmission Line Models","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229913629475/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109839&Signature=OKlOSGvjsCx514IC24uy9Wu7eVA%3D","simulation-of-electromagnetic-transients-with-modelica-accuracy-and-performance-assessment-for-transmission-line-models",1790171590,{"doc_id":191,"doc_title":192,"file_type":137,"home_preview_img_url":193,"slug":194,"view_count":195,"category_name":40,"create_tm":196},501184,"Software Fault Tolerance - INF-25-Ma-FSC-SFT","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229931329193/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109839&Signature=o9I8%2BpVyNUCOgN9RySSguVQ6tf4%3D","software-fault-tolerance-inf-25-ma-fsc-sft",13,1791017758,{"doc_id":198,"doc_title":199,"file_type":137,"home_preview_img_url":200,"slug":201,"view_count":56,"category_name":40,"create_tm":202},464025,"Hierarchical Fuzzy Adaptive Observer-Based Fault-Tolerant Consensus Tracking for High-Order Nonlinear Multi-Agent Systems Under Actuator and Sensor Faults","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229926183662/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109839&Signature=fB4OJ32JtqpKSRxQJD2u%2BQizPjE%3D","hierarchical-fuzzy-adaptive-observer-based-fault-tolerant-consensus-tracking-for-high-order-nonlinear-multi-agent-systems-under-actuator-and-sensor-faults",1790767554,{"doc_id":204,"doc_title":205,"file_type":137,"home_preview_img_url":206,"slug":207,"view_count":208,"category_name":40,"create_tm":209},119072,"A Review on Condition Monitoring of Wind Turbines Using Machine Learning Techniques","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229835004763/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109839&Signature=Ai0BuiTiDEpAllEI5Vj%2FsfJp06w%3D","a-review-on-condition-monitoring-of-wind-turbines-using-machine-learning-techniques",31,1785722187,{"doc_id":211,"doc_title":212,"file_type":137,"home_preview_img_url":213,"slug":214,"view_count":195,"category_name":40,"create_tm":215},327458,"Grounded autonomous research - a fault-tolerant LLM pipeline from corpus to manuscript in frontier computational physics","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229909324547/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109839&Signature=Eppk9bH8d6hMw%2BsiMDonb88PNB8%3D","grounded-autonomous-research-a-fault-tolerant-llm-pipeline-from-corpus-to-manuscript-in-frontier-computational-physics",1789977247,{"doc_id":217,"doc_title":218,"file_type":137,"home_preview_img_url":219,"slug":220,"view_count":39,"category_name":40,"create_tm":221},568908,"A Comprehensive Management Information Digest for the Computer Industry - Vol.22 No.14 - July 27, 1981","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229949327027/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109839&Signature=oE4%2B7l3SBGVkD0rbb6UB4ih2c%2Bo%3D","a-comprehensive-management-information-digest-for-the-computer-industry-vol22-no14-july-27-1981",1791872971,{"doc_id":223,"doc_title":224,"file_type":137,"home_preview_img_url":225,"slug":226,"view_count":227,"category_name":40,"create_tm":228},441253,"Double event-triggered fault tolerant consensus of nonlinear heterogeneous multiagent systems under inconsistent Markov","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229924293214/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109839&Signature=ZrnCsRtHwTVeGIxW3DwAqqq6Irc%3D","double-event-triggered-fault-tolerant-consensus-of-nonlinear-heterogeneous-multiagent-systems-under-inconsistent-markov",16,1790695335]