高数线性代数 第四章 解线性方程组的迭代法2

上传人:woxinch****an2018 文档编号:45055811 上传时间:2018-06-15 格式:PPT 页数:12 大小:653KB
返回 下载 相关 举报
高数线性代数 第四章  解线性方程组的迭代法2_第1页
第1页 / 共12页
高数线性代数 第四章  解线性方程组的迭代法2_第2页
第2页 / 共12页
高数线性代数 第四章  解线性方程组的迭代法2_第3页
第3页 / 共12页
高数线性代数 第四章  解线性方程组的迭代法2_第4页
第4页 / 共12页
高数线性代数 第四章  解线性方程组的迭代法2_第5页
第5页 / 共12页
点击查看更多>>
资源描述

《高数线性代数 第四章 解线性方程组的迭代法2》由会员分享,可在线阅读,更多相关《高数线性代数 第四章 解线性方程组的迭代法2(12页珍藏版)》请在金锄头文库上搜索。

1、2 线性方程组的误差分析 /* Error Analysis for Linear system of Equations */求解 时,A 和 的误差对解 有何影响? 设 A 精确, 有误差 ,得到的解为 ,即绝对误差放大因子又相对误差放大因子2 Error Analysis for . 设 精确,A有误差 ,得到的解为 ,即Wait a minute Who said that ( I + A1 A ) is invertible?(只要 A充分小,使得是关键 的误差放大因子,称为 A的条件数,记为cond (A) , 越 则 A 越病态, 难得准确解。大2 Error Analysis

2、for . 注: cond (A) 的具体大小与 | | 的取法有关,但相对 大小一致。 cond (A) 取决于A,与解题方法无关。 常用条件数有:cond (A)1cond (A)cond (A)2特别地,若 A 对称,则条件数的性质: A可逆,则 cond (A)p 1; A可逆, R 则 cond ( A) = cond (A) ; A正交,则 cond (A)2=1; A可逆,R正交,则 cond (RA)2 = cond (AR)2 = cond (A)2 。2 Error Analysis for . 精确解为例 : 计算cond (A)2 。A1 = 解:考察 A 的特征根39

3、206 1 测试病态程度:给 一个扰动,其相对误差为此时精确解为2.0102 200%2 Error Analysis for . 例:Hilbert 阵cond (H2) = 27cond (H3) 748cond (H6) =2.9 106cond (Hn) as n 注:一般判断矩阵是否病态,并不计算A1,而由经验 得出。 行列式很大或很小(如某些行、列近似相关) ; 元素间相差大数量级,且无规则; 主元消去过程中出现小主元; 特征值相差大数量级。2 Error Analysis for . 近似解的误差估计及改善:设 的近似解为 ,则一般有cond (A)误差上限 改善方法 :Step

4、 1: 近似解Step 2:Step 3:Step 4:若 可被精确解出,则有就是精确解了。经验表明:若 A 不是非常病态(例如: ), 则如此迭代可达到机器精度;但若 A 病态,则此算法也 不能改进。HW: p.66 #2, #4, #53 Jacobi 法和 Gauss - Seidel 法/* Jacobi the matrix entries a ; the entries b ; the initial approximation X0 ; tolerance TOL; maximum number of iterations Nmax. Output: approximate so

5、lution X or a message of failure. Step 1 Set k = 1; Step 2 While ( k Nmax) do steps 3-6 Step 3 For i = 1, , nSet ; /* compute xk */Step 4 If then Output (X ); STOP; /* successful */ Step 5 For i = 1, , n Set X 0 = X ; /* update X0 */ Step 6 Set k +; Step 7 Output (Maximum number of iterations exceed

6、ed); STOP. /* unsuccessful */What if aii = 0?迭代过程中,A 的元素 不改变,故可以事先调整好 A 使得 aii 0,否则 A不可逆。必须等X(k)完全计算 好了才能计算X(k+1),因此 需要两组向量存储。A bit wasteful, isnt it?3 Jacobi If the matrix has a zero column, print the message “Matrixhasazero column. No uniquesolutionexists.n”. If the method fails to give a solution

7、 after N iterations, print the message “Maximumnumberof iterationsexceeded.n”. If there is an entry of that is out of the range , print the message “No convergence.n”.The outputs of two test cases must be seperated by a blank line.Sample Input ( represents a space) 3 10109 11027 04106 0.0000000011000 3 3101 3600 3304 0.0000000011000 1Sample Output ( represents a space) 1.00000000 1.00000000 1.00000000Matrixhasazerocolumn.Nounique solutionexists.

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 中学教育 > 高中教育

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号