Search papers, labs, and topics across Lattice.
This study showcases a collaborative workflow where the large language model Claude was utilized to translate and optimize a nonlinear finite element analysis (FEA) program from a 2015 publication into Python. By employing iterative prompt engineering and a domain-specific skill document, Claude not only reimplemented the program but also identified and resolved six performance bottlenecks, achieving a 154-fold reduction in computation time. Verification against established benchmarks confirmed the accuracy of the results, matching closed-form solutions to four decimal places without the need for parameter tuning, highlighting the potential of AI in scientific software development.
A domain-expert-guided AI collaboration can transform a complex scientific program into a highly efficient, verified implementation with remarkable speed and accuracy.
This paper presents a structured human-AI collaborative workflow for developing verified scientific software from a published research paper. The large language model Claude (Anthropic) was guided by the author to translate, reimplement, and optimise a nonlinear finite element analysis (FEA) program originally published in 2015. The original program implemented a Combined Corotational-Total Lagrangian (CR-TL) formulation for large-displacement 2D beam structures in Microsoft Excel VBA. Using a domain-specific skill document and iterative prompt engineering, Claude generated an equivalent Python implementation. It subsequently identified six performance bottlenecks. The optimised implementation replaces dense matrix operations with sparse assembly, eliminates the Python element loop through vectorised NumPy einsum operations, and applies boundary conditions via a large-penalty method. Verification against NAFEMS benchmark tests NLGB2 and NLGB4 shows results matching closed-form solutions to four decimal places, with no parameter tuning or calibration. A 154-fold reduction in computation time at 1000 elements enables models with up to 5000 elements on a standard laptop. Three categories of LLM error are identified and characterised. The work demonstrates that domain-expertguided AI collaboration can produce verified, production-quality scientific software from published numerical formulations.