欢迎来到天天文库
浏览记录
ID:23150073
大小:105.50 KB
页数:7页
时间:2018-11-05
《hilbert矩阵病态线性代数方程组的求解》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、实验一病态线性代数方程组的求解1.估计Hilbert矩阵2-条件数与阶数的关系运行tiaojianshu.m输入m=10可以得到如下表的结果阶数12345条件数119.28524.051.55e+44.76e+5阶数678910条件数1.49e+74.75e+81.52e+104.93e+111.60e+132.选择不同维数,分别用Guass消去(LU分解),Jacobi迭代,GS迭代,SOR迭代求解,比较结果。说明:Hx=b,H矩阵可以由matlab直接给出,为了设定参考解,我们先设x为分量全1的向量,求出b,然后将H和b作为已知量,求x,与设定的参考解对比。对
2、于Jacobi迭代,GS迭代,SOR迭代,取迭代初值x0为0向量,迭代精度eps=1.0e-6,迭代次数<100000,SOR迭代中w=1.2和0.8分别计算。a.n=5x分量Gauss法J迭代GS迭代SOR迭代实际解xw=1.2w=0.8x(1)1.0000-8.81790.99980.99990.99981x(2)1.0000-Inf1.00281.00191.00311x(3)1.0000-Inf0.98790.99190.98631x(4)1.0000-Inf1.01811.01201.02091x(5)1.0000-Inf0.99120.99420.98
3、971迭代次数14229221603147b.n=8x分量Gauss法J迭代GS迭代SOR迭代实际解xw=1.2w=0.8x(1)1.00001.18981.00011.00021.00001x(2)1.0000Inf0.99740.99610.99861x(3)1.0000Inf1.01361.02011.00821x(4)1.0000Inf0.97940.96820.98751x(5)1.0000Inf0.99821.00340.99691x(6)1.0000Inf1.01411.01631.01031x(7)1.0000Inf1.01011.01041.00
4、891x(8)1.0000Inf0.98700.98510.98941迭代次数834278409473c.n=10x分量Gauss法J迭代GS迭代SOR迭代实际解xw=1.2w=0.8x(1)1.0000-0.50271.00011.00011.00021x(2)1.0000-1.17630.99820.99880.99741x(3)1.0000-1.64651.00561.00291.00871x(4)1.0000-Inf0.99931.00310.99611x(5)0.9999-Inf0.99160.99080.99041x(6)1.0004-Inf0.996
5、80.99640.99741x(7)0.9994-Inf1.00521.00441.00681x(8)1.0006-Inf1.00871.00811.01021x(9)0.9997-Inf1.00391.00391.00411x(10)1.0001-Inf0.99040.99140.98861迭代次数269512960821276d.n=15x分量Gauss法J迭代GS迭代SOR迭代实际解xw=1.2w=0.8x(1)1.00001.60600.99990.99980.99991x(2)1.0000Inf1.00351.00381.00231x(3)0.9995I
6、nf0.98210.98190.98771x(4)1.0059Inf1.02361.02361.01531x(5)0.9656Inf1.00741.00431.00821x(6)1.0813Inf0.99020.99270.99361x(7)1.1155Inf0.98560.98850.98751x(8)-0.3001Inf0.99050.99190.99051x(9)4.8294Inf0.99900.99850.99811x(10)-4.9705Inf1.00681.00491.00561x(11)6.0398Inf1.01131.00891.01041x(12
7、)-0.5735Inf1.01131.00931.01081x(13)0.1389Inf1.00661.00581.00661x(14)1.8886Inf0.99750.99840.99791x(15)0.7794Inf0.98440.98740.98521迭代次数144982877515243取不同的n值,得到如下结果:对于Guass法,可以看出来,随着n的增大,求解结果误差变大,这是因为随着n增大,系数矩阵的条件数变大,微小的扰动就容易造成很大的误差。最后得不到精确解。对于Jacobi迭代,计算结果为Inf,说明是发散的。对于GS迭代和SOR迭代,结果是收敛的
8、,但是可以
此文档下载收益归作者所有