📚 Gauss–Seidel Iterative Method of Solution | 高斯-赛德尔迭代解法
In the IB Mathematics curriculum, particularly in the HL Option 'Numerical Methods' or within internal assessments, the Gauss–Seidel method is a powerful iterative technique for solving systems of linear equations. Unlike direct methods that compute the exact solution in one go, the Gauss–Seidel approach starts with an initial guess and refines it step by step, using the latest available values to speed up convergence. This article will guide you through the algorithm, its theoretical underpinnings, convergence conditions, and practical applications, all supplemented with worked examples and exam tips.
在IB数学课程中,特别是HL选修“数值方法”或内部评估中,高斯-赛德尔方法是一种求解线性方程组的强大迭代技术。与一次性算出精确解的直接法不同,高斯-赛德尔方法从初始猜测值出发,逐步修正,并利用最新可用的数值来加快收敛。本文将带领你掌握算法、理论基础、收敛条件以及实际应用,并附有详细例子和考试贴士。
1. What Are Iterative Methods? | 什么是迭代法?
A is sparse, direct methods like Gaussian elimination become expensive in terms of memory and time. Iterative methods provide a sequence of approximate solutions x⁽⁰⁾, x⁽¹⁾, x⁽²⁾, ... that converge to the true solution x*. Each step uses a simple formula, making these methods ideal for matrices with many zero entries. The Gauss– s family and is particularly effective when the coefficient matrix is diagonally dominant.
当我们面对一个大型稀疏系统 Ax = b 时,高斯消元这类直接法会耗费大量内存和时间。迭代法则提供一系列近似解 x⁽⁰⁾, x⁽¹⁾, x⁽²⁾, …,逐步逼近真解 x*。每一步仅使用简单的公式,因此非常适用于含有众多零元素的矩阵。高斯-赛德尔方法就属于这一家族,当系数矩阵严格对角占优时尤为高效。
2. Introducing the Gauss–Seidel Method | 高斯-赛德尔方法介绍
The key idea of the Gauss–Seidel method is to update each component of the solution vector as soon as a new value is computed. For a system of n equations, when solving for xi the method uses the most recent x1, x2, …, xi-1 from the current iteration, while the remaining xi+1 to xn come from the previous iteration. This immediate use of fresh data typically leads to faster convergence compared with the Jacobi method, which waits until all components are updated simultaneously.
高斯-赛德尔方法的核心思想是,每算出一个新的解向量分量就立刻投入使用。含 n 个方程的系统中,当求解 xi 时,方法会使用当前迭代步中已获得的最新 x1, x2, …, xi-1,而 xi+1 至 xn 仍沿用上一迭代步的值。这种立即利用新信息的做法通常比雅可比方法收敛更快,后者需要等所有分量都更新完毕才替换。
3. Matrix Decomposition and Iteration Formula | 矩阵分解与迭代公式
be expressed as (D + L)x + Ux = b. Rearranging for the new iterate x⁽ᵏ⁺¹⁾ gives the Gauss–Seidel update:
将系数矩阵 A 分解为 A = D + L + U,其中 D 为对角矩阵,L 为严格下三角矩阵,U 为严格上三角矩阵。原方程组 Ax = b 可写为 (D + L)x + Ux = b。通过移项即得高斯-赛德尔迭代更新式:
x⁽ᵏ⁺¹⁾ = (D + L)⁻¹ (b – Ux⁽ᵏ⁾)
Component‑wise, for i = 1, 2, …, n, the formula reads:
逐分量形式(i = 1, 2, …, n)为:
xi(k+1) = (bi – Σj=1i-1 aij xj(k+1) – Σj=i+1n aij xj(k)) / aii
Notice that the first sum uses the most recent values xj(k+1) while the second sum still uses values from the previous iteration xj(k). This single-pass update makes the method memory efficient and easy to code.
注意第一个求和项使用最新值 xj(k+1),第二个求和项则仍用上一步的 xj(k)。这种单次遍历更新使得方法节省内存且易于编程。
4. Convergence Criteria | 收敛准则
The Gauss–Seidel method does not always converge. Two common sufficient conditions guarantee convergence:
高斯-赛德尔方法并非总收敛。以下两个常见的充分条件可保证收敛:
The matrix A is strictly diagonally dominant, i.e., for every row i, |aii| > Σj≠i |aij|.
矩阵 A 严格对角占优,即对每一行 i,有 |aii| > Σj≠i |aij|。
A is symmetric and positive definite.
A 是对称正定矩阵。
es for any initial guess if and only if ρ(T) < 1. In IB exams, you are mostly expected to check diagonal dominance or verify convergence through a few iterations.
更精确的收敛条件涉及迭代矩阵 T = (D + L)⁻¹U 的谱半径 ρ(T)。当且仅当 ρ(T) < 1 时,对任意初始猜测均可收敛。在IB考试中,你主要需要检验对角占优,或通过若干次迭代来验证收敛性。
5. Step-by-Step Algorithm | 逐步算法
Follow these steps to perform the Gauss–Seidel iteration:
执行高斯-赛德尔迭代可按如下步骤:
Rearrange the system so that each diagonal coefficient aii is non‑zero and, ideally, as large as possible relative to off‑diagonal entries.
重排方程组,使每个对角系数 aii 非零,且绝对值尽可能大于非对角元素。
Choose an initial approximation x⁽⁰⁾ = (0, 0, …, 0) or a physically motivated guess.
选取初始近似值 x⁽⁰⁾ = (0, 0, …, 0) 或根据问题背景选择合理值。
For k = 0, 1, 2, …, compute each xi(k+1) using the component formula above, always employing the newest values of x1, …, xi-1.
从 k = 0 开始,利用上述分量公式计算每个 xi(k+1),始终采用 x1 至 xi-1 的最新值。
Continue until a stopping criterion is met, e.g., max |xi(k+1) – xi(k)| < ε, or a fixed number of iterations is reached.
持续迭代,直到满足停止准则,例如 max |xi(k+1) – xi(k)| < ε,或达到预定迭代次数。
6. Comparison with Jacobi Method | 与雅可比方法比较
Both Jacobi and Gauss–Seidel are classical stationary iterative methods. The main difference lies in the timing of updates. The table below summarises their characteristics.
雅可比和高斯-赛德尔都是经典的定常迭代法,主要区别在于更新时机。下表总结了它们的特点。
| Feature | Jacobi | Gauss–Seidel |
|---|---|---|
| Update scheme | All components updated simultaneously | Immediate component‑wise update |
| Convergence speed | Usually slower | Often twice as fast |
| Memory | Requires two full solution vectors | Requires only one vector (in‑place) |
| Parallelism | Easily parallelised | Sequential by nature |
In IB problems, you may be asked to compare the number of iterations taken by the two methods to reach the same tolerance. Gauss–Seidel often halves the iteration count while keeping the same computational cost per iteration.
在IB题目中,你可能会被要求比较两种方法达到相同容差所需的迭代次数。高斯-赛德尔通常能减少一半迭代次数,而每次迭代的计算成本相当。
7. Worked Example: 2×2 System | 实例:2×2线性方程组
Solve the following system using the Gauss–Seidel method, starting from x⁽⁰⁾ = (0, 0) and performing three iterations:
用高斯-赛德尔方法求解以下方程组,初始值取 (0, 0),执行三次迭代:
3x + y = 9
x + 2y = 8
The equations are already diagonally dominant. Rearranging for x and y gives:
方程已经对角占优,分别解出 x 和 y:
x(k+1) = (9 – y(k)) / 3
y(k+1) = (8 – x(k+1)) / 2
Iteration 1:
x(1) = (9 – 0)/3 = 3
y(1) = (8 – 3)/2 = 2.5
第一次迭代:
x⁽¹⁾ = 3, y⁽¹⁾ = 2.5
Iteration 2:
x(2) = (9 – 2.5)/3 ≈ 2.1667
y(2) = (8 – 2.1667)/2 ≈ 2.9167
第二次迭代:
x⁽²⁾ ≈ 2.1667, y⁽²⁾ ≈ 2.9167
Iteration 3:
x(3) = (9 – 2.9167)/3 ≈ 2.0278
y(3) = (8 – 2.0278)/2 ≈ 2.9861
第三次迭代:
x⁽³⁾ ≈ 2.0278, y⁽³⁾ ≈ 2.9861
After three iterations we are very close to the exact solution (2, 3). The error drops rapidly.
三次迭代后已十分接近精确解 (2, 3),误差迅速减小。
8. Worked Example: 3×3 System | 实例:3×3线性方程组
Consider the diagonally dominant system:
考虑一个对角占优的方程组:
4x – y + z = 7
4x – 8y + z = –21
–2x + y + 5z = 15
Rearrange each equation for the diagonal variable:
将每个方程改写为对角变量的表达:
x = (7 + y – z) / 4
y = (21 + 4x + z) / 8
z = (15 + 2x – y) / 5
Starting with x⁽⁰⁾ = y⁽⁰⁾ = z⁽⁰⁾ = 0:
从 x⁽⁰⁾ = y⁽⁰⁾ = z⁽⁰⁾ = 0 开始:
k = 1:
x = (7 + 0 – 0)/4 = 1.75
y = (21 + 4×1.75 + 0)/8 = 3.5
z = (15 + 2×1.75 – 3.5)/5 = 3.0
k = 1:
x = 1.75, y = 3.5, z = 3.0
k = 2:
x = (7 + 3.5 – 3.0)/4 = 1.875
y = (21 + 4×1.875 + 3.0)/8 = 3.9375
z = (15 + 2×1.875 – 3.9375)/5 = 2.9625
k = 2:
x = 1.875, y = 3.9375, z = 2.9625
e solution x = 2, y = 4, z = 3. Observe how each component improves using the latest data.
继续迭代将收敛到真解 x = 2, y = 4, z = 3。注意每个分量如何利用最新数据改进。
9. Advantages and Disadvantages | 优缺点
Advantages:
优点:
Simple to implement and highly memory efficient, as it overwrites old values.
实现简单且内存高效,可以直接覆盖旧值。
Usually converges faster than Jacobi for diagonally dominant systems.
对于对角占优系统,收敛速度通常快于雅可比方法。
Well suited for large, sparse matrices arising from finite difference or finite element methods.
非常适合从有限差分或有限元法中产生的大型稀疏矩阵。
Disadvantages:
缺点:
Convergence is not guaranteed; the method may diverge if the matrix is not diagonally dominant or suitably positive definite.
收敛性无法保证;若矩阵不满足对角占优或正定条件,可能发散。
The sequential nature prevents straightforward parallel processing.
天然的串行计算性质使其难以直接并行化。
Rate of convergence can be slow if the spectral radius is close to 1.
若谱半径接近1,收敛速率会很慢。
10. Gauss–Seidel in IB Exam Context | IB考试中的高斯-赛德尔法
In the IB Diploma Programme, the Gauss–Seidel method appears mainly in the HL Mathematics: Applications and Interpretation syllabus under 'Numerical Methods' or within the HL option papers. Students may be required to perform a few manual iterations, describe the algorithm, discuss convergence, and compare it with other schemes. It is also a popular topic for the Internal Assessment (IA), where students can investigate the efficiency of the method on diverse large systems, program it in Python or Excel, and explore acceleration techniques such as successive over‑relaxation (SOR).
在IB文凭课程中,高斯-赛德尔方法主要出现在HL数学:应用与解释大纲的“数值方法”部分,或作为HL选修论文的考点。学生可能需要进行若干次人工迭代、描述算法、讨论收敛性,以及与其他方法比较。这也是内部评估(IA)的热门选题,学生可以探索方法在不同大型系统上的效率,用Python或Excel编程,并研究逐次超松弛(SOR)等加速技巧。
Exam questions often provide a system already rearranged for diagonal dominance and ask for two or three iterations, followed by an error estimate. Always check the diagonal coefficients before starting.
考试题目通常会给出已调整成对角占优形式的方程组,要求完成两到三次迭代,再估算误差。开始计算前务必检查对角系数。
11. Common Mistakes and How to Avoid Them | 常见错误及避免方法
Not checking diagonal dominance: Starting the Gauss–Seidel process on a system that is not diagonally dominant can lead to divergence. Always rearrange equations or verify convergence conditions first.
未检查对角占优:在一个非对角占优的系统上直接启动高斯-赛德尔迭代可能导致发散。务必先重新排列方程或验证收敛条件。
Using stale values: A frequent error is to use xi(k) instead of the newly computed xi(k+1) when updating subsequent variables. Make sure you always use the most recent component value available in that iteration.
使用了旧值:一个常见错误是在更新后续变量时仍用 xi(k),而非刚算出的 xi(k+1)。务必始终使用当前迭代步中可获得的最新分量值。
Ignoring order of equations: The order of equations can affect the convergence speed. Try to place equations with the largest diagonal entries first to improve performance.
忽略方程顺序:方程的顺序会影响收敛速度。尽量将对角元素最大的方程放在前面以提升性能。
Rounding too early: In manual iterations, keep sufficient decimal places to avoid cumulative rounding errors that mask convergence.
过早舍入:人工迭代时保留足够的小数位,避免累积舍入误差掩盖收敛。
12. Summary | 总结
The Gauss–Seidel method is a cornerstone iterative solver that efficiently attacks large linear systems by immediately injecting fresh estimates. Key takeaways: (1) it updates components one by one using the most recent values; (2) convergence is guaranteed for strictly diagonally dominant or symmetric positive definite matrices; (3) the component‑wise formula is intuitive and easy to programme; (4) practical use always requires a check of convergence criteria; (5) it often outperforms Jacobi in terms of iteration count. Mastery of this method not only prepares you for IB exams but also builds a foundation for
Published by TutorHao | IB Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图