🤖 AI Summary
This study addresses the challenge of adapting pre-trained large language models (LLMs) into domain-specific virtual assistants for physics-based simulation. Focusing on PyChrono—a multi-body dynamics simulation framework—we propose the first systematic framework unifying adaptation strategies for both open- and closed-weight LLMs, enabling robust generation of simulation scripts across scenarios ranging from simple pendulums to complex vehicle–terrain interactions. Our methodology integrates instruction fine-tuning, domain-specific data augmentation, explicit injection of PyChrono API knowledge, and a quantitative evaluation protocol grounded in executable correctness and functional accuracy. Empirical results demonstrate substantial improvements over baseline LLMs: generated scripts exhibit markedly higher runtime validity and physical fidelity; the assistant reliably answers API queries, recommends appropriate modeling strategies, and delivers production-ready script templates for expert users. Collectively, this work lowers the entry barrier for cross-domain physics simulation tools while advancing the principled integration of LLMs into scientific computing workflows.
📝 Abstract
This contribution is concerned with the following issue: can pretrained large language models (LLMs) be refined and customized to the point where they become virtual assistants helping experts with the effective use of a simulation tool? In this case study, the ``simulation tool'' considered is PyChrono, an open source multi-physics dynamics engine for multibody systems. We present a framework for refining and customizing both open- and closed-source LLMs to harness the power of AI in generating scripts that perform PyChrono virtual experiments. We refine and customize several classes of LLMs through a process that leads to a quantifiable improvement in the quality of the generated PyChrono simulation scripts. These scripts can range from simple single-pendulum simulations to complex virtual experiments involving full vehicles on deformable terrain. While the generated scripts are rarely perfect, they often serve as strong starting points for the user to modify and improve on. Additionally, the LLM can answer specific API questions about the simulator, or recommend modeling approaches. The framework discussed is general and can be applied to lower the entry barrier for simulation tools associated with other application domains.