摘要
针对高维线性方程组人为求解较难且费时费力的问题,设计了一款基于PyQt5的线性方程组求解软件,可对用户输入的线性方程组使用Jacobi迭代法和Gauss-Seidel迭代法进行实时、高效的求解,使用幂法判断迭代方法的收敛性,并将迭代求解结果可视化。该软件使用文本控件展示两种迭代法的迭代结果,使用图表控件动态绘制两种迭代法所求的误差值随迭代次数的变化图及各个自变量的取值随迭代次数的变化图。软件的界面整体设计在Qt Designer中实现,局部界面的展示根据用户操作通过Python代码动态生成。界面逻辑功能使用Python的开发工具PyCharm进行开发,使用Python编写迭代算法代码,调用PyQt5库,操作界面。本软件可直观清晰地对比两种迭代法的迭代收敛情况,快速获得线性方程组的求解近似值,实时性好,界面简洁美观,用户操作简易,具有一定的实用价值。
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 realtime 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.
作者
卢玲
漆为民
LU Ling;QI Weimin(School of Artificial Intelligence,Jianghan University,Wuhan 430056,Hubei,China)
出处
《江汉大学学报(自然科学版)》
2023年第1期18-27,共10页
Journal of Jianghan University:Natural Science Edition
基金
湖北省高等学校优秀中青年科技创新团队计划项目(T201828)。