数值分析作业 - 线性方程组的直接求解
数值分析Problem 1

条件数
误差放大因子
Problem 2

Gauss 消元
列主消元
LU 分解
由此前的 Gauss 消元过程
LUP 分解
由列主消元过程
Problem 3

Gauss 消元
1 | gaussElimination[A_?SquareMatrixQ, B_?VectorQ] := |
LU 分解
分解出 LU:
1 | luDecomposition[A_?SquareMatrixQ] := |
利用分解的 LU 和 b 求解 X:
1 | luSolve[A_?SquareMatrixQ, B_?VectorQ] := |
分析
1 | a = ( { |
验证 LU 分解的结果:
1 | luDecomposition[a] // TeXForm |
1 | luSolve[luDecomposition[a], b] |
1 | {1, 2, 3} |
验证高斯消元的结果:
1 | gaussElimination[a, b] |
1 | {1, 2, 3} |
符号求解 12 阶 Hilbert 矩阵
1 | h = HilbertMatrix[12]; |
1 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} |
数值求解 12 阶 Hilbert 矩阵:
1 | h = HilbertMatrix[12, WorkingPrecision -> MachinePrecision]; |
1 | {0.9999999684484674, 1.0000039869936317, 0.9998748290952993, |
数值求解 20 阶 Hilbert 矩阵:
1 | h = HilbertMatrix[20, WorkingPrecision -> MachinePrecision]; |
1 | {1.0000003421959727, 0.9999417184300158, 1.0024368580495062, |