Gauss-Seidel iteration for stiff ODEs from chemical kinetics

合集下载

二维gauss-seidel迭代法matlab代码

二维gauss-seidel迭代法matlab代码

二维Gauss-Seidel迭代法是解线性方程组的一种常用方法,通过迭代求解,能够快速且精确地得到方程组的解。

在MATLAB中,可以使用简洁的代码实现二维Gauss-Seidel迭代法,下面我们将介绍该方法的原理以及在MATLAB中的具体实现。

一、Gauss-Seidel迭代法原理1. Gauss-Seidel迭代法是一种逐次逼近的方法,通过不断迭代更新方程组中的未知数,最终得到方程组的解。

其基本思想是利用已知的未知数值不断逼近更精确的解。

2. 对于线性方程组Ax=b,可以将其表示为x(k+1)=Tx(k)+c的形式,其中T为迭代矩阵,c为常量向量,x为未知数向量。

Gauss-Seidel 迭代法通过不断更新x(k)的值,逐步逼近方程组的解。

3. 迭代矩阵T和常量向量c的具体计算方式为:首先将系数矩阵A分解为下三角矩阵L、对角矩阵D和上三角矩阵U,然后得到T=-L*(D^-1)*U,c=L*(D^-1)*b。

4. 通过不断迭代更新x(k)的值,直到满足一定的精度要求或者迭代次数达到设定值,即可得到方程组的解。

二、MATLAB实现二维Gauss-Seidel迭代法在MATLAB中,可以很方便地实现二维Gauss-Seidel迭代法,以下是具体的实现代码:```matlabfunction [x, k] = gauss_seidel(A, b, x0, tol, max_iter)A为系数矩阵,b为常量向量,x0为初始解向量,tol为精度要求,max_iter为最大迭代次数返回x为方程组的解,k为实际迭代次数n = length(b);x = x0;k = 0;err = tol + 1;L = tril(A, -1); 下三角矩阵U = triu(A, 1); 上三角矩阵D = diag(diag(A)); 对角矩阵T = -L*(D\U);c = L*(D\b);while err > tol k < max_iterx_old = x;x = T*x + c;err = norm(x - x_old, inf);k = k + 1;endend```三、代码说明1. 函数gauss_seidel接受系数矩阵A、常量向量b、初始解向量x0、精度要求tol和最大迭代次数max_iter作为输入参数,返回方程组的解x和实际迭代次数k。

高斯-塞德尔(Gauss-Seidel)迭代法

高斯-塞德尔(Gauss-Seidel)迭代法

将A分裂成A =L+D+U,则 Ax b 等价于
( L+D+U )x = b
于是,则高斯—塞德尔迭代过程
Dx(k1) Lx(k1) Ux(k) b
因为 D 0 ,所以 D L D 0

(D L)x(k1) Ux (k) b
x(k1) (D L)1Ux (k) (D L)1b
数值计算方法
高斯-塞德尔(Gauss-Seidel)迭代法
1.1 高斯-塞德尔迭代法的基本思想
在Jacobi迭代法中,每次迭代只用到前一次的 迭代值,若每次迭代充分利用当前最新的迭代值,
即在求
x (k 1) i
时用新分量
x1( k
1)
,
x
(k 2
1)
,,
x (k 1) i 1
代替旧分量
x1(
k
)
,
x1(k
x
(k 2
1) 1)
( x2(k ) x3(k ) (2x1(k1)
1) / 8 x3(k) 4) /10
x3(k
1)
( x1(k 1)
x (k 1) 2
3) / 5
取初始迭代向量 x(0) (0 ,0 ,0)T ,迭代结果为:
1.2 Gauss—Seidel 迭代法的矩阵表示
令 G1 (D L)1U , d1 (D L)1b
则高斯-塞德尔迭代形式为:
x (k 1) G1 x (k ) d1
1.3 高斯—塞德尔迭代算法实现
高斯-塞德尔迭代算法的计算步骤与流程图与
雅可比迭代法大致相同,只是一旦求出变元 xi
的某个新值
后, x (k1) i
就改用新值

gauss-seidel迭代法例题matlab代码

gauss-seidel迭代法例题matlab代码

【题目】:Gauss-Seidel迭代法及Matlab代码实例【内容】:1. Gauss-Seidel迭代法介绍Gauss-Seidel迭代法是一种用于解线性方程组的数值方法,基于逐次逼近的思想,通过不断迭代逼近线性方程组的解。

该方法通常用于求解大型稀疏线性方程组,其收敛速度相对较快。

2. 迭代公式推导假设有如下线性方程组:$$Ax=b$$其中A为系数矩阵,b为常数向量,x为未知向量。

Gauss-Seidel迭代法的迭代公式为:$$x^{(k+1)}=(D+L)^{-1}(b- Ux^{(k)})$$其中,D为A的对角矩阵,L为A的严格下三角矩阵,U为A的严格上三角矩阵,k为迭代次数。

3. Matlab代码实现下面给出Gauss-Seidel迭代法的Matlab代码实例:```matlabfunction [x, k] = gaussSeidel(A, b, x0, tol, maxIter)A: 系数矩阵b: 常数向量x0: 初始解向量tol: 容差maxIter: 最大迭代次数x: 解向量k: 迭代次数n = length(b);x = x0;k = 0;while k < maxIterx_old = x;for i = 1:nx(i) = (b(i) - A(i,1:i-1)*x(1:i-1) - A(i,i+1:n)*x_old(i+1:n)) / A(i,i); endif norm(x - x_old, inf) < tolreturnendk = k + 1;enddisp('迭代次数达到最大值,未达到容差要求'); end```4. 应用实例假设有如下线性方程组:$$\begin{cases}2x_1 - x_2 + x_3 = 5\\-x_1 + 2x_2 - x_3 = -2\\x_1 - x_2 + 2x_3 = 6\end{cases}$$系数矩阵A为:$$\begin{bmatrix}2 -1 1\\-1 2 -1\\1 -1 2\end{bmatrix}$$常数向量b为:$$\begin{bmatrix}5\\-2\\6\end{bmatrix}$$取初始解向量x0为:$$\begin{bmatrix}0\\0\\\end{bmatrix}$$容差tol为1e-6,最大迭代次数maxIter为100。

gauss伪谱法

gauss伪谱法

gauss伪谱法
高斯伪谱法(Gauss-Seidel method)是一种迭代法,用于求解线性方程组的近似解。

这种方法基于将连续优化问题转化为离散优化问题,然后使用离散化方法进行求解。

在离散化过程中,通过将连续优化问题转换为一系列离散的子问题,可以使用高斯-赛德尔迭代法进行求解。

高斯-赛德尔迭代法的原理是将原方程组转化为等价的迭代格式,并不断迭代直到收敛。

在每一次迭代中,首先使用已知的解来更新未知量,然后将更新的解代入方程组中进行下一轮迭代。

这个过程不断重复,直到满足一定的收敛条件为止。

高斯伪谱法通过将连续优化问题转换为离散优化问题,可以利用离散化方法的高效性和精度,同时保持了一定的通用性和灵活性。

该方法适用于多种不同类型的优化问题,包括线性规划、二次规划、非线性规划等。

研究生数值分析(12)高斯-赛德尔(Gauss-Seidel)迭代法

研究生数值分析(12)高斯-赛德尔(Gauss-Seidel)迭代法


X (k1) (D L)1UX (k ) (D L)1b

BG (D L)1U
(称为高斯-赛德尔(Gauss-Seidel)迭代矩阵),
fG (D L)1b
则得 X (k 1) BG X (k ) fG 为高斯-赛德尔迭代法的矩阵表示形式。
我们用定理2来判断高斯-赛德尔迭代公式是否
x (k) n

b1)

x2(k
1)


1 a11
(a21 x1( k 1)

a23 x3( k )

a2n xn(k) b2 )



xi
(
k
1)


1 aii
(ai1 x1( k 1)

a x (k1) i2 2


a x (k1) i,i1 i1

a x (k) i,i1 i1
如在例8例9中,由于系数矩阵A是严格对角 占优,由定理4立即可断定用雅可比迭代法与高斯 -赛德尔迭代法求解时,迭代过程都收敛。
4 2 2
又如矩阵
A


2
2 3
2 3 14
是对称正定阵(实对称阵是正定阵的,如果实二次型
f (x1, x2 , , xn ) X T AX
我们先引入一个叫矩阵谱半径的概念的模的最大值称为矩阵a的谱半径记作前面我们在应用雅可比迭代法与高斯赛德尔迭代法解一阶线性方程组时判断各迭代公式是收敛还是发散都要计算雅可比迭代矩阵bj与高斯赛德尔迭代矩阵bg的特征值
2 高斯-赛德尔(Gauss-Seidel)迭代法
研究雅可比迭代法,我们发现在逐个求 X (k1)

Gauss-Seidel迭代法

Gauss-Seidel迭代法

2011-2012(1)专业课程实践论文Gauss-Seidel迭代法彭泳,30号,R数学071班1.Gauss-Seidel 迭代法的基本思想由Jacobi 迭代法中,每一次的迭代只用到前一次的迭代值,若每一次迭代充分利用当前最新的迭代值,即在计算第i 个分量)1(+k ix 时,用最新分量)1(1+k x ,⋅⋅⋅+)1(2k x )1(1-+k i x 代替旧分量)(1k x ,⋅⋅⋅)(2k x )(1-k i x ,就得到所谓解方程组的Gauss-Seidel 迭代法。

其迭代格式为T n x x x x )()0()0(2)0(1)0(,,,⋅⋅⋅= (初始向量),)(11111)()1()1(∑∑-=-+=++--=i j i i j k j ij k j ij i ii i i x a x a b a x )210i 210(n k ⋅⋅⋅=⋅⋅⋅=,,,;,,,或者写为 ⎪⎩⎪⎨⎧--=⋅⋅⋅=⋅⋅⋅==∆+=∑∑-=-+=+++)(1)210i 210(1111)()1()1()()1(i j i i j k j ij k j ij i ii i i i k i k i x a x a b a x n k k x x x ,,,;,,, 2. Gauss-Seidel 迭代法的矩阵表示将A 分裂成U D L A ++=,则b x =A 等价于b x =++U)D (L则Gauss-Seidel 迭代过程)()1()1(k k k Ux Lx b Dx --=++故)()1()(k k Ux b x L D -=++若设1)(--L D 存在,则b L D Ux L D x k k 1)(1)1()()(--++++-=令b L D f U L D G 11)()(--+=--=,则Gauss-Seidel 迭代公式的矩阵形式为f Gx x k k +=+)()1(#include <stdio.h>#include <stdlib.h>#include <conio.h>#include <math.h>#define MAX_n 100#define PRECISION 0.0000001#define MAX_Number 1000void VectorInput(float x[],int n) //输入初始向量{int i;for(i=1;i<=n;++i){printf("x[%d]=",i);scanf("%f",&x[i]);}}void MatrixInput(float A[][MAX_n],int m,int n) //输入增广矩阵{int i, j;printf("\n===Begin input Matrix elements===\n");for(i=1;i<=m;++i){printf("Input_Line %d : ",i);for(j=1;j<=n;++j)scanf("%f",&A[i][j]);}}void VectorOutput(float x[],int n) //输出向量{int i;for(i=1;i<=n;++i)printf("\nx[%d]=%f",i,x[i]);}int IsSatisfyPricision(float x1[],float x2[],int n) //判断是否在规定精度内{int i;for(i=1;i<=n;++i)if(fabs(x1[i]-x2[i])>PRECISION) return 1;return 0;}int Jacobi_(float A[][MAX_n],float x[],int n) //具体计算{float x_former[MAX_n];int i,j,k;printf("\nInput vector x0:\n");VectorInput(x,n);k=0;do{for(i=1;i<=n;++i){printf("\nx[%d]=%f",i,x[i]);x_former[i]=x[i];}printf("\n");for(i=1;i<=n;++i){x[i]=A[i][n+1];for(j=1;j<=n;++j)if(j!=i) x[i]-=A[i][j]*x[j];if(fabs(A[i][i])>PRECISION)x[i]/=A[i][i];elsereturn 1;}++k;}while(IsSatisfyPricision(x,x_former,n) && k<MAX_Number);if(k>=MAX_Number)return 1;else{printf("\nG-S %d times!",k);return 0;}}int main() //主函数{int n;float A[MAX_n][MAX_n],x[MAX_n];printf("\nInput n=");scanf("%d",&n);if(n>=MAX_n-1){printf("\n\007n must <%d!",MAX_n);exit(0);}MatrixInput(A,n,n+1);if(Jacobi_(A,x,n))printf("\nG-S Failed!");else{printf("\nOutput Solution:");VectorOutput(x,n);}printf("\n\n\007Press any key to quit!\n");getch();}四、算法实现利用Gauss-Seidel 迭代法求解下列方程组⎪⎩⎪⎨⎧=++=-+=+-36123633111420238321321321x x x x x x x x x , 其中取→=0)0(x 。

Gauss-Seidel迭代法

Gauss-Seidel 迭代法从Jacobi 迭代法的格式可以看出,后一步的迭代值仅仅与前一步有关,而且先算哪一个分量是无关紧要的。

新算出来的分量无法及时地用到下一个分量的计算之中,导致收敛的速度比较慢。

如果能将新计算出来的分量及时地更新到当前要计算的分量之中,应该可以加快收敛的速度。

这就引出了Gausss-Seidel 迭代法。

对Jacobi 迭代法进行修正,得到如下的Gauss-Seidel 迭代法:1(1)()11(1)i nk k i ij jijjj j i k i iib a xa xx a −+==++−−=∑∑,1,2,,i n =⋅⋅⋅同样地,Gauss-Seidel 迭代格式也有其相应的矩阵形式。

事实上,A D L U =++,于是,Ax b =等价于()D L x b Ux +=−。

于是,得到迭代格式(1)()()k k D L x b Ux ++=−也就是(1)1(1)1()1k k k x D Lx D Ux D b +−+−−=−−+, (1)1()1()()()k k k G x D L Ux D L b L x f +−−=−+++=+,其中,1()G L D L U −=−+,1()f D L b −=+。

Gsuss-Seidel 迭代法的Matlab 程序只需要在Jacobi 迭代地程序中做少量改动即可,这里不再写出。

例2.试用Gauss-Seidel 迭代法解线性方程组1231021321011512510x x x −−⎛⎞⎛⎞⎛⎞⎜⎟⎜⎟⎜⎟−−=⎜⎟⎜⎟⎜⎟⎜⎟⎜⎟⎜⎟−−⎝⎠⎝⎠⎝⎠【解答】 迭代格式为()()23(1)1(1)()(1)132(1)(1)(1)3123210152101025k k k k k k k k k x x x x x x x x x ++++++⎛⎞++⎜⎟⎜⎟⎛⎞⎜⎟++⎜⎟=⎜⎟⎜⎟⎜⎟⎜⎟⎝⎠++⎜⎟⎜⎟⎝⎠选(0)(0,0,0)T x =作为初值和610ε−=作为控制精度,选2-范数来衡量误差。

【论文】浅析Gauss-Seidel迭代在方程迭代计算中的应用

浅析Gauss-Seidel 迭代在方程迭代计算中的应用摘要:科学研究与生产实践中许多问题都可归结为方程组的求解,对于方程组的求解,主要有直接法求解和迭代法求解,我们通常用的迭代法有Jacobi,Gauss-Seidel 迭代法。

本文主要针对Gauss-Seidel 迭代法在三类方程组迭代计算中的应用进行研究。

一、Gauss-Seidel 迭代法在求解大型稀疏线性方程组中的应用。

Gauss-Seidel 迭代法充分利用矩阵的稀疏性去解大型稀疏线性代数方程组。

本文通过实际算例验证并分析了它的计算速度和效率。

二、Gauss-Seidel 迭代法在求解H-矩阵线性方程组中的应用。

本文针对系数矩阵 A 为H -矩阵, 为线性方程组 Ax =b 引入了两种形式的预处理矩阵 I +S 和 I +S , 给出了相应的预处理 Gauss-Seidel 方法。

三、异步并行非线性对称Gauss-Seidel 迭代法在求解特殊非线性方程组的应用。

利用非线性方程组的特殊结构,建立了一类并行非线性 Gauss-Siedel 型迭代算法。

关键词:Gauss-Seidel 迭代法,线性方程组,H -矩阵,非线性方程组科学研究与生产实践中许多问题都可归结为线性方程组的求解,高效求解线性方程组成为许多科学与工程计算的核心。

解线性方程组的传统方法是利用高斯消元法或矩阵的三角分解法等直接求解,虽然传统方法具有理论上直接得到真解的优点,但当系数矩阵条件数很大时,存在严重的稳定性问题。

同时,当系数矩阵的非零元结构不规则或带宽较大时,其计算量与存储量也十分地大。

与直接法相比,迭代法只需存储原系数矩阵,对应于预处理的几个辅助矩阵和少量的几个向量,且迭代法中除求解辅助线性方程组外,其余的计算主要是系数矩阵与向量的乘积,从而能充分利用系数矩阵的特性来减少计算量。

而且随着计算机技术的发展,计算机的存储量日益增大,计算速度也迅速提高,线性方程组的迭代求解在科学与工程计算中也起着越来越重要的作用。

一类新预条件Gauss-Seidel迭代法讲诉

一类新的预条件Gauss-Seidel迭代法摘要:本文给出了一个新的预条件因子P,证明了在非奇异M矩阵和严t格对角占优L矩阵下,该预条件不仅加快了Gauss—Seidel迭代法的收敛速度,而且说明了在该预条件下Gauss—Seidel迭代法的谱半径是单调下降的.最后再用相关的数值例子说明文中给出的预条件P要优于文献中所给的预条件.t关键词:预条件;Gauss—Seidel迭代法;谱半径;收敛性;收敛速度.A New Class of Preconditioned Gauss-Seidel Interative MethodP.Abstract: This paper give a new preconditioner large sparse linear equationst In the pre condition,by using Gauss-Seidel iteration format was linear equations .we first present a preconditions factor and then prove the accelerated convergence of the iteration method by the preconditions under the nonsingular Mmatrix.Discussed the in the the Strictly Diagonally Dominant the L matrix under the conditions of, the pre-conditions to speed up the the the convergence speed of of the Gauss-Seidel iterative method, but also in the the pre-under the conditions of the the Spectral Radius of the Gauss-Seidel iterative method is monotonic declining.Finally,some numerical examples are given to explain our theoretical result.Key words:pre-conditions factor,Gauss—Seidel iteration method ,spectral radius,weak regular splitting;,convergence rate.引言在对自然科学与社会科学许多实际问题进行数值模拟时,人们最后都归结为求解一个或者一些大型稀疏矩阵方程组,因此研究大型稀疏矩阵方程组的解法是人们关注的焦点,后来人们发现迭代法是求解这种线性方程组的一类主要方法之一,但是在实际生活中,迭代矩阵的收敛性和收敛速度的改善不仅取决于迭代方法和迭代矩阵中参数的选取,而且和方程组自身的某些变化密切相关.近几年来,稀疏线性方程组的迭代解法有了很大发展,特别是预条件矩阵的引入,大大加快了迭代的收敛性和收敛速度.因此,对预条件的研究仍是一个意义深刻的课题.为了加速迭代法的收敛速度,很多学者对线性方程组提出了各种不同的预处理方法.1991年文献[]2中Guwnawardena 等人提出预条件S I P +=α,其中⎪⎪⎪⎪⎪⎪⎪⎪⎭⎫⎝⎛---=+=-1010000010*********,13,221n n a a a S I P ,α 文献[]5中提出的预条件⎪⎪⎪⎪⎪⎪⎪⎪⎭⎫⎝⎛----=+=-101000010000010000011,3,2,1,n n n n n a a a a R I Pβ 以及文献[]7中提到的预条件⎪⎪⎪⎪⎪⎪⎪⎪⎭⎫⎝⎛-------=+=--10100001000100011,,1,11,33,21,221n n n n n S aa a aa a a B I P , 本文主要考虑一种新的预条件因子⎪⎪⎪⎪⎪⎪⎭⎫⎝⎛------=++=---1000000111,,11,112321212n n n n n n t t at a a t a a t a S S I P并且新的预处理矩阵加速了Gauss-Seidel 迭代法的收敛速度. 此时,预条件Gauss-Seidel 迭代法的迭代矩阵为[])()()()(11S U U S L L D I U L D G S t S S t t -+-+--=-=--αα.1.预备知识1.1 相关定义定义[]21 设矩阵()ij n n A a ⨯=n n R ⨯∈,如果对于矩阵主对角线的元素都不小于0,而主对角线外的元素都不大于0,则称矩阵A 为L 矩阵.定义[]22 设()ij n n A a ⨯=n n R ⨯∈,矩阵M 和N 满足N M A -=,其中M 为可选择的非奇异矩阵,且使d Mx =容易求解,称M 为分裂矩阵,N M 1-为迭代矩阵,若01≥-M 和0N ≥,则称 N M A -=是A 的正则分裂;若01≥-M 和10M N -≥,则称分裂N M A -=是若正则的.定义[]33 如果(){}k x 是由迭代公式()() 2,1,0,1=+=+k f Bx x k k ,产生的序列,且满足,,lim 0n k k R x x x ∈∀=*∞→那么称()()f Bx x k k +=+1是收敛的.定义[]34 设矩阵()ij n n A a ⨯=n n R ⨯∈,A 可表示为,0A sI B B =-≥,I 为n 阶单位阵,并且当谱半径()B s ρ≤,那么A 是M 矩阵.当()B s ρ<时,则称A 是非奇异M 矩阵.定义[]45 设矩阵()ij n n A a ⨯=n n R ⨯∈,如果A 的元素满足1,||||nii ij j j i a a =≠>∑i 12,,n =,, 则称A 为严格对角占优矩阵. 1.2 相关引理引理[]41 设A 为非奇异M 矩阵,分裂2211N M A N M A -=-=和是若正则的,若1121M M --≤,20N ≥,则有111122()()M N M N ρρ--≤.引理[]32 若系数矩阵A 为严格对角占优L 矩阵,那么经过预处理后的矩阵A α是严格对角占优M 矩阵.证明 设经过预处理后所得的矩阵为()ij n n A a α⨯=.因为矩阵A 是严格对角占优L 矩阵,则有当i j ≠时10ij a -<≤,所以1101j j a a ≤<,从而有1110j j a a ->,(2,,)j n =.因此矩阵A α的对角元部分是1221233222112,11,(1,1,,1)t n n n D diag a a a a t a a t a a =---->0,对于矩阵A α的非对角元部分有1,,1,1,1,,12,,,2,,,.j ij i i i i j i j i a j n a a t a i n a t a a⎧=⎪=-=⎨⎪-⎩其它因为0,0,0,1,,1,1,1,,1≤≤-≤-≤j i i j i j i i i i j a a a t a a t a a .矩阵t A 的非对角元部分是不大于0的,所以矩阵t A 是L 矩阵.记(1,1,,1)a =,则有111(,,)0nnT j nj j j Aa a a ===∑∑>.又因为0≥++=S S I P t t ,所以0>=Aa P A t t .引理[]43 设矩阵()ij n n A a ⨯=n n Z ⨯∈,则有以下两个等价性质 (1)存在向量x ,使得 0>Ax ; (2)矩阵A 是非奇异M 矩阵.引理[]54 设矩阵()ij n n A a ⨯=n n Z ⨯∈为非奇异M 矩阵,n n B Z ⨯∈,若有B A ≥,则1A -,1B -都存在且110A B --≥≥.引理[]35 若A 为严格对角占优矩阵且A 为L 矩阵,则10A -≥并且A 为非奇异M 矩阵.证明 由于A 是严格对角占优矩阵,则有1,||||nii ij j j ia a =≠>∑ i 1,2,,,n =成立,从而有1,|||0nii ij j j i a a =≠-∑>.记(1,1,,1)a =,有111(,,)nnT j nj j j Aa a a ===∑∑.又由于A 为L 矩阵,则对,0ij i j a ∀=≥且,0ij i j a ∀≠≤,从而有11,1,||||0n n nij ii ij ii ij j j j ij j ia a a a a ==≠=≠∑=-∑=-∑>.即0Aa >.所以,由引理2得A 为非奇异M 矩阵.由定义4 知10A -≥.2.主要结论2.1 新预条件下Gauss-Seidel 迭代法的收敛定理 定理1 线性方程组b Ax = , (1) 其中A 为严格的对角占优L 矩阵,若γβ≤,即2,3,,,i n ∀=都有i i γβ≤,12(,,,)n γγγγ=,12(,,,),n ββββ=并且[0,1],[0,1]i i γβ∈∈,2,3,,,i n ∀=G γ表示用P I S γγ=++S 预处理矩阵A后的迭代矩阵,G β表示用P I S ββ=++S 预处理矩阵A 得到的迭代矩阵,I. 若对于(],,,2,1,0n i i =∈α有1)()(<≤γβρρG G .II. 若A 为非奇异且是不可约的M 矩阵,则对于任意的(]1,,110,10,,2,3,,,i i i t i n a a ⎛⎫∈= ⎪ ⎪⎝⎭都有以下结论1) 若0()1G γρ<<,有()()G G βγρρ≤;2) 若()1G γρ=,有()()G G βγρρ=; 3) 若()1G γρ>,有 ()()G G βγρρ≥.证明 I 因为矩阵A 是严格的对角占优L 矩阵,所以A 为非奇异M 矩阵且矩阵,A A βγ是严格对角占优非奇异M 矩阵.若令,A A βγ的分裂如下()()()ββββββββββF E S U U S L L D I U L D A S S S -=-+--+--=--=,()()()γγγγγγγγγβF E S U U S L L D I U L D A S S S -=-+--+--=--=,其中()()S U U F S L L D I E S S S -+=-+--=ββββββ,,()()S U U F S L L D I E S S S -+=-+--=γγγγγγ,,由定理1的证明可知,A E F E F ββγγ=-=-是矩阵A 的两个弱正则分裂. 因为有γβ≤,()()()()()[]S U U S L L D I S U U S L L D I E E S S S S S S -+--+----+--+--=-γγγγββββγβ)( ()()0s s s s D D S S L L γββγγβ=-+-+-≤ , 所以E E γβ≥,由引理4可得11E E γβ--≤,又0F γ≥.从而由引理1知11()()1E F E F ββγγρρ--≤<.由于11,E F G E F G γγγβββ--==,所以有()()1G G βγρρ≤<.II 因为系数矩阵A 是非奇异不可约M 矩阵,从而由引理3可得()A S S I A t t ++=也是非奇异不可约M 矩阵. 由于,0,0,1≥+≥--=-t t t t t t t U L D U L D A则t t t t U L D A --=是矩阵t A 的一个M 分裂,(),1t t t t U L D G --=从而由引理1知,存在一个正向量x ,使得(),x G x G t t ρ=令()t G ρλ=,由定理1知()()[]()()()()[]()x U L D S L L D I xx S U U S L L D I x x G S S S S S S S S ++-+---=--+-+--=---111βββλλλ因为()()[]()01≥++-+--=-x U L D S L L D I y S S S S S β,所以当0()1G γρ<<时,有01λ<<,(1)0G x x y βλλ-=-≤,即G x x βλ≤.又由引理3得()λρ≤t G , 则()()G G βγρρ≤;同理可证()1G γρ=,()()G G βγρρ=;()1G γρ>,()()G G βγρρ≥.2.2 新预条件下矩阵谱半径的分析与比较定理2 线性方程组(1)的系数矩阵A 为严格对角占优L 矩阵, 矩阵A 的Gauss-Seidel 迭代矩阵用G 表示,在预条件S S I P t t ++=下系数矩阵t A 的Gauss-Seidel 迭代矩阵用t G 表示,I. 则有对于任意的(]0,1,2,,,i t i n ∈=都有()()G G t ρρ<.II. 若A 为非奇异不可约M 矩阵,则对任意的(]1,,110,10,,2,,,i i i t i n a a ⎛⎫∈= ⎪ ⎪⎝⎭有1) 若0()1G ρ<<,则()()G G t ρρ<; 2) 若()1G ρ=,则()()G G t ρρ=; 3) 若()1G ρ>,则()()G G t ρρ≥.证明 I 因为矩阵A 是严格对角占优L 矩阵,所以A 为非奇异M 矩阵且矩阵t A 为严格对角占优非奇异M 矩阵.若令t A 的分裂如下t t S t S S t t t t F E S U U S L L D I U L D A -=-+--+--=--=)()()(其中()S U U F S L L D I E s t t S S t -+=-+--=,)(,由引理2的证明可知,矩阵t A 的对角元部分都是正的,非对角元部分都是非正的,因此t E 是严格对角占优L 矩阵,又由引理5得,0F ,0≥≥t t E所以有01≥-t t F E .令,)(,)(11t t t t t t F S S I N E S S I M --++=++=由于,0)(11≥++=--t t t S S I E M且))((11≥=++++=--t t t t t t t t F E F S S I S S I E N M又()()(),11t t t t t t t N M F E S S I A S S I A -=-++=++=--则分裂t t N M A -=是弱正则.令L I M -=,U N =,有N M U L I A -=--=,由于矩阵A 是严格对角占优L 矩阵,则M 是严格对角占优L 矩阵,又由引 5得10M -≥.又知0N ≥,从而有10M N -≥.所以分裂N M A -=是弱正则的. 由于()()()()()()[],11t S S t tt t S L L D I S S I L I E S S I L I M M -+--++--=++--=---又0=L S t ,,0=S t D S 0=S t L S ,因而0≥++=-S S S t U L D M M ,所以有t M M ≥,由引理4得11--≤t M M ,0N ≥.由引理1得()()111<≤--N M N M t t ρρ.由于1M N G -=,()t t t t t t t t t G F E F S S I S S I E N M ==++++=----1111)(,因而()()1<≤G G t ρρ.II 由于系数矩阵A 是非奇异不可约的M 矩阵,且()A I L U =--为矩阵A 的一个M 分裂,1()G I L U -=-,由引理1可得,存在一个正向量x ,使得()Gx G x ρ=,又由引理5可知,()A S S I A t t ++=是一个非奇异M 矩阵.因为1221233222112,11,(1,1,,1)t n n n D diag a a a a t a a t a a =---->0,所以()()t S S S L L D I -+--是非奇异的,且)()()(S U U S L L D I A S t S S t -+--+--=是t A 的一个M 分裂.由于()()[]()()()()[]()x U L D S L L D I x x S U U S L L D I x x G S S S t S S S t S S t ++-+---=--+-+--=---111λλλ以及()()[]()01≥++-+--=-x U L D S L L D I y S S S t S S , 所以有当0()1G ρ<<时,(),01≤-=-y x x G t λλ即,x G λα≤又知,()λρ≤t G ,则()()G G t ρρ≤.同理可得()1G ρ=,()()G G t ρρ=; ()1G ρ>,()()G G t ρρ≥.3.数值例子设线性方程组的系数矩阵⎪⎪⎪⎪⎪⎭⎫ ⎝⎛------------=14.03.02.02.012.03.04.03.012.01.03.03.01A (1) 取,32n t t t === 分别用t s G G G G ,,,βα表示在预条件t s P P P P ,,,βα预处理矩阵A 后得到的高斯-塞德尔迭代矩阵,当()n i t i ,,3,2 =取不同值时,()()()()t s G G G G ρρρρβα,,,的所得值如表一 i t 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 ()αρG 0.5578 0.5578 0.5578 0.5578 0.5578 0.5578 0.5578 0.5578 0.5578 ()βρG 0.5415 0.5415 0.5415 0.5415 0.5415 0.5415 0.5415 0.5415 0.5415 ()s G ρ 0.5305 0.5305 0.5305 0.5305 0.5305 0.5305 0.5305 0.5305 0.5305 ()t G ρ 0.5275 0.5176 0.5061 0.4954 0.4849 0.4716 0.4595 0.4452 0.4298 (表一)因为s G G G ,,βα中都不含参数()n i t i ,,3,2 =,所以()()()s G G G ρρρβα,,不会受参数i t 的影响,从上表格知:()()()()t s G G G G ρρρρβα>>>=0.5275,因此,该预条件t t S S I P ++=加快了高斯-塞德尔迭代法的收敛速度.(2) 取n βββ=== 32,t G 表示用t t S S I P ++=预处理矩阵A 后得到的高斯塞德尔迭代矩阵,G β表示用ββS S I P ++=预处理矩阵A 后得到的高斯塞德尔迭代矩阵,当i t 、i β()n i ,,3,2 =取不同的值时,()t G ρ和()G βρ的比较值如表二(表二)由上表格可看出,当t ≥β时,有()()t G G ρρβ≤,即该预条件下Gauss-Seidel 迭代法的谱半径是单调下降.4.结束语由于预条件的引入能够加快线性方程组的收敛速度,所以得到很多学者的关注.本文给出了一个新的预条件S S I P t t ++=,讨论了当A 为非奇异M 矩阵,严格对角占优L 阵时该方法的收敛性,并得到了相应的结论.虽然该预条件加速了迭代法的收敛性,但收敛速度仍然不能令人满意.因此,高斯塞德尔方法结合预处理技术仍是很多学者感兴趣的问题.随着计算机的发展,预处理技术在不断创新,同时预条件迭代法也越来越广泛的用于解大型稀疏线性方程组.i t0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 i β0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 ()t G ρ 0.5275 0.5176 0.5061 0.4954 0.4849 0.4716 0.4595 0.4452 ()G βρ 0.5162 0.5061 0.4953 0.4838 0.4717 0.4595 0.4452 0.4297参考文献[1]KOHNO T,KOTAKEMORI H,NIKI H.Improving modified iterative methods for Z·matrices[J].Liner Algebra and Its Application,1997,267:ll3-123[2] 黄廷祝,杨传胜.特殊矩阵分析及应用[M].北京:科学出版社,2007:1.33.[3] 宋永忠.线性方程组迭代解法[M].南京:南京师范大学出版社.l992:37.[4] 张谋成,黎稳.非负矩阵论[M]. 广州:广东高等教育出版社,1995 :43-76.[5] LI Wen,SUN Weiwei.Modified Gauss·Seidel type methods and Jacobi type methods[J].Linear Algebra and Its Application,2000,3 l 7:227-240.[6] HIROSHI NIKI,KYOUJI HARADA,MUNENORI MORMOTO,et a1.The survey of preconditiononers used for accelerating the rate of convergence in the Gauss—Seidel method[J].Journal of Computational and Applied Mathematics,2004,1 65(5):587—600.[7] LI W.SUN W W.Modified Gauss-seidel type methods and Jacobi type methods for z—matrices[J].Linear Algebra App1.2000,317(1):227—240.[8] SONG Y Z.Comparisons of nonnegative splittings of matrices [J].Linear Algebra App1,1991:154—156,433—455.[9] 徐树方.矩阵计算的理论与方法[M].北京:北京大学出版社,1995:121—122.[10] 戴华.矩阵论[M].北京:科学出版社,2001:283—284.[11] 蒋美群.加速松弛迭代法的最优因子[J].数学研究与评论,1995,15(3):423-427.[12] 胡家赣.推广的迭代矩阵的收敛性[J].计算数学,1984,6(2):174-181.[13] 张引.SAOR方法的收敛性[J].计算数学,1988,10(2):201-204.[14] 胡家赣.推广的迭代矩阵的收敛性[J].计算数学,1984,6(2):174-181.[15] 魏小梅,畅大为.相容次序矩阵SAOR方法的最优参数估计 [J].内蒙古师范大学学报(自然科学汉文版),2007年第02期.。

高斯赛德尔法


近似最佳加速因子改进高斯-赛德尔法潮流计算
高斯-赛德尔潮流计算方法的收敛性比较缓慢, 为提高算法 的收敛速度, 常用的一种方法是在迭代过程中加入加速因子, 一般是首先给出α 的取值范围( 通常取1< α<2) , 然后采用 试探法在给定的范围内求得一个最佳收敛因子, 其工作量很 大。 最佳加速因子理论是由Young于1950 年提出的,他给出的 最佳加速因子公式为
( x (0 ) = (x1(0 ) , x20 ) , x3(0 ) ) = (0 ,0 ,0 ,)
x
( k +1 ) i
i 1 n 1 ( k +1 ) = [ bi ∑ aij x j ∑ aij x(j k ) j =1 j =i +1 aii
]
高斯-赛德尔迭代
i = 1,2,Ln,
k = 0,1,2,...
的系数矩阵A可逆且主对角元素都不为零,令
)
并将A分解成
A = (A D) + D
Dx = (D A)x + b 从而方程可以写成 x = B1 x + f1 令 B = I D A, f = D b 其中
1 1 1 1
以 B 为迭代矩阵的迭代法 称为雅克比迭代法。
1
x ( k +1) = B1 x ( k ) + f1
x = B2 x + f 2 即 B = (D L ) U , f = (D L ) 其中 以 B2 为迭代矩阵的迭代法 x ( k +1) = B2 x ( k ) + f 2 称为高斯-赛德尔迭代法。
1 2 2
1
b
用高斯-赛德尔迭代法求解上例 解:取初值 x ( ) = (x ( ) , x ( ) , x ( ) ) = (0 ,0 ,0 ,) ,按迭代公式
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
g range atmospheric air pollution models are computationally very expensive 10]. Usually the computational work is heavily dominated by the numerical treatment of the sti ODE systems describing the chemical kinetics model in use. These ODE systems are of the nonlinear form d y = f (t; y) := P (t; y) ? L(t; y)y; y(t) = (y (t); ::: ; y (t))T ; (1:1) 1 m dt where P (t; y) is a vector and L(t; y) a diagonal matrix. The components Pk (t; y) and Lk (t; y)yk are nonnegative and represent, respectively, production and loss terms. The reciprocal of Lk is the physical time constant or characteristic reaction time for compound yk . Generally the range of time constants is large, which implies that in most applications the ODE system is sti . For example, if we assume that the popular operator splitting approach is used, then a common situation is that (1.1) must be solved repeatedly, over several hundreds of split-step time intervals, at any of thousands of grid points. As a rule the length of this time interval is the stepsize used in the advection step, which for part of the chemical species occurring in atmospheric applications is much larger than the time constant. This introduces the sti ness. When the chemistry is nonlinear and many species are involved, say 20 to 50, it is clear that a highly e cient sti solver, tailored to the application under
Gauss-Seidel Iteration for Sti ODEs from Chemical Kinetics
CWI P.O. Box 94079, 1090 GB Amsterdam, The Netherlands
J.G. Verwer
A simple Gauss-Seidel technique is proposed which exploits the special form of the chemical kinetics equations. Classical Aitken extrapolation is applied to accelerate convergence. The technique is meant for implementation in sti solvers that are used in long range transport air pollution codes using operator splitting. Splitting necessarily gives rise to a great deal of integration restarts. Because the Gauss-Seidel iteration works matrix free, it has much less overhead than the modi ed Newton method. Start-up costs therefore can be kept low with this technique. Preliminary promising numerical results are presented for a prototype of a second order BDF solver applied to a sti ODE from atmospheric chemistry. A favourable comparison with the general purpose BDF code DASSL is included. The matrix free technique may also be of interest for other chemically reacting uid ow problems. 1991 Mathematics Subject Classi cation: Primary: 65L05. Secondary: 80A30, 80A32. 1991 CR Categories: G1.8. G1.1 Keywords & Phrases: numerical sti ODEs, chemical kinetics, air pollution modelling. Note: This paper is one of a series on the development of algorithms for long range transport air pollution models (projects EUSMOG and CIRK). The RIVM { the Dutch National Institute of Public Health and Environmental Protection { is acknowledged for nancial support.
1. Introduction
consideration, is indispensable. Due to the great number of restarts, one for each split-step time interval, it is particularly important to use integrators which keep the inevitable start-up costs low, in comparison with a common sti ODE integration. In addition, the integrator must be able to change stepsize rapidly with little costs because in practice rate coe cients in atmospheric chemistry models are temperature or time dependent. This dependency can cause sudden changes in the concentrations, which can be followed accurately and e ciently only if stepsizes can be adjusted e ciently. The purpose of this note is to present some preliminary, but promising results of a simple Gauss-Seidel iterative technique for solving implicit relations. Because this technique works matrix free, a change of stepsize involves no numerical algebra overhead at all. This results in low start-up cost compared to Newton type iteration. The Gauss-Seidel technique is very cheap in the start-up phase where usually a few iterations are su cient. When the stepsize increases, the convergence will normally slow down. In the experiments reported in this note we have successfully applied classical Aitken extrapolation to accelerate convergence over a wide range of stepsizes. So far only a single extrapolation step has been considered. In the near future more sophisticated acceleration techniques will be the subject of further investigation. Moreover, switching between Gauss-Seidel and modi ed Newton iteration will be examined. We also experimented with Jacobi iteration, but less successfully. In the experiments reported here, the Gauss-Seidel technique signi cantly improved convergence, especially for larger stepsize values. Yet Jacobi iteration may be of interest in the initial transient phase, because one Jacobi iteration is always cheaper than one Gauss-Seidel iteration. For simplicity of presentation, in this note we focus on Gauss-Seidel iteration. We have implemented the Gauss-Seidel iteration process in a prototype of a new solver. This prototype uses as the main integrator the variable step, second order BDF formula
相关文档
最新文档