大学物理 ›› 2026, Vol. 45 ›› Issue (08): 102-.doi: 10.16854/j.cnki.1000-0712.250493

• AI赋能 智教新探 • 上一篇    下一篇

基于AI智能编程技能开发计算物理便携交互式程序的方法研究

林辉,仇怀利,于同坡,卫泽闻,刘昊天,周琳,李中军*   

  1. 合肥工业大学 物理学院,合肥230601
  • 收稿日期:2025-09-07 接受日期:2025-09-20 出版日期:2026-10-10 发布日期:2026-10-20
  • 通讯作者: 李中军,E-mail: zjli@hfut.edu.cn
  • 作者简介:林辉(1973—),女,安徽阜阳人,合肥工业大学物理学院教授,博士,主要从事大学物理教学和核技术医学应用研究工作.
  • 基金资助:
    教育部高校物理类课程计算物理教指委项目(JZW-25-JW-02), 安徽省教育厅教学改革项目(2024dzxkc003,2024cxtd009),合肥工业大学质量工程项目(TSPY202402、2024jcjs001),校级大学生创新项目 (X202510359393)

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

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

  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

摘要: 算法代码实现是《计算物理》课程中连接理论与实践的核心环节.因编程语言随时代演变,各教材代码存在互通性差的问题.本工作基于搭载 DeepSeek 内核的腾讯元宝大模型,展示了将两个典型物理问题(汤姆森问题、核废料棒温度场)数值算法代码,改编为可便携使用的 JavaScript 语言.改编后的程序无需编译,可直接在浏览器中实现界面化操作运行,为课堂演示及学生学习提供便利.研究总结了 AI 智能编程在计算物理代码改编中的应用途径:如需清晰、聚焦描述程序需求,以引导模型精准应答;用引号分隔源代码,“上下文”提示增强模型理解;通过有效 “接续对话” 推动代码优化.研究成果可为同行提供借鉴,推动AI智能大模型深度融合物理课程教学.


关键词: 人工智能大模型, 计算物理算法, 提示词, 便携交互式

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