我在计算SymPy中的简化梯队形式。我正在尝试获取以下矩阵的轴列:
exercise4 = Matrix([[1,3,5,7],[3,5,7,9],[5,7,9,1]])
我用以下内容检查矩阵:
exercise4.rref()[0]
Matrix([
[1, 0, -1, 0],
[0, 1, 2, 0],
[0, 0, 0, 1]])
…作为旁白,这和我的简化矩阵是不同的
exercise4 = np.array([[1,3,5,7],[3,5,7,9],[5,7,9,1]])
exercise4[1] = exercise4[1] + -3*exercise4[0]
exercise4[2] = exercise4[2] + -5*exercise4[0]
exercise4[1] = -1/4*exercise4[1]
exercise4[0] = exercise4[0] + -3*exercise4[1]
exercise4[2] = exercise4[2] + 8*exercise4[1]
exercise4
array([[ 1, 0, -1, -2],
[ 0, 1, 2, 3],
[ 0, 0, 0, -10]])
rref()[1]
这里返回(0, 1, 3)
,第三个元素显然不正确,因为它是增广矩阵的最后一个元素。第三行不一致,不应该有第三个透视列。你知道吗
sympy.Matrix().rref()
的固有缺陷是它会错误地解释不一致的数据透视列吗?这是我需要注意的,还是有办法解决的?你知道吗
以[2,3]为轴心点生成
rref
矩阵:当我把你的矩阵插入一个交互式表单时,我得到了
sympy
结果http://www.math.odu.edu/~bogacki/cgi-bin/lat.cgi?c=rref
这里也是:https://www.emathhelp.net/calculators/linear-algebra/reduced-row-echelon-form-rref-caclulator/
此版本减少了最后一行,因此所有前导项都是1。但有一个来源允许:
https://stattrek.com/statistics/dictionary.aspx?definition=reduced_row_echelon_form
相关问题 更多 >
编程相关推荐