版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
数值分析实验 6 - 解线性方程组的迭代法
<!-- more -->对 {% post_link numanaexp-05 %} 所列目的和意义的线性方程组, 试分别选用 Jacobi 迭代法, Gauss-Seidol 迭代法和 SOR 方法计算其解
令
$$ A=D-L-U $$
其中
令
$$ G=D^{-1}(L+U) $$
则
$$ x^{(k+1)}=Gx^{(k)}+D^{-1}b $$
收敛条件为 $\rho(G)<1$
令
$$ G=(D-L)^{-1}U $$
则
$$ x^{(k+1)}=Gx^{(k)}+(D-L)^{-1}b $$
收敛条件为 $\rho(G)<1$
令
$$ G=(D-\omega L)^{-1}((1-\omega)D+\omega U) $$
则
$$ x^{(k+1)}=Gx^{(k)}+\omega(D-\omega L)^{-1}b $$
收敛条件为 $\rho(G)<1$
{% icodeweb blog lang:matlab numanaexp-06/main.m %}
{% icodeweb blog lang:matlab numanaexp-06/jacobi.m %}
{% icodeweb blog lang:matlab numanaexp-06/gauss_seidol.m %}
{% icodeweb blog lang:matlab numanaexp-06/sor.m %}
方程组的解经验证符合要求, 为节省篇幅而略去
$\epsilon=10^{-3}$ 时的迭代次数
| | 方程组 1 | 方程组 2 | 方程组 3 | | ----------------------- | -------- | -------- | -------- | | Jacobi 迭代法 | 不收敛 | 不收敛 | 15 | | Gauss-Seidol 迭代法 | 不收敛 | 1256 | 7 | | SOR 方法 ($\omega=0.8$) | 不收敛 | 1895 | 10 | | SOR 方法 ($\omega=1.2$) | 不收敛 | 842 | 9 |
$\epsilon=10^{-4}$ 时的迭代次数
| | 方程组 1 | 方程组 2 | 方程组 3 | | ----------------------- | -------- | -------- | -------- | | Jacobi 迭代法 | 不收敛 | 不收敛 | 15 | | Gauss-Seidol 迭代法 | 不收敛 | 1692 | 9 | | SOR 方法 ($\omega=0.8$) | 不收敛 | 2551 | 13 | | SOR 方法 ($\omega=1.2$) | 不收敛 | 1132 | 11 |
$\epsilon=10^{-5}$ 时的迭代次数
| | 方程组 1 | 方程组 2 | 方程组 3 | | ----------------------- | -------- | -------- | -------- | | Jacobi 迭代法 | 不收敛 | 不收敛 | 15 | | Gauss-Seidol 迭代法 | 不收敛 | 2129 | 11 | | SOR 方法 ($\omega=0.8$) | 不收敛 | 3207 | 16 | | SOR 方法 ($\omega=1.2$) | 不收敛 | 1423 | 13 |
SOR 方法中, 方程组 2 的迭代次数与 $\omega$ 的变化图像
SOR 方法中, 方程组 3 的迭代次数与 $\omega$ 的变化图像