


已阅读5页,还剩48页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
专业 姓名 学号 成绩第一次练习教学要求:熟练掌握Matlab软件的基本命令和操作,会作二维、三维几何图形,能够用Matlab软件解决微积分、线性代数与解析几何中的计算问题。补充命令vpa(x,n)显示x的n位有效数字,教材102页fplot(f(x),a,b)函数作图命令,画出f(x)在区间a,b上的图形在下面的题目中为你的学号的后3位(1-9班)或4位(10班以上)1.1 计算与程序:syms xlimit(1001*x-sin(1001*x)/x3,x,0)结果:1003003001/6程序:syms xlimit(1001*x-sin(1001*x)/x3,x,inf)结果:01.2 ,求 程序:syms xdiff(exp(x)*cos(1001*x/1000),2)结果:-2001/1000000*exp(x)*cos(1001/1000*x)-1001/500*exp(x)*sin(1001/1000*x)1.3 计算程序:dblquad(x,y) exp(x.2+y.2),0,1,0,1)结果:2.139350195142281.4 计算程序:syms xint(x4/(10002+4*x2)结果:1/12*x3-1002001/16*x+1003003001/32*atan(2/1001*x)1.5 程序:syms xdiff(exp(x)*cos(1000*x),10)结果:-1009999759158992000960720160000*exp(x)*cos(1001*x)-10090239998990319040000160032*exp(x)*sin(1001*x)1.6 给出在的泰勒展式(最高次幂为4). 程序:syms xtaylor(sqrt(1001/1000+x),5)结果:1/100*10010(1/2)+5/1001*10010(1/2)*x-1250/1002001*10010(1/2)*x2+625000/1003003001*10010(1/2)*x3-390625000/1004006004001*10010(1/2)*x41.7 Fibonacci数列的定义是,用循环语句编程给出该数列的前20项(要求将结果用向量的形式给出)。程序:x=1,1;for n=3:20 x(n)=x(n-1)+x(n-2);endx结果:Columns 1 through 10 1 1 2 3 5 8 13 21 34 55 Columns 11 through 20 89 144 233 377 610 987 1597 2584 4181 67651.8 对矩阵,求该矩阵的逆矩阵,特征值,特征向量,行列式,计算,并求矩阵(是对角矩阵),使得。程序与结果:a=-2,1,1;0,2,0;-4,1,1001/1000;inv(a) 0.50100100100100 -0.00025025025025 -0.50050050050050 0 0.50000000000000 0 2.00200200200200 -0.50050050050050 -1.00100100100100eig(a)-0.49950000000000 + 1.32230849275046i -0.49950000000000 - 1.32230849275046i 2.00000000000000p,d=eig(a)p = 0.3355 - 0.2957i 0.3355 + 0.2957i 0.2425 0 0 0.9701 0.8944 0.8944 0.0000 注:p的列向量为特征向量d = -0.4995 + 1.3223i 0 0 0 -0.4995 - 1.3223i 0 0 0 2.0000 a6 11.9680 13.0080 -4.9910 0 64.0000 0 19.9640 -4.9910 -3.0100 1.9 作出如下函数的图形(注:先用M文件定义函数,再用fplot进行函数作图):函数文件f.m: function y=f(x)if 0=xx=1/2 y=2.0*x;else 1/2xx=1 y=2.0*(1-x);end程序:fplot(f,0,1)1.10 在同一坐标系下作出下面两条空间曲线(要求两条曲线用不同的颜色表示)(1)(2)程序:t=-10:0.01:10;x1=cos(t);y1=sin(t);z1=t;plot3(x1,y1,z1,k);hold onx2=cos(2*t);y2=sin(2*t);z2=t;plot3(x2,y2,z2,r);hold off1.11 已知,在MATLAB命令窗口中建立A、B矩阵并对其进行以下操作:(1) 计算矩阵A的行列式的值(2) 分别计算下列各式:解:(1)程序:a=4,-2,2;-3,0,5;1,5*1001,3; b=1,3,4;-2,0,3;2,-1,1;det(a)-130158(2) 2*a-b 7 -7 0 -4 0 7 0 10011 5a*b 12 10 12 7 -14 -7 -10003 0 15022a.*b 4 -6 8 6 0 15 2 -5005 3a*inv(b) 1.0e+003 * -0.0000 0 0.0020 0.0000 0.0016 0.0001 1.1443 -1.0006 -1.5722inv(a)*b 0.3463 0.5767 0.5383 0.0004 -0.0005 -0.0005 -0.1922 0.3460 0.9230a2 24 10002 4 -7 25031 9 -15008 15013 25036A 4 -3 1 -2 0 5005 2 5 31.12 已知分别在下列条件下画出的图形:(1),分别为(在同一坐标系上作图);(2),分别为(在同一坐标系上作图).(1)程序:x=-5:0.1:5;h=inline(1/sqrt(2*pi)/s*exp(-(x-mu).2/(2*s2);y1=h(0,1001/600,x);y2=h(-1,1001/600,x);y3=h(1,1001/600,x);plot(x,y1,r+,x,y2,k-,x,y3,b*)(2)程序:z1=h(0,1,x);z2=h(0,2,x);z3=h(0,4,x); z4=h(0,1001/100,x);plot(x,z1,r+,x,z2,k-,x,z3,b*,x,z4, y:)1.13 作出的函数图形。程序:x=-5:0.1:5;y=-10:0.1:10;X Y=meshgrid(x,y);Z=1001*X.2+Y.4;mesh(X,Y,Z);1.14对于方程,先画出左边的函数在合适的区间上的图形,借助于软件中的方程求根的命令求出所有的实根,找出函数的单调区间,结合高等数学的知识说明函数为什么在这些区间上是单调的,以及该方程确实只有你求出的这些实根。最后写出你做此题的体会。解:作图程序:(注:x范围的选择是经过试探而得到的)x=-1.7:0.02:1.7;y=x.5-1001/200*x-0.1;plot(x,y);grid on;由图形观察,在x=-1.5,x=0,x=1.5附近各有一个实根求根程序:solve(x5-1001/200*x-0.1)结果: -1.4906852047544424910680160298802 -.19980020616193485540810824654811e-1 .49944480891598282491814739731534e-2-1.4957641717395114847435704202656*i .49944480891598282491814739731534e-2+1.4957641717395114847435704202656*i 1.5006763291923163201104639065887三个实根的近似值分别为:-1.490685,-0.019980,1.500676由图形可以看出,函数在区间单调上升,在区间单调下降,在区间单调上升。diff(x5-1001/200*x-0.1,x)结果为5*x4-1001/200solve(5*x4-1001/200.)得到两个实根:-1.0002499与1.0002499可以验证导函数在内为正,函数单调上升导函数在内为负,函数单调下降导函数在内为正,函数单调上升根据函数的单调性,最多有3个实根。1.15 求的所有根。(先画图后求解)(要求贴图)作图命令:(注:x范围的选择是经过试探而得到的)x=-5:0.001:15;y=exp(x)-3*1001*x.2;plot(x,y);grid on;可以看出,在(-5,5)内可能有根,在(10,15)内有1个根将(-5,5)内图形加细,最终发现在(-0.03,0.03)内有两个根。用solve(exp(x)-3*1001.0*x2,x)可以求出3个根为: .18417113274368129311145677478702e-1 13.162041092091149185726742857195 -.18084038990284796648194134222365e-1即:-0.018417,0.018084,13.16204第二次练习教学要求:要求学生掌握迭代、混沌的判断方法,以及利用迭代思想解决实际问题。2.1 设,数列是否收敛?若收敛,其值为多少?精确到8位有效数字。解:程序代码如下(m=1000): f=inline(x+1000/x)/2);x0=3;for i=1:20;x0=f(x0);fprintf(%g,%gn,i,x0);end运行结果:1,168.167 11,31.62282,87.0566 12,31.62283,49.2717 13,31.62284,34.7837 14,31.62285,31.7664 15,31.62286,31.6231 16,31.62287,31.6228 17,31.62288,31.6228 18,31.62289,31.6228 19,31.622810,31.6228 20,31.6228由运行结果可以看出,数列收敛,其值为31.6228。2.2 求出分式线性函数的不动点,再编程判断它们的迭代序列是否收敛。解:取m=1000.(1)程序如下:f=inline(x-1)/(x+1000);x0=2;for i=1:20;x0=f(x0);fprintf(%g,%gn,i,x0);end运行结果:1,0.000998004 11,-0.0010012,-0.000999001 12,-0.0010013,-0.001001 13,-0.0010014,-0.001001 14,-0.0010015,-0.001001 15,-0.0010016,-0.001001 16,-0.0010017,-0.001001 17,-0.0010018,-0.001001 18,-0.0010019,-0.001001 19,-0.00100110,-0.001001 20,-0.001001由运行结果可以看出,分式线性函数收敛,其值为-0.001001。易见函数的不动点为-0.001001(吸引点)。(2)程序如下:f=inline(x+1000000)/(x+1000);x0=2;for i=1:20;x0=f(x0);fprintf(%g,%gn,i,x0);end运行结果:1,998.006 11,618.3322,500.999 12,618.3023,666.557 13,618.3144,600.439 14,618.3095,625.204 15,618.3116,615.692 16,618.317,619.311 17,618.3118,617.929 18,618.319,618.456 19,618.3110,618.255 20,618.31由运行结果可以看出,分式线性函数收敛,其值为618.31。易见函数的不动点为618.31(吸引点)。2.3 下面函数的迭代是否会产生混沌?(56页练习7(1)解:程序如下:f=inline(1-2*abs(x-1/2);x=;y=;x(1)=rand();y(1)=0;x(2)=x(1);y(2)=f(x(1);for i=1:100;x(1+2*i)=y(2*i);x(2+2*i)=x(1+2*i);y(2+2*i)=f(x(2+2*i);endplot(x,y,r);hold on;syms x;ezplot(x,0,1/2);ezplot(f(x),0,1);axis(0,1/2,0,1); hold off运行结果:2.4 函数称为Logistic映射,试从“蜘蛛网”图观察它取初值为产生的迭代序列的收敛性,将观察记录填人下表,若出现循环,请指出它的周期(56页练习8)3.33.53.563.5683.63.84序列收敛情况T=2T=4T=8T=9混沌混沌解:当=3.3时,程序代码如下:f=inline(3.3*x*(1-x);x=;y=;x(1)=0.5;y(1)=0;x(2)=x(1);y(2)=f(x(1);for i=1:1000;x(1+2*i)=y(2*i);x(2+2*i)=x(1+2*i);y(1+2*i)=x(1+2*i);y(2+2*i)=f(x(2+2*i);endplot (x,y,r);hold on;syms x;ezplot(x,0,1);ezplot(f(x),0,1);axis(0,1,0,1);hold off运行结果:当=3.5时,上述程序稍加修改,得:当=3.56时,得:当=3.568时,得:当=3.6时,得:当=3.84时,得:2.5 对于Martin迭代,取参数为其它的值会得到什么图形?参考下表(取自63页练习13)mmm-m-mm-mm/1000-mm/1000m/10000.5m/1000m-mm/100m/10-10-m/10174解:取m=10000;迭代次数N=20000;在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=1:N m(:,n+1)=f(m(1,n),m(2,n),g(m(1,n); end plot(m(1,:),m(2,:),kx); axis equal在命令窗口中执行Martin(10000,10000,10000,20000),得:执行Martin(-10000,-10000,10000,20000),得:执行Martin(-10000,10,-10000,20000),得:执行Martin(10,10,0.5,20000),得:执行Martin(10,10000,-10000,20000),得:执行Martin(100,1000,-10,20000),得:执行Martin(-1000,17,4,20000),得:2.6 能否找到分式函数(其中是整数),使它产生的迭代序列(迭代的初始值也是整数)收敛到(对于为整数的学号,请改为求)。如果迭代收敛,那么迭代的初值与收敛的速度有什么关系.写出你做此题的体会.提示:教材54页练习4的一些分析。若分式线性函数的迭代收敛到指定的数,则为的不动点,因此化简得:。若为整数,易见。取满足这种条件的不同的以及迭代初值进行编。解:取m=10000;根据上述提示,取: 运行结果如下:1,0.007777772,9999.43,0.0002000184,100005,0.00026,100007,0.00028,100009,0.000210,1000011,0.000212,1000013,0.000214,1000015,0.000216,1000017,0.000218,1000019,0.000220,1000021,0.000222,1000023,0.000224,1000025,0.000226,1000027,0.000228,1000029,0.000230,1000031,0.000232,1000033,0.000234,1000035,0.000236,1000037,0.000238,1000039,0.000240,1000041,0.000242,1000043,0.000244,1000045,0.000246,1000047,0.000248,1000049,0.000250,1000051,0.000252,1000053,0.000254,1000055,0.000256,1000057,0.000258,1000059,0.000260,1000061,0.000262,1000063,0.000264,1000065,0.000266,1000067,0.000268,1000069,0.000270,1000071,0.000272,1000073,0.000274,1000075,0.000276,1000077,0.000278,1000079,0.000280,1000081,0.000282,1000083,0.000284,1000085,0.000286,1000087,0.000288,1000089,0.000290,1000091,0.000292,1000093,0.000294,1000095,0.000296,1000097,0.000298,1000099,0.0002100,10000若初值取为1000,运行结果:1,0.0112,9998.83,0.0002000364,100005,0.00026,100007,0.00028,100009,0.000210,1000011,0.000212,1000013,0.000214,1000015,0.000216,1000017,0.000218,1000019,0.000220,1000021,0.000222,1000023,0.000224,1000025,0.000226,1000027,0.000228,1000029,0.000230,1000031,0.000232,1000033,0.000234,1000035,0.000236,1000037,0.000238,1000039,0.000240,1000041,0.000242,1000043,0.000244,1000045,0.000246,1000047,0.000248,1000049,0.000250,1000051,0.000252,1000053,0.000254,1000055,0.000256,1000057,0.000258,1000059,0.000260,1000061,0.000262,1000063,0.000264,1000065,0.000266,1000067,0.000268,1000069,0.000270,1000071,0.000272,1000073,0.000274,1000075,0.000276,1000077,0.000278,1000079,0.000280,1000081,0.000282,1000083,0.000284,1000085,0.000286,1000087,0.000288,1000089,0.000290,1000091,0.000292,1000093,0.000294,1000095,0.000296,1000097,0.000298,1000099,0.0002100,10000若初值取为-1,运行结果:1,4999.52,0.00060013,100004,0.00025,100006,0.00027,100008,0.00029,1000010,0.000211,1000012,0.000213,1000014,0.000215,1000016,0.000217,1000018,0.000219,1000020,0.000221,1000022,0.000223,1000024,0.000225,1000026,0.000227,1000028,0.000229,1000030,0.000231,1000032,0.000233,1000034,0.000235,1000036,0.000237,1000038,0.000239,1000040,0.000241,1000042,0.000243,1000044,0.000245,1000046,0.000247,1000048,0.000249,1000050,0.000251,1000052,0.000253,1000054,0.000255,1000056,0.000257,1000058,0.000259,1000060,0.000261,1000062,0.000263,1000064,0.000265,1000066,0.000267,1000068,0.000269,1000070,0.000271,1000072,0.000273,1000074,0.000275,1000076,0.000277,1000078,0.000279,1000080,0.000281,1000082,0.000283,1000084,0.000285,1000086,0.000287,1000088,0.000289,1000090,0.000291,1000092,0.000293,1000094,0.000295,1000096,0.000297,1000098,0.000299,10000100,0.0002 第三次练习教学要求:理解线性映射的思想,会用线性映射和特征值的思想方法解决诸如天气等实际问题。3.1 对,求出的通项. 程序:A=sym(4,2;1,3);P,D=eig(A)Q=inv(P)syms n; xn=P*(D.n)*Q*1;2 结果:P = 2, -1 1, 1D = 5, 0 0, 2Q = 1/3, 1/3 -1/3, 2/3xn =2*5n-2n 5n+2n3.2 对于练习1中的,求出的通项. 程序:A=sym(2/5,1/5;1/10,3/10); %没有sym下面的矩阵就会显示为小数P,D=eig(A)Q=inv(P)xn=P*(D.n)*Q*1;2 结果:P = 2, -1 1, 1D = 1/2, 0 0, 1/5Q = 1/3, 1/3 -1/3, 2/3xn = 2*(1/2)n-(1/5)n (1/2)n+(1/5)n3.3 对随机给出的,观察数列.该数列有极限吗? endend 结论:在迭代18次后,发现数列存在极限为0.53.4 对120页中的例子,继续计算.观察及的极限是否存在. (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*x0;for i=1:1:100a=max(x);b=min(x);m=a*(abs(a)abs(b)+b*(abs(a)=abs(b); y=x/m; x=A*y;endx %也可以用fprintf(%gn,x1),不能把x1,y一起输出ym程序输出:x1 = 0.9819 3.2889 -1.2890 -11.2213y = -0.0875 -0.2931 0.11491.0000m =-11.2213结论:及的极限都存在.3.5 求出的所有特征值与特征向量,并与上一题的结论作对比. (121页练习10) 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;P,D=eig(A)P = -0.3779 -0.8848 -0.0832 -0.3908 -0.5367 0.3575 -0.2786 0.4777 -0.6473 0.2988 0.1092 -0.7442 -0.3874 -0.0015 0.9505 0.2555D = 7.2300 0 0 0 0 1.1352 0 0 0 0 -11.2213 0 0 0 0 -5.8439结论:A的绝对值最大特征值等于上面的的极限相等,为什么呢?还有,P的第三列也就是-11.2213对应的特征向量和上题求解到的y也有系数关系,两者都是-11.2213的特征向量。3.6 设,对问题2求出若干天之后的天气状态,并找出其特点(取4位有效数字). (122页练习12) A2=3/4,1/2,1/4;1/8,1/4,1/2;1/8,1/4,1/4;P=0.5;0.25;0.25;for i=1:1:20 P(:,i+1)=A2*P(:,i);endPP = Columns 1 through 14 0.5000 0.5625 0.5938 0.6035 0.6069 0.6081 0.6085 0.6086 0.6087 0.6087 0.6087 0.6087 0.6087 0.6087 0.2500 0.2500 0.2266 0.2207 0.2185 0.2178 0.2175 0.2174 0.2174 0.2174 0.2174 0.2174 0.2174 0.2174 0.2500 0.1875 0.1797 0.1758 0.1746 0.1741 0.1740 0.1739 0.1739 0.1739 0.1739 0.1739 0.1739 0.1739 Columns 15 through 21 0.6087 0.6087 0.6087 0.6087 0.6087 0.6087 0.6087 0.2174 0.2174 0.2174 0.2174 0.2174 0.2174 0.21740.1739 0.1739 0.1739 0.1739 0.1739 0.1739 0.1739结论:9天后,天气状态趋于稳定P*=(0.6087,0.2174,0.1739)T3.7 对于问题2,求出矩阵的特征值与特征向量,并将特征向量与上一题中的结论作对比. (122页练习14)
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年物流工程师中级考试题库及答案解析
- 知识产权基地培训课件
- 知识产权培训课程申请课件
- 2025年工业互联网区块链智能合约安全漏洞扫描与修复技术解析报告
- 知识产权培训的作用
- 知识产权培训班苏州课件
- 漯河消防知识培训公司课件
- 2025年市政工程面试题集锦与解析
- 2025年高级电动汽车检测与维修面试题集
- 钢瓶检验员基础知识培训
- 无创正压通气护理
- GB/T 20481-2017气象干旱等级
- 《C++程序设计教程》PPT Chapter-5
- 风电发电机组电控系统知识-安全链部分课件
- PMBOK指南第6版中文版
- 医疗质量管理工具课件
- 急性上呼吸道感染病人的护理
- 小学教师量化考核表
- 房建监理平行检查记录表格模板(参考版)
- 计算机操作系统(第四版)-汤小丹-课后习题答案
- 12生物分子网络ppt课件
评论
0/150
提交评论