College Physics ›› 2026, Vol. 45 ›› Issue (08): 102-.doi: 10.16854/j.cnki.1000-0712.250493

Previous Articles     Next Articles

Research on methods for developing portable and interactive computational #br# physics programs based on AI-enabled programming skills#br#

LIN Hui, QIUHuaili, YU Tongpo,Wei Zewen, Liu Haotian,Zhou Lin,LI Zhongjun*#br# #br#   

  1. School of Physics, Hefei University of Technology, Hefei, Anhui 230009, China
  • Received:2025-09-07 Accepted:2025-09-20 Online:2026-10-10 Published:2026-10-20

Abstract: The implementation of algorithmic code is a key link in translating the theories of the “Computational Physics” course into practice. However, due to the evolution of programming languages over time, there is a problem of poor interoperability among the codes in various textbooks. This work, based on Tencent Yuanbao large model equipped with the DeepSeek kernel, demonstrates the adaptation of numerical algorithm codes for two typical physical problems (Thomson problem, temperature field of nuclear waste rods) into portable JavaScript. The adapted programs do not require compilation and can be directly operated and run with an interface in the browser, which facilitates classroom demonstrations and enhances the learning experience of physics majors. The research summarizes the application approaches of AI intelligent programming in the adaptation of computational physics codes: it is necessary to describe program requirements clearly and focusedly to guide the model to respond accurately; separate the source code with quotation marks, and use “context” prompts to enhance the models understanding; promote code optimization through effective “continuous dialogue”. The research results can provide reference for peers and promote the deep integration of AI intelligent large models into physics course teaching.


Key words: artificial intelligence large model, computational physics algorithm, prompt words, portable and interactive