欢迎来到天天文库
浏览记录
ID:46255533
大小:110.96 KB
页数:10页
时间:2019-11-22
《矩阵与数值分析作业》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、2011级工科硕士研究生《矩阵与数值分析》课程数值实验题目一、对于数列占,右有如下两种生成方式1、首项为兔=1,递推公式为%=扌%,〃=1,2,…;2、前两项为a()=l,Q]=*,递推公式为=亍%_]-暫_2,〃=2,3,…给出利用上述两种递推公式生成的序列的第50项。解:matlab编程1、cl(l)=l;fortl=2:50cl(tl)=cl(tl-l)/3;endcl(50)运算结果:ans=4.1788e-0242、c2(l)=l;c2(2)=l/3;fort2=3:50c2(t2)=c2(t2-l)*10/3-c2(t2-2);endc2
2、(50)运算结果:ans=-4.9661e+006二、利用迭代格式及Aitken加速后的新迭代格式求方程F+4x2-10=0在[1,1.习内的根解:matlab编程k=l;x(l)=l.3;f=l;whi.le(abs(f)>1.0e~6)x(k+l)=sqrt(10/(x(k)+4));k=k+l;f=x(k厂3+4*x(k)"2-10;endcleark=l;x(l)=1.3;f=l;whi.le(abs(f)>1.0e~6)y(k)=sqrt(10/(x(k)+4));z(k)=sqrt(10/(y(k)+4));x(k+1)=z(k)-(z(
3、k)-y(k))"2/(z(k)-2*y(k)+x(k));k=k+l;f=x(k)"3+4*x(k厂2-10;endx,f运算结果:x=1.30001.37351.36411.36531.36521.36511.36511.3651f=5.8603e-007x=1.30001.36511.3651f=2.5046e-012分析:原迭代格式运算8次,达到精度要求;而是用Aitken加速后,只用3次迭代,即Aitken加速可以明显加快迭代速度。三.解线性方程组1.分别Jacobi迭代法和Gauss-Seidel迭代法求解线性方程组(621-2、/、厂4
4、、250-2兀27-2085-1'<132申丿9迭代法计算停止的条件为:maxx^+1)-x(.k)<10".1<;<37J解:matlab编程1Xj=[O;O;O;O];Xg=[O;O;O;O];A=[621-2;250-2;-2085;1327];b=[4;7;-l;0];D=diag(diag(A));L=-tr订(A)+D;U=-triu(A)+D;Bj=inv(D)*(L+U);f=inv(D)*b;k=l;flag=l;Xj(:,k+l)=Bj*Xj(:,k)+f;whileflag==lifabs(Xj(:,k+1)-Xj(:,k))<
5、le~6flag=0;elsek=k+l;Xj(:,k+l)=Bj*Xj(:,k)+f;endendXjBg=inv(D-L)*U;fg=inv(D-L)*b;k=l;flag=l;Xg(:,k+1)=Bg*Xg(:,k)+fg;whileflag==lifabs(Xg(:,k+1)-Xg(:,k))6、20.05220.052101.40001.13331.04781.16351.14421.14781.15151.15051.15091.15090-0.12500.04160.34240.22120.24330.24780.24320.24480.24470.244600-0.6593-0.5292-0.5557-0.5738-0.5681-0.5704-0.5706-0.5705-0.57062.用Gauss列主元消去法、QR方法求解如下方程组:Columns12through160.05210.05210.05210.05200.05201.7、15091.15091.15091.15091.15090.24450.24450.24450.24450.2445-0.5707-0.5707-0.5707-0.5707-0.5707Xg=00.66670.08430.05510.05230.05210.05210.05200.052001.13321.12911.14901.15081.15081.15091.1509L150900.04170.26660.24640.24480.24460.24460.24460.24460-0.5928-0.5721-0.5707-0.5706-0.57068、-0.5706-0.5706-0.5706'2212、/、T413-1兀22-4-201兀31<232申丿0
6、20.05220.052101.40001.13331.04781.16351.14421.14781.15151.15051.15091.15090-0.12500.04160.34240.22120.24330.24780.24320.24480.24470.244600-0.6593-0.5292-0.5557-0.5738-0.5681-0.5704-0.5706-0.5705-0.57062.用Gauss列主元消去法、QR方法求解如下方程组:Columns12through160.05210.05210.05210.05200.05201.
7、15091.15091.15091.15091.15090.24450.24450.24450.24450.2445-0.5707-0.5707-0.5707-0.5707-0.5707Xg=00.66670.08430.05510.05230.05210.05210.05200.052001.13321.12911.14901.15081.15081.15091.1509L150900.04170.26660.24640.24480.24460.24460.24460.24460-0.5928-0.5721-0.5707-0.5706-0.5706
8、-0.5706-0.5706-0.5706'2212、/、T413-1兀22-4-201兀31<232申丿0
此文档下载收益归作者所有