资源描述:
《现代数值计算方法(matlab版)第2章(2)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、福建师范大学yêO{数计学院1/12JJII1Ù)5§
2、S{JIBackClose1Ù)5§
3、S{福建师范大学数计学院§2.2ä'S{2/12§2.2.1Súª9ÙÏ^§Séu§
4、(2.1),aii6=0,i=1,···,n,±Xnaiixi=bi−aijxj,i=1,···,n,j=1,j6=iJJ=II1XnJxi=bi−aijxj,i=1,···,n.aiiIj=1,j6=iBackCloseÙASúª1Xn(k+1)(k)xi=bi−aijxj,i=1,···,n.(2.11)aii福建师范大学j=1,j6=i数计学院Súª(2.11)¡ä'(Ja
5、cobi)S{.3/12BuÂñ5©Û,ò©þ/ªSúª(2.11)U¤Ý/ª.-N=D=diag(a11,a22,···,ann),Ïaii6=0,i=1,···,n,NÛÉ.éA©JJA=(A−D)+D,IIK§
6、Ax=bUJIDx=(D−A)x+b,BackCloseÏdk−1−1x=D(D−A)x+Db.ASúª福建师范大学数计学院(k+1)−1(k)−1x=D(D−A)x+Db(2.12)4/12{P(k+1)(k)x=BJx+fJ,(2.13)Ù¥B=D−1(D−A)=I−D−1A,f=D−1b.Súª(2.12)½JJ(2.13)¡JacobiS,Ó¡
7、(2.13)¥BJJacobiSÝ.JJe¡ÑJacobiS{äN{Ú½µII{2.1(JacobiS{)J(0)IÚ1Щ:x,°Ý¦ε,SgêN,k:=0¶BackÚ2d(2.11)½(2.12)Ox(k+1)¶CloseÚ3ekx(k+1)−x(k)k≤ε,KÊ,ÑÑx(k+1)§
8、∞Cq)¶Ú4ek=N,KÊ,ÑÑS}&E¶ÄKk:=k+1,福建师范大学数计学院=Ú2.5/12â{2.1,?MATLAB§SXeµ•JacobiS{MATLAB§S%majacobi.mfunctionx=majacobi(A,b,x0,ep,N)JJ%^åµ^JacobiS{)5§
9、
10、Ax=bII%ªµx=majacobi(A,b,x0,ep,N)AXêÝ,bmàJ%þ,x0Щþ(%@"þ),ep°Ý(%@1e-6),IBack%NSgê(%@500g),x£Cq)þClosen=length(b);ifnargin<5,N=500;endifnargin<4,ep=1e-6;end福建师范大学数计学院ifnargin<3,x0=zeros(n,1);end6/12x=zeros(n,1);k=0;whilek11、fnorm(x-x0,inf)12、µ数计学院0.76−0.01−0.14−0.16x10.687/12−0.010.88−0.030.06x21.18=−0.14−0.031.01−0.12x30.12−0.160.06−0.120.72x40.74Щ:
13、x(0)=(0,0,0,0)T,°Ý¦ε=10−6.JJ)3MATLAB·-I1§Smajacobi.mµII>>A=[0.76-0.01-0.14-0.16;-0.010.88-0.030.05;JI-0.14-0.031.01-0.12;-0.160.05-0.120.72];Back>>b=[0.681.180.120.74]’;Close>>x=majacobi(A,b)O(Jµ福建师范大学数计学院k=138/12x=1.276162610266191.298063927395650.489042013922581.30273287985933JJ§2.1.2Âñ5©
14、ÛIIJéuJacobiS{,·ke¡Âñ5½n.IBackClose½n2.6e5§
15、(2.1)XêÝA÷ve^,KJacobiSÂñµPn
16、aij
17、(1)kBk=max<1福建师范大学J∞¶数计学院ij=1,j6=i
18、aii
19、Pn
20、aij
21、9/12(2)kBJk1=max<1¶ji=1,i6=j
22、ajj
23、Pn
24、aji
25、(3)kBTk=max<1.J∞ij=1,j6=i
26、aii
27、y(1)éuJacobiS,Xn
28、a
29、JJijρ(BJ)≤kBJk∞=max<1,i
30、aii
31、