线性方程组的数值解法(结尾)

迭代法:

1.雅可比迭代

对于线性方程组:

\left\{ \begin{array}{c} a_{11}x_1+a_{12}x_2+\cdots a_{1n}x_n\ =\ b_1\\ a_{21}x_1+a_{22}x_2+\cdots a_{2n}x_n\ =\ b_2\\ \cdots\\ a_{n1}x_1+a_{n2}x_2+\cdots a_{nn}x_n\ =\ b_n\\ \end{array} \right.

对其进行转化,可以得到解为:

\left\{ \begin{array}{c} x_1=\frac{1}{a_{11}}\left( b_1-a_{12}x_2-\cdots -a_{1n}x_n \right)\\ x_2=\frac{1}{a_{22}}\left( b_2-a_{21}x_1-\cdots -a_{2n}x_n \right)\\ \cdots\\ x_n=\frac{1}{a_{nn}}\left( b_n-a_{n1}x_1-\cdots -a_{n,n-1}x_n \right)\\ \end{array} \right.

那么迭代形式为,等号左边为k+1次迭代,右边为K次迭代:

\left\{ \begin{array}{c} x_{1}^{\left( k+1 \right)}=\frac{1}{a_{11}}\left( b_1-a_{12}x_{2}^{\left( k \right)}-\cdots -a_{1n}x_n \right)\\ x_{2}^{\left( k+1 \right)}=\frac{1}{a_{22}}\left( b_2-a_{21}x_{1}^{\left( k \right)}-\cdots -a_{2n}x_n \right)\\ \cdots\\ x_{n}^{\left( k+1 \right)}=\frac{1}{a_{nn}}\left( b_n-a_{n1}x_{1}^{\left( k \right)}-\cdots -a_{n,n-1}x_n \right)\\ \end{array} \right.

直接带进去算就OK了,这是雅可比迭代公式。

假设有D\ =\ \left[ \begin{matrix} a_{11}& & \\ & \ddots& \\ & & a_{nn}\\ \end{matrix} \right],有Ax\ =\ \left( D+A-D \right) x\ =\ bDx\ =\ \left( D-A \right) x\ +\ b,入过矩阵D可逆,那么:

Dx\ =\ \left( D-A \right) x\ +\ b

改写一下:x\ =\ D^{-1}\left( D-A \right) x\ +D^{-1}b

将其展开:

\left( \begin{array}{c} x_{1}^{\left( k+1 \right)}\\ x_{2}^{\left( k+1 \right)}\\ \vdots\\ x_{n}^{\left( k+1 \right)}\\ \end{array} \right) =\left( \begin{matrix} 0& r_{12}& \cdots& r_{1n}\\ r_{21}& r_{22}& \cdots& r_{2n}\\ \vdots& \vdots& \ddots& \vdots\\ r_{n1}& r_{n2}& \cdots& r_{nn}\\ \end{matrix} \right) \left( \begin{array}{c} x_{1}^{\left( k \right)}\\ x_{2}^{\left( k \right)}\\ \vdots\\ x_{n}^{\left( k \right)}\\ \end{array} \right) +\left( \begin{array}{c} g_1\\ g_2\\ \vdots\\ g_n\\ \end{array} \right)

那么矩阵D为迭代矩阵,当该矩阵满足:

\rho \left( R \right) \ =\ \max_{1\le i\le n}|\lambda _i|<1

该矩阵的特征值的绝对值中最大的仍然小于1,说明该方法收敛,可以用于计算。

对角优对于方阵任意行、列它的主对角线元素要绝对大于该元素分别对应的行、列值之和.

如果:若矩阵M为严格对角优,则M可逆;

若A为严格对角优,说明迭代收敛

2.高斯迭代

高斯迭代的格式

\left\{ \begin{array}{c} x_{1}^{\left( k+1 \right)}\ =\ \frac{1}{a_{11}}\left( b_1-a_{12}x_{2}^{\left( k \right)}-\cdots -a_{1n}x_{n}^{\left( k \right)} \right)\\ x_{2}^{\left( k+1 \right)}\ =\ \frac{1}{a_{22}}\left( b_2-a_{21}x_{1}^{\left( k+1 \right)}-\cdots -a_{2n}x_{n}^{\left( k \right)} \right) \\\ \vdots\\ x_{n}^{\left( k+1 \right)}\ =\frac{1}{a_{nn}}\left( b_n-a_{n1}x_{1}^{\left( k+1 \right)}-\cdots -a_{n,n-1}x_{n-1}^{\left( k+1 \right)} \right)\\ \end{array} \right.

和雅可比公式比较一下,区别在哪里?

首先,雅可比公式等式左边均为k+1次迭代,右边均为k次迭代。

而高斯迭代左边为均为k+1次迭代,右边第一行无k+1,第二行一个,最后均为K+1次迭代:

Ax\ =\ \left( D+L+U \right) x\ =\ b

\left( D+L \right) x\ +Ux\ =\ b

x\ =\ -\left( D+L \right) ^{-1}Ux\ +\ \left( D+L \right) ^{-1}b

令:S\ =\ -\left( D+L \right) ^{-1}U,那么S为高斯迭代矩阵,判断方式和前面的雅可比迭代一样,这里不再赘述。

那么矩阵D为迭代矩阵,当该矩阵满足:

\rho \left(S \right) \ =\ \max_{1\le i\le n}|\lambda _i|<1

该矩阵的特征值的绝对值中最大的仍然小于1,说明该方法收敛,可以用于计算。

对角优对于方阵任意行、列它的主对角线元素要绝对大于该元素分别对应的行、列值之和.

如果:若矩阵M为严格对角优,则M可逆;

若A为严格对角优,说明迭代收敛

3.松弛迭代

松弛因子:\omega

关于松弛迭代的公式是:

\left\{ \begin{array}{c} x_{1}^{\left( k+1 \right)}\ =\ \left( 1-\omega \right) x_{1}^{\left( k \right)}+\omega \left( r_{12}x_{2}^{\left( k \right)}\ +\ r_{13}x_{3}^{\left( k \right)}+\cdots +r_{1n}x_{n}^{\left( k \right)}+g_1 \right)\\ x_{2}^{\left( k+1 \right)}\ =\ \left( 1-\omega \right) x_{1}^{\left( k \right)}+\omega \left( r_{21}x_{1}^{\left( k \right)}\ +\ r_{23}x_{2}^{\left( k \right)}+\cdots +r_{2n}x_{n}^{\left( k \right)}+g_2 \right)\\ \vdots\\ x_{n}^{\left( k+1 \right)}\ =\ \left( 1-\omega \right) x_{1}^{\left( k \right)}+\omega \left( r_{n1}x_{2}^{\left( k \right)}\ +\ r_{n2}x_{2}^{\left( k \right)}+\cdots +r_{n,n-1}x_{n}^{\left( k \right)}+g_n \right)\\ \end{array} \right.

\omega = 1时,松弛迭代即为高斯迭代。

你可能感兴趣的:(数值分析,学习方法)