江汉大学学报(自然科学版) ›› 2023, Vol. 51 ›› Issue (1): 18-27.doi: 10.16389/j.cnki.cn42-1737/n.2023.01.003

• 数学 • 上一篇    下一篇

基于 PyQt5 的求解线性方程组软件的设计与实现

卢玲,漆为民*   

  1. 江汉大学 人工智能学院,湖北 武汉 430056
  • 发布日期:2023-02-21
  • 通讯作者: 漆为民
  • 作者简介:卢玲(1996— ),女,硕士生,研究方向:软件工程、计算机视觉。*通信作者:漆为民(1975—),男,教授,博士,研究方向:嵌入式系统、智能控制算法。
  • 基金资助:
    湖北省高等学校优秀中青年科技创新团队计划项目(T201828)

Responses of Seed Germination and Seeding Growth Physiology of 3 Pea Variants to Drought Stress

LU Ling,QI Weimin*   

  1. School of Artificial Intelligence,Jianghan University,Wuhan 430056,Hubei,China
  • Published:2023-02-21
  • Contact: QI Weimin

摘要: 针对高维线性方程组人为求解较难且费时费力的问题,设计了一款基于 PyQt5 的线性方程组求解软件,可对用户输入的线性方程组使用 Jacobi迭代法和 Gauss-Seidel 迭代法进行实时、高效的求解,使用幂法判断迭代方法的收敛性,并将迭代求解结果可视化。该软件使用文本控件展示两种迭代法的迭代结果,使用图表控件动态绘制两种迭代法所求的误差值随迭代次数的变化图及各个自变量的取值随迭代次数的变化图。软件的界面整体设计在 Qt Designer 中实现,局部界面的展示根据用户操作通过 Python 代码动态生成。界面逻辑功能使用 Python的开发工具PyCharm 进行开发,使用 Python编写迭代算法代码,调用 PyQt5库,操作界面。本软件可直观清晰地对比两种迭代法的迭代收敛情况,快速获得线性方程组的求解近似值,实时性好,界面简洁美观,用户操作简易,具有一定的实用价值。

关键词: PyQt5, Python, 线性方程组, Jacobi迭代法, Gauss-Seidel迭代法, 幂法

Abstract: Aiming at the problem that high-dimensional linear equations are difficult and time-consuming to solve manually,this paper designed a linear equation-solving software based on PyQt5. This software solved linear equations input by users efficiently and in real-time based on Jacobi iteration and Gauss-Seidel iteration,judged the convergence of iterative methods using the power method,and visualized the iterative solution results. The text control was used to display the iterative results of the two iterative methods. The graph control was used to dynamically draw the graph of the error value obtained by the two iterative methods changing with the number of iterations and the graph of each independent variable value changing with the number of iterations. The overall interface design of this software was implemented in Qt Designer,and the partial interface display was dynamically generated by Python code according to user operations. The interface logic function was developed by Python's development tool PyCharm,using Python to write iterative algorithm code,call the PyQt5 library,and operate the interface. This software can intuitively compare the two iterative methods' convergence and quickly obtain the approximate solution value of the linear equation system. It has good real-time performance,a simple and beautiful interface,user-friendly operation,and has certain practical value.

Key words: PyQt5, Python, linear equations, Jacobi iteration, Gauss-Seidel iteration, power method

中图分类号: