# 线性方程组

线性方程组是若干方程的集合，其中每个方程都将未知变量的一个线性组合表示为一个常数，可紧凑地写成矩阵形式 \( A x = b \)，其中 \( A \) 是系数矩阵，\( b \) 是右端项，\( x \) 是待确定的未知量向量。<sup>[1](https://www.netlib.org/lapack/lug/node38.html)</sup> 求解这类方程组是数值线性代数中最常见的任务之一，而求解方法的选择主要取决于矩阵的大小、密度和结构。<sup>[2](https://www.mathworks.com/help/matlab/math/iterative-methods-for-linear-systems.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 矩阵形式 | \( A x = b \)，标准情形下 \( A \) 为 \( n \) 阶方阵；多个右端项写作 \( A X = B \)<sup>[1](https://www.netlib.org/lapack/lug/node38.html)</sup> |
| 解的可能性 | 对任何方程组，恰好存在三种结果：无解、唯一解或无穷多解<sup>[3](https://math.emory.edu/~lchen41/teaching/2021_Spring_Math221/Section_1-2.pdf)</sup> |
| 秩判别准则 | 对于 \( m \) 个方程、\( n \) 个变量的相容方程组，若增广矩阵的秩为 \( r \)，则解集恰好涉及 \( n - r \) 个参数；\( r = n \) 时给出唯一解<sup>[3](https://math.emory.edu/~lchen41/teaching/2021_Spring_Math221/Section_1-2.pdf)</sup> |
| 稠密直接法代价 | 对稠密 \( n \times n \) 矩阵做高斯消元需存储全部 \( n^2 \) 个元素，约需 \( 2n^3/3 \) 次算术运算<sup>[4](https://epubs.siam.org/doi/10.1137/1.9781611970937)</sup> |
| 带状直接法代价 | 若非零元仅出现在 \( \|i - j\| \le m \) 处，带状消元约存储 \( 2mn \) 个元素，约执行 \( 2m^2 n \) 次运算<sup>[4](https://epubs.siam.org/doi/10.1137/1.9781611970937)</sup> |
| 条件性 | 解对 \( A \) 和 \( b \) 中扰动的敏感程度由 \( \kappa(A) = \|A\|_p \, \|A^{-1}\|_p \) 度量，且 \( \kappa(A) \ge 1 \)；值越大，方程组病态越严重<sup>[5](https://dlmf.nist.gov/draft1/3.2)</sup> |
| 已知最早的解 | 线性方程组在《九章算术》中已被求解，该书成书于公元一世纪<sup>[6](https://www.jesus.cam.ac.uk/articles/chinese-roots-linear-algebra)</sup> |

## 解的结构

若一个方程组至少有一个解，则称其为相容的。通过行运算将增广矩阵化为行阶梯形，可使解集的结构变得明确：秩 \( r \)，即首元 1 的个数，仅取决于矩阵本身，而与所采用的行运算序列无关。<sup>[3](https://math.emory.edu/~lchen41/teaching/2021_Spring_Math221/Section_1-2.pdf)</sup> 对于 \( m \) 个方程、\( n \) 个变量的相容方程组，解集恰好涉及 \( n - r \) 个自由参数。若 \( r = n \)，则每个变量都是主元变量，解唯一；若 \( r < n \)，则有无穷多解。不相容方程组在行阶梯形中会产生形如 \( 0 \; 0 \; \cdots \; 0 \; 1 \) 的行。<sup>[3](https://math.emory.edu/~lchen41/teaching/2021_Spring_Math221/Section_1-2.pdf)</sup>

## 直接法

**直接法**是高斯消元法的各种变体，它们通过 LU、QR 或 Cholesky 等分解来利用矩阵的各个元素，并在固定步数内给出高精度的解。<sup>[2](https://www.mathworks.com/help/matlab/math/iterative-methods-for-linear-systems.html)</sup> 若 \( A \) 已是上三角或下三角矩阵，则通过简单的回代或前代即可求解；否则先将 \( A \) 分解为三角因子，其形式取决于矩阵的性质。<sup>[1](https://www.netlib.org/lapack/lug/node38.html)</sup> LAPACK 是稠密线性代数的标准库，它将一般矩阵分解为 \( A = PLU \)，其中 \( P \) 是置换矩阵，\( L \) 是单位下三角矩阵，\( U \) 是上三角矩阵；对称正定矩阵则使用 Cholesky 分解 \( A = U^{T}U \) 或 \( A = LL^{T} \)。<sup>[1](https://www.netlib.org/lapack/lug/node38.html)</sup>

直接求解的代价强烈依赖于系数矩阵的密度和填充模式。稠密 \( n \times n \) 方程组需要存储全部 \( n^2 \) 个元素，约需 \( 2n^3/3 \) 次运算。<sup>[4](https://epubs.siam.org/doi/10.1137/1.9781611970937)</sup> 结构能带来显著帮助：对于半带宽为 \( m \) 的带状矩阵，带状版本的高斯消元仅存储带内约 \( 2mn \) 个元素，执行约 \( 2m^2 n \) 次运算，不过消元过程中带内的零元会被非零元填充。<sup>[4](https://epubs.siam.org/doi/10.1137/1.9781611970937)</sup>

## 迭代法

**迭代法**从初始近似 \( x^{0} \) 出发，生成一个序列 \( \{x^{1}, x^{2}, \ldots, x^{N}\} \)，当 \( N \to \infty \) 时收敛到解，通常的做法是将 \( Ax = b \) 转化为等价的不动点形式 \( x = T x + c \)。<sup>[7](https://johnfoster.pge.utexas.edu/numerical-methods-book/LinearAlgebra_IterativeSolvers.html)</sup> 对于小规模方程组，迭代法很少使用，因为收敛所需的时间通常超过高斯消元等直接法求解所需的时间；对于非常大规模的方程组，尤其是零元素比例很高的稀疏方程组，迭代法在运行时间和内存两方面都可能高效得多。<sup>[7](https://johnfoster.pge.utexas.edu/numerical-methods-book/LinearAlgebra_IterativeSolvers.html)</sup> 迭代法仅通过矩阵-向量乘积间接使用系数矩阵，允许在运行时间与精度之间权衡；它们可应用于任何矩阵，但通常保留给直接求解较慢的大型稀疏矩阵。<sup>[2](https://www.mathworks.com/help/matlab/math/iterative-methods-for-linear-systems.html)</sup>

大多数迭代求解器遵循一个共同的循环：从猜测值 \( x_0 \) 开始，计算残差范数 \( \|b - A x_0\| \)，若满足容差则停止，否则利用 \( A x_0 \) 和基于残差的量更新 \( x_0 \)。<sup>[2](https://www.mathworks.com/help/matlab/math/iterative-methods-for-linear-systems.html)</sup> 应用最广的一类方法是 Krylov 子空间法，它从仿射子空间 \( x_0 + \mathcal{K}_m \) 中提取近似解 \( x_m \)，其中 \( \mathcal{K}_m(A, r_0) = \mathrm{span}\{r_0, A r_0, A^{2} r_0, \ldots, A^{m-1} r_0\} \)，\( r_0 = b - A x_0 \)，并对第二个子空间 \( \mathcal{L}_m \) 施加 Petrov-Galerkin 条件 \( b - A x_m \perp \mathcal{L}_m \)。<sup>[8](https://epubs.siam.org/doi/10.1137/1.9780898718003)</sup> 共轭梯度（CG）法、MINRES 法和 GMRES 法分别针对 Hermite 正定矩阵、Hermite 不定矩阵和一般非 Hermite 矩阵设计，各自在相应的误差范数或残差范数下从 Krylov 空间中生成最优近似。<sup>[4](https://epubs.siam.org/doi/10.1137/1.9781611970937)</sup>

预条件子是对方程组所做的任何隐式或显式修改，使其更易于用给定的迭代法求解；迭代法的收敛性很少对所有矩阵都有保证，但有大量理论涵盖由椭圆偏微分方程有限差分离散化产生的矩阵。<sup>[9](https://doi.org/10.1137/1.9780898718003?jav=VoR&rel=cite-as&urlappend=%3Fref%3DPDF)</sup> 预条件与 Krylov 迭代的结合自 20 世纪 60 年代和 70 年代以来得到发展，使迭代求解器得以与直接法竞争；对于科学计算中如今常见的三维模型，迭代法几乎是必需的，因为所需的内存和计算量对最高效的直接求解器也构成了挑战。<sup>[10](https://web.stanford.edu/class/cme324/saad.pdf)</sup>

## 条件性与精度

计算解对 \( A \) 和 \( b \) 中小扰动的敏感程度由条件数 \( \kappa(A) = \|A\|_p \, \|A^{-1}\|_p \) 度量，对任何矩阵范数都满足 \( \kappa(A) \ge 1 \)；\( \kappa(A) \) 越大，方程组病态越严重。<sup>[5](https://dlmf.nist.gov/draft1/3.2)</sup> 对于残差为 \( r = b - A x^{*} \) 的计算解 \( x^{*} \)，后验误差界为 \( \|x^{*} - x\|_p / \|x\|_p \le \kappa(A) \, \|r\|_p / \|b\|_p \)，因此任何求解器可达到的精度都受问题本身条件性的限制。<sup>[5](https://dlmf.nist.gov/draft1/3.2)</sup>

## 历史起源

古代已知最早对联立线性方程组的详尽处理，是《九章算术》第八章，这是一部在中国匿名集体编写的习题集，以同一种系统化的方法求解了 18 个不同的方程组。<sup>[11](https://doi.org/10.1016/j.hm.2010.06.003)</sup> 计算使用算筹在排列成矩形的方格中进行；矩形的每一列对应一个现代线性方程，因此古代的数表必须逆时针旋转 90 度才能与现代的系数布局相匹配。<sup>[11](https://doi.org/10.1016/j.hm.2010.06.003)</sup> 当合并两列以消去一个数时，每列先乘以另一列的首数再相减，从而保持整数系数。<sup>[11](https://doi.org/10.1016/j.hm.2010.06.003)</sup>

该书的注释者包括刘徽（公元 263 年）、贾宪（约 1025 年）、杨辉（1261 年）和戴震（1774 年）等。<sup>[6](https://www.jesus.cam.ac.uk/articles/chinese-roots-linear-algebra)</sup> 历史学家罗杰·哈特（Roger Hart）是德克萨斯南方大学中国史教授兼中国研究所所长，他认为这些文本表明现代线性代数的要点——包括增广矩阵、消元法和行列式式的计算——在公元一世纪的中国帝制时期就已为人所知，而传统叙述将行列式归功于莱布尼茨（Leibniz，1646–1716）、将消元法归功于高斯（Gauss，1777–1855），所描述的只是欧洲的独立发展。<sup>[6](https://www.jesus.cam.ac.uk/articles/chinese-roots-linear-algebra)</sup> 哈特还识别出 18 个问题中有 5 个的独特模式在斐波那契（Fibonacci，约 1170–1250）的著作中重现，暗示了中世纪晚期向欧洲的传播。<sup>[6](https://www.jesus.cam.ac.uk/articles/chinese-roots-linear-algebra)</sup>

## 应用

线性方程组遍及工程与科学领域。在电网络分析中，基尔霍夫电流定律和电压定律为未知的电流、电压或电阻生成一组线性方程；当独立方程数与未知量数相等时，电路即可用这些方法求解。<sup>[12](https://openstax.org/books/university-physics-volume-2/pages/10-3-kirchhoffs-rules)</sup> 一个含三个未知电流的算例给出方程组 \( I_1 + I_2 - I_3 = 0 \)、\( -19 I_1 + 10 I_2 = 90 \) 和 \( -10 I_2 - 30 I_3 = -180 \)，可用标准线性代数技术求解。<sup>[13](https://www.math.ucdavis.edu/~daddel/linear_algebra_appl/Applications/Electrical_Circuits/Electrical_Circuits.html)</sup> 历史上，20 世纪 60 年代处理网络的电气工程师最早利用稀疏性来求解具有不规则结构矩阵的一般稀疏线性方程组，这便是稀疏矩阵技术的起源。<sup>[8](https://epubs.siam.org/doi/10.1137/1.9780898718003)</sup> 由偏微分方程有限差分离散化产生的矩阵通常也是稀疏的，每行只有少数非零元，这正是大规模仿真如此依赖上述稀疏求解器的原因。<sup>[4](https://epubs.siam.org/doi/10.1137/1.9781611970937)</sup>

## References

1. [Linear Equations, LAPACK Users' Guide, Third Edition, netlib](https://www.netlib.org/lapack/lug/node38.html)
2. [Iterative Methods for Linear Systems, MATLAB & Simulink documentation, MathWorks](https://www.mathworks.com/help/matlab/math/iterative-methods-for-linear-systems.html)
3. [Section 1.2: Gaussian Elimination, W. Keith Nicholson, MATH 221 course notes, Emory University](https://math.emory.edu/~lchen41/teaching/2021_Spring_Math221/Section_1-2.pdf)
4. [Iterative Methods for Solving Linear Systems, Anne Greenbaum and Timothy P. Chartier, SIAM](https://epubs.siam.org/doi/10.1137/1.9781611970937)
5. [DLMF §3.2: Linear Algebra, NIST Digital Library of Mathematical Functions](https://dlmf.nist.gov/draft1/3.2)
6. [The Chinese Roots of Linear Algebra, Jesus College, University of Cambridge](https://www.jesus.cam.ac.uk/articles/chinese-roots-linear-algebra)
7. [Iterative Methods for Solving Linear Systems of Equations, John E. Foster, University of Texas at Austin](https://johnfoster.pge.utexas.edu/numerical-methods-book/LinearAlgebra_IterativeSolvers.html)
8. [Iterative Methods for Sparse Linear Systems, Second Edition, Youssef Saad, SIAM](https://epubs.siam.org/doi/10.1137/1.9780898718003)
9. [Iterative Methods for Sparse Linear Systems, Second Edition, SIAM Publications Library (cite-as page)](https://doi.org/10.1137/1.9780898718003?jav=VoR&rel=cite-as&urlappend=%3Fref%3DPDF)
10. [Iterative Methods for Solving General, Large Sparse Linear Systems, Youssef Saad, Stanford CME 324 course PDF](https://web.stanford.edu/class/cme324/saad.pdf)
11. [How ordinary elimination became Gaussian elimination, Historia Mathematica](https://doi.org/10.1016/j.hm.2010.06.003)
12. [10.3 Kirchhoff's Rules, University Physics Volume 2, OpenStax](https://openstax.org/books/university-physics-volume-2/pages/10-3-kirchhoffs-rules)
13. [Electrical Circuits, Linear Algebra Applications, UC Davis](https://www.math.ucdavis.edu/~daddel/linear_algebra_appl/Applications/Electrical_Circuits/Electrical_Circuits.html)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Linear and multilinear algebra › Vector spaces and linear maps

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/system-of-linear-equations

English original: https://www.edgepedia.org/system-of-linear-equations
