1 / 11

§1 Jacobi 法和 Gauss - Seidel 法

k x 1 (k) x 2 (k) x 3 (k). 1 2 3 4 5 6 7 8 9 10. 第四章 求解线性方程组迭代法. §1 Jacobi 法和 Gauss - Seidel 法.  Jacobi 迭代法. 取初值 x 1 (0) =x 2 (0) =x 3 (0) =0 迭代结果如下:. 建立迭代公式. 精确解: x 1 * =1.1 x 2 * =1.2 x 3 * =1.3. 建立迭代公式. Jacobi 迭代公式. 输入 x I , e , N. k =0.

melosa
Download Presentation

§1 Jacobi 法和 Gauss - Seidel 法

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. k x1(k) x2(k) x3(k) 1 2 3 4 5 6 7 8 9 10 第四章 求解线性方程组迭代法 §1 Jacobi 法和 Gauss - Seidel 法  Jacobi 迭代法 取初值x1(0)=x2(0)=x3(0)=0 迭代结果如下: 建立迭代公式 精确解: x1*=1.1 x2*=1.2 x3*=1.3

  2. 建立迭代公式 Jacobi 迭代公式

  3. 输入xI,e,N k =0 Y 解方程组 N k k+1 xi yi N k>=N Y 输出迭代失败 输出yi Jacobi算法流程图 关键: 1 xi ,yi存储旧值,新值 2 误差控制

  4. 输入xI,e,N k =0 Y N k k+1 xi yi N k>=N Y 输出迭代失败 输出yi for(k=0;k<n;k++){ maxe=0; for(i=0;i<3;i++) { s=0; for(j=0;j<3;j++) if(j!=i)s=s+a[i][j]*x[j]; y[i]=(b[i]-s)/a[i][i]; if(fabs(y[i]-x[i])>e1) maxe=fabs(y[i]-x[i]); } if(maxe<e) { for(i=0;i<3;i++) printf("%f ",y[i]); break; } for(i=0;i<3;i++) x[i]=y[i]; } if(k>=n)printf("the iteration is failed");

  5. k x1(k) x2(k) x3(k) 1 2 3 1.16440 1.28205 1.29777 0.72000 1.04308 1.09313 0.90200 1.06719 1.19572  Gauss - Seidel迭代法 建立迭代公式 取初值x1(0)=x2(0)=x3(0)=0 迭代结果如下: 立刻用新值替换旧值,进行剩下的运算

  6. 建立迭代公式 Gauss - Seidel迭代公式 一般Gauss - Seidel 迭代要比Jacobi 迭代收敛快 有时Gauss-Seidel法收敛时,Jacobi法可能不收敛; 而Jacobi法收敛时, Gauss-Seidel法也可能不收敛。

  7. 输入xI,e,N k 0 yi xi Y 解方程组 N k k+1 xi yi N k>=N Y 输出迭代失败 输出yi Gauss - Seidel算法流程图 关键: 1 计算公式中的旧值,新值可以功用一套内存单元 2 误差控制

  8. 注:1 实质是对上一步结果和Gauss-Seidel迭代值进行加权平均 2对任意初值收敛的必要条件 3为加大Gauss-Seidel迭代值的比重, 超松弛迭代法(SOR法) 迭代 加速 松弛因子

  9. U L D A = 迭代公式的矩阵表示

  10. Jacobi迭代

  11. 迭代矩阵G,收敛性与G相关 Gauss - Seidel 迭代 矩阵形式:

More Related