资源描述:
《硕士研究生数值分析上机实验》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、数值分析上机实验1、已知A与b_12.384122」15237-1.0610742.11523719.141823-3.125432-1.061074-3.12543215.5679141.112336-1.0123453」23848A=-0」135842.1897362.0314540.7187191.5638491.8367421.742382-0.784165-1.0567813.0678131.1123480.336993-2.0317433.123124-1.010103B=[2.187436933.992318-25.1734171.112336
2、41135840.718719-1.0123452.1897361.5638493.1238482.0314541.83674227.1084374.101011-3.7418564.10101119.8979180.431637-3.7418560.4316379.7893652.101023■3・111223-0.103458-0.718282.121314-1.103456-0.0375851.7843170.2384170.846716951.784317-86.6123431.7423823.067813-2.031743-0.7841651.11
3、23483.123124-1.0567810.336993-L0101032.101023-0.71828-0.037585-3.1112232.1213141.784317-0.103458-1.1034560.23841714.71384653.123789-2.2134743.12378930.7193344.446782-2.2134744.44678240.00001_1.11012304.71934556784392](2)用超松弛法求解Bx二b(取松弛因子=0,迭代9次)。(3)用列主元素消去法求解Bx=bo解:(2)用超
4、松弛法求解Bx=b:(一)、超松弛法的理论依据为:对于J方法或GS方法有时收敛速度较慢,松弛法针对加快收敛速度提出来的。其基本思想是在GS方法已求111X(m),X(m-1)的基础上,经过重新组合得到新序列,而此新序列收敛速度加快。组合时川到松弛因了co,当co>l时称为超松弛法,当3>1时,可以加快收敛速度。若A为对称正定阵,则当松弛因子3满足0〈3〈2时,松弛法收敛。本题中(0=1.4。超松弛法为:Xi仲)=(1・(0)治伸")+co(<1?必严)+£Xj^^+gi)y=l;=/+1(二)、计算程序(C语言)#include"stdio.h”#inclu
5、dcnmath.h"main(){intdoublet=0,s=0,w=1.4,g[9],B[9][9],x[9]={0,0,0,0,0,0,0,0,0};给出初始条件和松弛因子doubleb[9]={2.1874369,33.992318,-25.173417,0.84671695,1.784317,-86.612343,1.1101230,4.719345,-5.6784392},A[9][10]={{12.38412,2.115237厂1.061704,1.112336,・0.113584,0.718719,1.742382,3.067813,2031
6、743},{2.115237,19.141823,-3.125432,-1.012345,2.189736,1.563849,-0.784165,1.112348,3.123124{■1.061074,3125432,15.567914,3.123848,2.031454,1.836742,-1.056781,0.336993,-1.010103},{1」12336,-1.012345,3.123848,27.108437,4.101011,-3.741856,2J01023,-0.71828,-0.037585{-0.113584,2.189736,2.0
7、31454,4.010111,19.897918,0.431637,-3.111223,2.121314,1.784317}{0.718719,1.563849,1.836742,-3.741856,0.431637,9.789365,-0.103458,-1.103456,0.238417}{1.742382,-0.784165,-1.056781,2.101023,-3.111223,-0.10345&14.7138465,3.123789,-2.213474},{3.067813,1」12348,0.336993,-0.71828,2.121314,-
8、1.103456,3」23789,30.719334