:
[[ 4.5]
[ 0.5]
[-0. ]]
此结果中的三项依次对应为
的结果。...from sympy import *
from sympy.solvers.solveset import linsolve
x1, x2, x3, x4 = symbols("x1 x2 x3 x4...")
linsolve([x1 + 3*x2 - 4*x3 + 2*x4, 3*x1 - x2 + 2*x3 - x4, -2*x1 + 4*x2 - x3 + 3*x4, 3*x1 +9*x2 - 7...*x3 + 6*x4], (x1, x2, x3, x4))
输出结果:
用未知量表示,即为:
此结果与上述运用初等行变换手工计算结果一样。...关于使用SymPy求解线性方程组的详细说明,请参阅文档:https://docs.sympy.org/latest/index.html。