数学实验练习题参考答案.pdf
第一次练习教学要求:熟练掌握Ma t l a b 软件的基本命令和操作,会作二维、三维儿何图形,能够用Ma t l a b 软件解决微枳分、线性代数与解析几何中的计算问题。补充命令vpa(x,n)显示x 的 n 位有效数字,教 材 1 0 2 页fpl ot(f(x),a,b )函数作图命令,画出f(x)在区间 a,b 上的图形在下面的题目中?为你的学号的后3 位(1-9 班)或 4 位(1 0 班以上)、但、.mx-sinmx.mx-sin mx1.1 计算 lim-与 lim-X XT8%程序:sym s xl i m i t(1 0 0 1*x-si n(1 0 0 1*x)/x 3,x,0)结果:1 0 0 3 0 0 3 0 0 1/6程序:sym s x1 i m i t(1 0 0 1*x-si n(1 0 0 1*x)/x 3,x,i nf)结果:0 x mx 小 1.2 y=e cos-,求 y1000程序:sym s xd i ff(exp(x)*c os(1 0 0 1*x/1 0 0 0),2)结果:-2 0 0 1/1 0 0 0 0 0 0*exp(x)*c os(1 0 0 1/1 0 0 0*x)-1 0 0 1/5 0 0*exp(x)*si n(1 0 0 1/1 00 0*x)1.3 计算 f e+y dxdy程序:d b l qu a d (x,y)exp(x.2+y.2),0,1,0,1)结果:2.1 3 9 3 5 0 1 9 5 1 4 2 2 81.4 计算 f一-dxJ in+4x程序:sym s xi nt(x*4/(1 0 0 0*2+4*x*2)结果:l/1 2*x*3-1 0 0 2 0 0 1/1 6*x+1 0 0 3 0 0 3 0 0 1/3 2*a t a n(2/1 0 0 1*x)1.5 y-ex c os m x,求)程序:sym s xd i ff(exp(x)*c os(1 0 0 0*x),1 0)结果:-1 0 0 9 9 9 9 7 5 9 1 5 8 9 9 2 0 0 0 9 6 0 7 2 0 1 6 0 0 0 0*exp(x)*c os(1 0 0 1*x)-1 0 0 9 0 2 3 9 9 9 8 9 90 3 1 9 0 4 0 0 0 0 1 6 0 0 3 2*exp(x)*s i n(1 0 0 1*x)1.6 给出+x 在工=0的泰勒展式(最高次暴为4).程序:sym s xt a yl or(sqrt(1 0 0 1/1 0 0 0+x),5)结果:1/1 0 0*1 0 0 1 0 (1/2)+5/1 0 0 1*1 0 0 1 0 (1/2)*x-1 2 5 0/1 0 0 2 0 0 1*1 0 0 1 0 (1/2)*x 2+6 2 5 0 0 0/1 0 0 3 0 0 3 0 0 1*1 0 0 1 0 7 1/2)*x 3-3 9 0 6 2 5 0 0 0/1 0 0 4 0 0 6 0 0 4 0 0 1*1 0 0 1(T(l/2)*xN1.7 F i b ona c c i 数列 居 的定义是 =l,x2=1,,乙=+相 2(=3,4,)用循环语句编程给出该数列的前2 0 项(要求将结果用向量的形式给出)。程序:x=l,1 ;for n=3:2 0 x(n)=x(n-l)+x(n-2);endx结果:Col u m ns 1 t h rou gh 1 01123581 32 13 45 5Col u m ns 1 1 t h rou gh2 08 91 4 42 3 33 7 76 1 09 8 71 5 9 72 5 8 44 1 8 16 7 6 5、-2 1A=0 21.8对矩阵 4 110,求该矩阵的逆矩阵,特征值,特mWO O;征向量,行列式,计算并求矩阵P,。(。是对角矩阵),使得A=PDP-X o程序与结果:a=-2,1,1;0,2,0;-4,1,1 0 0 1/1 0 0 0 ;i nv(a)0.5 0 1 0 0 1 0 0 1 0 0 1 0 002.0 0 2 0 0 2 0 0 2 0 0 2 0 0ei g(a)-0.4 9 9 5 0 0 0 0 0 0 0 0 0 0 +-0.4 9 9 5 0 0 0 0 0 0 0 0 0 0 -2.0 0 0 0 0 0 0 0 0 0 0 0 0 0 p,d =ei g(a)P=-0.0 0 0 2 5 0 2 5 0 2 5 0 2 50.5 0 0 0 0 0 0 0 0 0 0 0 0 0-0.5 0 0 5 0 0 5 0 0 5 0 0 5 01.3 2 2 3 0 8 4 9 2 7 5 0 4 6 i1.3 2 2 3 0 8 4 9 2 7 5 0 4 6 i-0.5 0 0 5 0 0 5 0 0 5 0 0 5 00-1.0 0 1 0 0 1 0 0 1 0 0 1 0 00.3 3 5 5 -0.2 9 5 7 i0.3 3 5 5 +0.2 9 5 7 i0.2 4 2 5000.9 7 0 10.8 9 4 40.8 9 4 40.0 0 0 0注:p的列向量为特征向量d=-0.4 9 9 5 +1.3 2 2 3 i000-0.4 9 9 5 -1.3 2 2 3 i0002.0 0 0 0a 61 1.9 6 8 01 3.0 0 8 0-4.9 9 1 006 4.0 0 0 001 9.9 6 4 0-4.9 9 1 0-3.0 1 0 01.9 作出如下函数的图形(注:先用M文件定义函数,再 用fpl ot进行函数作图):1.1 0 在同一坐标系下作出下面两条空间曲线(要求两条曲线用不同的颜色表示)x=cost(1)y=sin rz=tx=2cosr(2);yl=h(0,1 0 0 1/6 0 0,x);y2=h(-l,1 0 0 1/6 0 0,x);y3=h(l,1 0 0 1/6 0 0,x);pl ot (x,yl,r+,x,y2,k,x,y3,b*)程序:zl=h(0,1,x);z2=h (0,2,x);z3=h (0,4,x);z4=h(0,1 0 0 1/1 0 0,x);pl ot (x,zl,r+,x,z2,k-,x,z3,b*,x,z4,y:)1.1 3 作出z=t/+y4的函数图形。程序:x=-5:0.l:5;y=-1 0:0.1:1 0;X Y =m esh gri d(x,y);Z=1 0 0 1*X.*2+Y.*4;m esh(X,Y,Z);I l l1.1 4 对 于 方 程/-X-0.1 =0,先画出左边的函数在合适的区间上的图2 0 0形,借助于软件中的方程求根的命令求出所有的实根,找出函数的单调区间,结合高等数学的知识说明函数为什么在这些区间上是单调的,以及该方程确实只有你求出的这些实根。最后写出你做此题的体会。解:作图程序:(注:x 范围的选择是经过试探而得到的)x=-l.7:0.0 2:1.7;y=x.5-1 0 0 1/2 0 0*x-0.1;p l o t (x,y);g ri d o n;由图形观察,在 x=T.5,x=0,x=L 5 附近各有 个实根求根程序:so l v e C x*5-1 0 0 1/2 0 0*x 0.T)结果:-1.490 6852 0 4754442 491 0 680 1 60 2 9880 21 9980 0 2 0 61 61 93485540 81 0 82 465481 l e-1.49944480 891 5982 82 491 81 4739731 534e-2-l.4957641 71 73951 1 484743570 42 0 2 656*i.49944480 891 5982 82 491 81 4739731 534e-2+l.4957641 71 73951 1 484743570 42 0 2 656*i1.50 0 67632 91 92 31 632 0 1 1 0 46390 65887三个实根的近似值分别为:-1.490 685,-0.0 1 9980,1.50 0 676由图形可以看出,函数在区间(-0 0,-1)单调上升,在 区 间 单 调 下 降,在区间(1,8)单调上升。di f f C x 5-1 0 0 1/2 0 0*x-0.f,x)结果为 5*x 4-1 0 0 1/2 0 0so l v e (5*x.4T0 0 1/2 0 0.)得到两个实根:T.0 0 0 2 499 与 1.0 0 0 2 499可以验证导函数在(-8,-1.0 0 0 2 499)内为正,函数单调上升导函数在(-1.0 0 0 2 499,1.0 0 0 2 499)内为负,函数单调下降导函数在(1.0 0 0 2 499,8)内为正,函数单调上升根据函数的单调性,最多有3 个实根。1.1 5 求3皿 2=0 的所有根。(先画图后求解)(要求贴图)作图命令:(注:x范围的选择是经过试探而得到的)x=-5:0.0 0 1:1 5;y=e x p(x)-3*1 0 0 1*x.2;p l o t(x,y);g ri d o n;可以看出,在(-5,5)内可能有根,在(1 0,1 5)内有1 个根将(-5,5)内图形加细,最终发现在(-0.0 3,0.0 3)内有两个根。用 so l v e (,e x p(x)-3*1 0 0 1.0*x ,x)可以求出 3 个根为:.1 841 71 1 32 743681 2 931 1 1 4567747870 2 e-l1 3.1 62 0 41 0 92 0 91 1 491 8572 6742 8571 951 80 840 38990 2 847966481 941 342 2 2 365e-lBP:-0.0 1 841 7,0.0 1 80 84,1 3.1 62 0 4第二次练习教学要求:要求学生掌握迭代、混沌的判断方法,以及利用迭代思想解决实际问题。X,=(X 4)/22.1设,数列 x“是否收敛?若收敛,其值为多少?X 1 =3精确到8位有效数字。解:程序代码如下(m=1 0 0 0):f=i n l i n e C(x+1 0 0 0/x)/2*);x 0=3;f o r i=l:2 0;x O=f (x O);f p ri n t f (,%g,%g n,i,x O)e n d运行结果:1,1 68.1 672,87.0 5663,49.2 71 74,34.78375,31.76646,31.62 317,31.62 2 88,31.62 2 89,31.62 2 81 0,31.62 2 81 1,31.62 2 81 2,31.62 2 81 3,31.62 2 81 4,31.62 2 81 5,31.62 2 81 6,31.62 2 81 7,31.62 2 81 8,31.62 2 81 9,31.62 2 82 0,31.62 2 8山运行结果可以看出,数列%收敛,其值为31.62 2 8。2.2求出分式线性函数力(x)=L/,()=二的不动点,再编程判x+m x+m断它们的迭代序列是否收敛。解:取10 0 0.(1)程序如下:f=in lin e(x T)/(x+1 0 0 0);x0=2;fo r i=l:20;x0=f(xO);fp rin tf(%g,%gn,i,xO);end运行结果:1,0.00099800411,-0.0010012,-0.00099900112,-0.0010013,-0.00100113,-0.0010014,-0.00100114,-0.0010015,-0.00100115,-0.0010016,-0.00100116,-0.0010017,-0.00100117,-0.0010018,-0.00100118,-0.0010019,-0.00100119,-0.00100110,-0.00100120,-0.001001由运行结果可以看出,分式线性函数收敛,其值为-0.001001。易见函数的不动点为-0.001001(吸引点)。(2)程序如下:f二in lin e,(x+1000000)/(x+1000);xO=2;f o r i=l:2 0;x O=f(x O);f p ri n t f (%g,%g n,i,xO);e n d运行结果:1,998.0 0 61 1,61 8.3322,50 0.9991 2,61 8.30 23,666.5571 3,61 8.31 44,60 0.4391 4,61 8.30 95,62 5.2 0 41 5,61 8.31 16,61 5.6921 6,61 8.317,61 9.31 11 7,61 8.31 18,61 7.92 91 8,61 8.319,61 8.4561 9,61 8.311 0,61 8.2 552 0,61 8.31山运行结果可以看出,分式线性函数收敛,其值为61 8.31。易见函数的不动点为61 8.31 (吸引点)。2.3下面函数的迭代是否会产生混沌?(56页练习7(1)2(1-x)x 12xfM =0 x h o l d o f f运行结果:2.4函数/(x)=ax(l x)(0 4x l)称为Lo g i st i c映射,试 从“蜘蛛网”图 观 察 它 取 初 值 为%=05 产生的迭代序列的收敛性,将观察记录填人F表,若出现循环,请指出它的周期.(56页练习8)a3.33.53.563.5683.63.84序列收敛情况T二 2T二 4T 二 8T二 9混沌混沌解:当a =3.3 时,程序代码如下:Gi n l i n e(3.3*x*(l-x);x=;y=;x(l)=0.5;y(l)=0;x(2)=x ;y(2)=f (x(l);f o r i=l:1 0 0 0;x(l+2*i)=y(2*i);x(2+2*i)=x(l+2*i);y(l+2*i)=x(l+2*i);y(2+2*i)二 f(x(2+2*i);e n dp l o t (x,y,r );ho l d o n;s y m s x;e z p l o t(x,0,1 );e z p l o t (f (x),0,1 );a x is(0,1,0,1 );ho l d o f f 运行结果:当a =3.5时,上述程序稍加修改,得:当a =3.56时,得:当a =3.568时,得:当a =3.6时,得:-(18 x(x-1)/50 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1x10.90.80.70.60.50.40.30.20.10当。二3.8 4时,得:2.5对 于 M a r t in 迭代,取参数a,。,c为其它的值会得到什么图形?参考下表(取自6 3 页练习1 3)解:取 m=1 0 0 0 0;迭代次数N=2 0 0 0 0;在M-文件里面输入代码:function Martin(a,b,c,N)f=(x,y)(y-sign(x)*sqrt(abs(b*x-c);g=(x)(a-x);m=0;0;for n=l:Nm(:,n+l)=f(m(l,n),m(2,n),g(m(l,n);endplot(m(l,:),m(2,:),kx);axis equal在命令窗口中执行 M a r t in (1 0 0 0 0,1 0 0 0 0,1 0 0 0 0,2 0 0 0 0),得:abcmmm-m-mm-mm/1 0 0 0-mm/1 0 0 0m/1 0 0 00.5m/1 0 0 0m-mm/1 0 0m/1 0-1 0-m/1 01 74执行M artin(-10000,-10000,10000,2 0 0 0 0),得:执行 M a r t in (-1 0 0 0 0,1 0,-1 0 0 0 0,2 0 0 0 0),得:执行 M a r t in (1 0,1 0,0.5,2 0 0 0 0),得:执行 Martin(10,10000,-10000,20000),得:30001000-1000-2000-3000-40004000-5000-4000-3000-2000-1000 0 1000 2000 3000 4000 5000执行 Martin(100,1000,-10,20000),得:5004003002001000-100-200-300-400-500-600-400-200执行 Martin(-1000,17,4,20000),得:Z 7 V A2.6 能否找到分式函数f-(其中是整数),使它产生的迭代序列(迭代的初始值也是整数)收敛到痂(对于而为整数的学号,请 改 为 求 祈 而)。如果迭代收敛,那么迭代的初值与收敛的速度有什么关系.写出你做此题的体会.提示:教材54页练习4 的一些分析。若分式线性函数f(x)=竺土2 的迭代收敛到指定的数J L则 近 为/(x)cx+d的不动点,因此CyJ2+d化简得:(2c-&)+(J-a)V 2=0,若 a,b,c,d为整数,易见b=2c,d=a。取满足这种条件的不同的。,瓦c,d 以及迭代初值进行编。解:取 m=1 0 0 0 0;根据上述提示,取:a=e=l,b=1 0 0 0 0,c=l,d=0.程序如下(初值为1 2 0 0):f=in l in e C (x+1 0 0 0 0)/(x*2+D,);x 0=1 2 0 0;f o r i=l:1 0 0;x 0=f(x O);f p r in t f (,%g,%g n,,i,x O);e n d运行结果如下:1,0.0 0 7 7 7 7 7 72,9 9 9 9.43,0.0 0 0 2 0 0 0 1 84,1 0 0 0 05,0.0 0 0 26,1 0 0 0 07,0.0 0 0 28,1 0 0 0 09,0.0 0 0 21 0,1 0 0 0 01 1,0.0 0 0 21 2,1 0 0 0 01 3,0.0 0 0 21 4,1 0 0 0 01 5,0.0 0 0 21 6,1 0 0 0 01 7,0.0 0 0 21 8,1 0 0 0 01 9,0.0 0 0 22 0,1 0 0 0 02 1,0.0 0 0 22 2,1 0 0 0 02 3,0.0 0 0 22 4,1 0 0 0 02 5,0.0 0 0 22 6,1 0 0 0 02 7,0.0 0 0 22 8,1 0 0 0 02 9,0.0 0 0 23 0,1 0 0 0 03 1,0.0 0 0 23 2,1 0 0 0 03 3,0.0 0 0 23 4,1 0 0 0 03 5,0.0 0 0 23 6,1 0 0 0 03 7,0.0 0 0 23 8,1 0 0 0 03 9,0.0 0 0 240,1 0 0 0 041,0.0 0 0 242,1 0 0 0 043,0.0 0 0 244,1 0 0 0 045,0.0 0 0 246,1 0 0 0 047,0.0 0 0 248,1 0 0 0 049,0.0 0 0 250,1 0 0 0 051,0.0 0 0 252,1 0 0 0 053,0.0 0 0 254,1 0 0 0 055,0.0 0 0 256,1 0 0 0 057,0.0 0 0 258,1 0 0 0 059,0.0 0 0 26 0,1 0 0 0 06 1,0.0 0 0 26 2,1 0 0 0 06 3,0.0 0 0 26 4,1 0 0 0 06 5,0.0 0 0 26 6,1 0 0 0 06 7,0.0 0 0 26 8,1 0 0 0 06 9,0.0 0 0 27 0,1 0 0 0 07 1,0.0 0 0 27 2,1 0 0 0 07 3,0.0 0 0 27 4,1 0 0 0 07 5,0.0 0 0 27 6,1 0 0 0 07 7,0.0 0 0 27 8,1 0 0 0 07 9,0.0 0 0 280,1 0 0 0 081,0.0 0 0 282,1 0 0 0 083,0.0 0 0 284,1 0 0 0 085,0.0 0 0 286,1 0 0 0 087,0.0 0 0 288,1 0 0 0 089,0.0 0 0 29 0,1 0 0 0 09 1,0.0 0 0 29 2,1 0 0 0 09 3,0.0 0 0 29 4,1 0 0 0 09 5,0.0 0 0 29 6,1 0 0 0 09 7,0.0 0 0 29 8,1 0 0 0 09 9,0.0 0 0 21 0 0,1 0 0 0 0若初值取为1 0 0 0,运行结果:1,0.0 1 12,9 9 9 8.83,0.0 0 0 2 0 0 0 3 64,1 0 0 0 05,0.0 0 0 26,1 0 0 0 07,0.0 0 0 28,1 0 0 0 09,0.0 0 0 21 0,1 0 0 0 01 1,0.0 0 0 21 2,1 0 0 0 01 3,0.0 0 0 21 4,1 0 0 0 01 5,0.0 0 0 21 6,1 0 0 0 01 7,0.0 0 0 21 8,1 0 0 0 01 9,0.0 0 0 22 0,1 0 0 0 02 1,0.0 0 0 22 2,1 0 0 0 02 3,0.0 0 0 22 4,1 0 0 0 02 5,0.0 0 0 22 6,1 0 0 0 02 7,0.0 0 0 22 8,1 0 0 0 02 9,0.0 0 0 23 0,1 0 0 0 03 1,0.0 0 0 23 2,1 0 0 0 03 3,0.0 0 0 23 4,1 0 0 0 03 5,0.0 0 0 23 6,1 0 0 0 03 7,0.0 0 0 23 8,1 0 0 0 03 9,0.0 0 0 240,1 0 0 0 041,0.0 0 0 242,1 0 0 0 043,0.0 0 0 244,1 0 0 0 045,0.0 0 0 246,1 0 0 0 047,0.0 0 0 248,1 0 0 0 049,0.0 0 0 250,1 0 0 0 051,0.0 0 0 252,1 0 0 0 053,0.0 0 0 254,1 0 0 0 055,0.0 0 0 256,1 0 0 0 057,0.0 0 0 258,1 0 0 0 059,0.0 0 0 26 0,1 0 0 0 06 1,0.0 0 0 26 2,1 0 0 0 06 3,0.0 0 0 26 4,1 0 0 0 06 5,0.0 0 0 26 6,1 0 0 0 06 7,0.0 0 0 26 8,1 0 0 0 06 9,0.0 0 0 27 0,1 0 0 0 07 1,0.0 0 0 27 2,1 0 0 0 07 3,0.0 0 0 27 4,1 0 0 0 07 5,0.0 0 0 27 6,1 0 0 0 07 7,0.0 0 0 27 8,1 0 0 0 07 9,0.0 0 0 280,1 0 0 0 081,0.0 0 0 282,1 0 0 0 083,0.0 0 0 284,1 0 0 0 085,0.0 0 0 286,1 0 0 0 087,0.0 0 0 288,1 0 0 0 089,0.0 0 0 29 0,1 0 0 0 09 1,0.0 0 0 29 2,1 0 0 0 09 3,0.0 0 0 29 4,1 0 0 0 09 5,0.0 0 0 29 6,1 0 0 0 09 7,0.0 0 0 29 8,1 0 0 0 09 9,0.0 0 0 21 0 0,1 0 0 0 0若初值取为-1,运行结果:1,49 9 9.52,0.0 0 0 6 0 0 13,1 0 0 0 04,0.0 0 0 25,1 0 0 0 06,0.0 0 0 27,1 0 0 0 08,0.0 0 0 29,1 0 0 0 01 0,0.0 0 0 21 1,1 0 0 0 01 2,0.0 0 0 21 3,1 0 0 0 01 4,0.0 0 0 21 5,1 0 0 0 01 6,0.0 0 0 21 7,1 0 0 0 01 8,0.0 0 0 21 9,1 0 0 0 02 0,0.0 0 0 22 1,1 0 0 0 02 2,0.0 0 0 22 3,1 0 0 0 02 4,0.0 0 0 22 5,1 0 0 0 02 6,0.0 0 0 22 7,1 0 0 0 02 8,0.0 0 0 22 9,1 0 0 0 03 0,0.0 0 0 23 1,1 0 0 0 03 2,0.0 0 0 23 3,1 0 0 0 03 4,0.0 0 0 23 5,1 0 0 0 03 6,0.0 0 0 23 7,1 0 0 0 03 8,0.0 0 0 23 9,1 0 0 0 040,0.0 0 0 241,1 0 0 0 042,0.0 0 0 243,1 0 0 0 044,0.0 0 0 245,1 0 0 0 046,0.0 0 0 247,1 0 0 0 048,0.0 0 0 249,1 0 0 0 050,0.0 0 0 251,1 0 0 0 052,0.0 0 0 253,1 0 0 0 054,0.0 0 0 255,1 0 0 0 056,0.0 0 0 257,1 0 0 0 058,0.0 0 0 259,1 0 0 0 06 0,0.0 0 0 26 1,1 0 0 0 06 2,0.0 0 0 26 3,1 0 0 0 06 4,0.0 0 0 26 5,1 0 0 0 06 6,0.0 0 0 26 7,1 0 0 0 06 8,0.0 0 0 26 9,1 0 0 0 07 0,0.0 0 0 27 1,1 0 0 0 07 2,0.0 0 0 27 3,1 0 0 0 07 4,0.0 0 0 27 5,1 0 0 0 07 6,0.0 0 0 27 7,1 0 0 0 07 8,0.0 0 0 27 9,1 0 0 0 080,0.0 0 0 281,1 0 0 0 082,0.0 0 0 283,1 0 0 0 084,0.0 0 0 285,1 0 0 0 086,0.0 0 0 287,1 0 0 0 088,0.0 0 0 289,1000090,0.000291,1000092,0.000293,1000094,0.000295,1000096,0.000297,1000098,0.000299,10000100,0.0002第三次练习教学要求:理解线性映射的思想,会用线性映射和特征值的思想方法解决诸如天气等实际问题。(4 2、3.1 对4=,(x;),xy=(l,2)T,求出 x“的通项.程序:A=s y m(4,2;l,3);P,D =e ig(A)Q=in v(P)s y m s n;x n=P*(D.An)*Q*l;2 结果:P=2,-1 1,I D=5,0 0,2 Q =1/3,1/引-1/3,2/3 x n =2*5An-2An5An+2An1 (0.4 0.2 仆仆13.2 B=A=对于练习 1 中的8,=(1,21,1 0 Q A 0.3 j 12求出 x“的通项.程序:A=s y m(r 2/5,l/5;l/1 0,3/1 0 );%没有 s y m 下面的矩阵就会显示为小数 P,D =e ig(A)Q=inv(P)xn=P*(D.An)*Q*l;2结果:P=2,-1 1,1D=1/2,0I 0,1/5Q=1/3,1/3-1/3,2/3xn=2*(l/2)An-(l/5)An(l/2)An+(l/5)An3.3 对 随 机 给 出 的 观 察 数 列 与.该数列有极限吗?x A=4,2;l,3;a=n;x=2*rand(2,l)-l;for i=l:20a(i,l:2)=x;x=A*x;endfor i=l:20ifa(i,l)=0else t=a(i,2)/a(i,l);fprintfC%g,%gn,i,t);endend结论:在迭代18次后,发现数列 与 存在极限为0.53.4 对 120页中的例子,继续计算,“(=1,2-).观察 七,%及机(x,)的极限是否存在.(120页练习9)A=2.1,3.4,-1,2,2.3;0.8,-0.3,4.1,2.8;2.3,7.9,-1.5,1.4;3.5,7.2,1.7,-9.0;X0=1;2;3;4;x=A*xO;for i=l:l:100a=max(x);b=min(x);m=a*(abs(a)abs(b)+b*(abs(a)00时 P.的极限,与已知结论作比较.(123页练习16)A=3/4,7/18;l/4,11/18;P,D=eig(A);syms k pk;a=solve(4u*P(l,l)+v*P(l,2)-l/2,u*P(2,l)+v*P(2,2)-l/2,;u,v,);pk=a.u*D(1,1).Ak*P(:,1 )+a.v*D(2,2).Ak*P(:,2)pk=-5/46*(13/36)八 k+14/235/46*(13/36)Ak+9/23或者:p0=l/2;l/2;P,D=eig(sym(A);B=inv(sym(P)*pOB=5/469/23syms kpk=B(l,l)*D(l,l).Ak*P(:,l)+B(2,l)*D(2,2).Ak*P(:,2)pk=-5/46*(13/36)八 k+14/235/46*(13/36)八 k+9/23 vpa(limit(pk,k,100),10)ans=.6086956522.3913043478结论:和用练习12中用迭代的方法求得的结果是一样的。第四次练习教学要求:会利用软件求勾股数,并且能够分析勾股数之间的关系。会解简单的近似计算问题。4.1 求满足c A =2,c W 1 0 0 0 的所有勾股数,能否类似于(1 1.8),把它们用一个公式表示出来?程序:f o r b=1:9 9 8a=s q rt(b+2)A2-bA2);i f(a=(lo o r(a)f p ri n t f(a=%i,b=%i,c=%i n ,a,b,b+2)e n de n d运行结果:a=4,b=3,c=5a=6,b=8,c=1 0a=8,b=1 5,c=1 7a=1 0,b=2 4,c=2 6a=1 2,b=3 5,c=3 7a=1 4,b=4 8,c=5 0a=1 6,b=6 3,c=6 5a=1 8,b=8 0,c=8 2a=2 0,b=9 9,c=1 0 1a=2 2,b=1 2 0,c=1 2 2a=2 4,b=1 4 3,c=1 4 5a=2 6,b=1 6 8,c=1 7 0a=2 8,b=1 9 5,c=1 9 7a=3 0,b=2 2 4,c=2 2 6a=3 2,b=2 5 5,c=2 5 7a=3 4,b=2 8 8,c=2 9 0a=3 6,b=3 2 3,c=3 2 5a=3 8,b=3 6 0,c=3 6 2a=4 0,b=3 9 9,c=4 0 1a=4 2,b=4 4 0,c=4 4 2a=4 4,b=4 8 3,c=4 8 5a=4 6,b=5 2 8,c=5 3 0a=4 8,b=5 7 5,c=5 7 7a=5 0,b=6 2 4,c=6 2 6a=5 2,b=6 7 5,c=6 7 7a=5 4,b=7 2 8,c=7 3 0a=56,b=783,c=785a=58,b=840,c=842a=60,b=899,c=901a=62,b=960,c=962勾股数c 0=2,eWIOO O 的解是:a,h,c=2(M+1),H2+2M,M 2+2M+2以下是推导过程:由a?+/=(6 +2)2,有/=皿 +4显然4|(4b+4),4,2,从而。是 2 的倍数.设a=2(+1),代入上式得到:b=u2+2u因为 c=/?+2,从而C=2+2 +2.4.2 将上一题中。一人=2 改为c 8=4,5,6,7,分别找出所有的勾股数.将它们与c-8=1,2时的结果进行比较,然后用公式表达其结果。(1)c-b =4 时通项:a,byc=4(+1),2(/+2w),2(w2+2u+2)a=8,b=6,c=10a=12,b=16,c=20a=16,b=30,c=34a=20,b=48,c=5 2a=24,b=70,c=74a=28,b=96,c=100a=32,b=126,c=13Oa=36,b=160,c=164a=40,b=198,c=202a=44,b=240,c=244a=48,b=286,c=290a=52,b=336,c=340a=56,b=390,c=394a=60,b=448,c=452a=64,b=510,c=514a=68,b=576,c=580a=72,b=646,c=650a=76,b=720,c=724a=80,b=798,c=802a=84,b=880,c=884a=88,b=966,c=970(2)c-b =5 时通项:a.b.c=5(2 +1),5(2M2+2w),5(2w2+2 +1)a=15,b=20,c=25a=25,b=60,c=65a=35,b=120,c=125a=45,b=200,c=205a=55,b=300,c=305a=65,b=420,c=425a=75,b=560,c=565a=85,b=720,c=725a=95,b=900,c=905(3)c-b =6 时通项 ec=6(+1),3(2+2”),3(2 +2 +2)a=12,b=9,c=15a=18,b=24,c=30a=24,b=45,c=51a=30,b=72,c=78a=36,b=105,c=llla=42,b=144,c=150a=48,b=189,c=195a=54,b=240,c=246a=60,b=297,c=303a=66,b=360,c=366a=72,b=429,c=435a=7 8,b=5 0 4,c=5 1 0a=8 4,b=5 8 5,c=5 9 1a=9 0,b=6 7 2,c=6 7 8a=9 6,b=7 6 5,c=7 7 1a=1 0 2,b=8 6 4,c=8 7 0a=1 0 8,b=9 6 9,c=9 7 5(4)c-b =1 时通项 a,b,c =7(2 +l),7(2 w2+2 w),7(2 w2+2 +1)a=2 1,b=2 8,c=3 5a=3 5,b=8 4,c=9 1a=4 9,b=1 6 8,c=1 7 5a=6 3,b=2 8 0,c=2 8 7a=7 7,b=4 2 0,c=4 2 7a=9 1,b=5 8 8,c=5 9 5a=1 0 5,b=7 8 4,c=7 9 1综 上:当 c-b=k 为 奇 数 时,通 项a,b,c=k(2u+l),(2 w2+2uk(2u2+2 +1)当 c-b=k 为 偶 数 时,通 项 a M =ku+1),红2 +2u)/2,k(6 +2u+2)/2 4.3 对 c K lO O O,c-b =k(女2 0 0 ),对哪些人存在本原勾股数?(1 4 0页练习1 2)程序:f o r k=1:2 0 0f o r b=1:9 9 9a=s q rt(b+k)A2-bA2);i f(a=f lo o r(a)&g c d(g c d(a,b),(b+k)=1)f p ri n t f C%i A k);b re a k;e n de n de n d运行结果:1,2,8,9,1 8,2 5,3 2,4 9,5 0,7 2,8 1,9 8,1 2 1,1 2 8,1 6 2,1 6 9,2 0 0,4.4设 方 程(1 1.1 5)的 解 构 成 数 列 p,/,观 察 数 列 p,J,纵,pn+q,p+2纵,p“-纵.你能得到哪些等式?试根据这些等式推 导 出