復(fù)習考試:南京郵電大學數(shù)學實驗練習題參考答案
1第一次練習教學要求:熟練掌握 Matlab 軟件的基本命令和操作,會作二維、三維幾何圖形,能夠用 Matlab 軟件解決微積分、線性代數(shù)與解析幾何中的計算問題。補充命令vpa(x,n) 顯示 x 的 n 位有效數(shù)字,教材 102 頁fplot(f(x),a,b) 函數(shù)作圖命令,畫出 f(x)在區(qū)間a,b上的圖形在下面的題目中 為你的學號的后 3 位(1-9 班)或 4 位(10 班以上)m1.1 計算 與30sinlixxsinlimx程序:syms xlimit(1001*x-sin(1001*x)/x3,x,0)結(jié)果:1003003001/6程序:syms xlimit(1001*x-sin(1001*x)/x3,x,inf)結(jié)果:01.2 ,求 cos10xmye'y程序:syms xdiff(exp(x)*cos(1001*x/1000),2)結(jié)果:-2001/1000000*exp(x)*cos(1001/1000*x)-1001/500*exp(x)*sin(1001/1000*x)21.3 計算 210xyed程序:dblquad(x,y) exp(x.2+y.2),0,1,0,1)結(jié)果:2.139350195142281.4 計算42xdm程序:syms xint(x4/(10002+4*x2)結(jié)果:1/12*x3-1002001/16*x+1003003001/32*atan(2/1001*x)1.5 (10)cos,xyemy求程序:syms xdiff(exp(x)*cos(1000*x),10)結(jié)果:-1009999759158992000960720160000*exp(x)*cos(1001*x)-10090239998990319040000160032*exp(x)*sin(1001*x)31.6 給出 在 的泰勒展式(最高次冪為 4). 10.mx0程序:syms xtaylor(sqrt(1001/1000+x),5)結(jié)果: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 數(shù)列 的定義是 ,nx12,x用循環(huán)語句編程給出該數(shù)列的前 20 項(要求12,(3,4)nnx將結(jié)果用向量的形式給出) 。程序:x=1,1;for n=3:20x(n)=x(n-1)+x(n-2);endx結(jié)果:Columns 1 through 10 1 1 2 3 5 8 13 21 34 55Columns 11 through 20 89 144 233 377 610 987 1597 2584 4181 676541.8 對矩陣 ,求該矩陣的逆矩陣,特征值,特210410Am征向量,行列式,計算 ,并求矩陣 ( 是對角矩陣) ,使得6,PD。1APD程序與結(jié)果:a=-2,1,1;0,2,0;-4,1,1001/1000;inv(a)0.50100100100100 -0.00025025025025 -0.500500500500500 0.50000000000000 02.00200200200200 -0.50050050050050 -1.00100100100100eig(a)-0.49950000000000 + 1.32230849275046i-0.49950000000000 - 1.32230849275046i2.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 a611.9680 13.0080 -4.99100 64.0000 019.9640 -4.9910 -3.0100 51.9 作出如下函數(shù)的圖形(注:先用 M 文件定義函數(shù),再用 fplot 進行函數(shù)作圖): 1202()1)xxf函數(shù)文件 f.m: function y=f(x)if 0 f=inline('(x+1000/x)/2');x0=3;for i=1:20;x0=f(x0);fprintf('%g,%gn',i,x0);end運行結(jié)果: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由運行結(jié)果可以看出, ,數(shù)列 收斂,其值為 31.6228。nx112.2 求出分式線性函數(shù) 的不動點,再編程判212(),()xxmff斷它們的迭代序列是否收斂。解:取 m=1000.(1)程序如下:f=inline('(x-1)/(x+1000)');x0=2;for i=1:20;x0=f(x0);fprintf('%g,%gn',i,x0);end運行結(jié)果: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由運行結(jié)果可以看出, ,分式線性函數(shù)收斂,其值為-0.001001。易見函數(shù)的不動點為-0.001001(吸引點) 。(2)程序如下:f=inline('(x+1000000)/(x+1000)');x0=2;12for i=1:20;x0=f(x0);fprintf('%g,%gn',i,x0);end運行結(jié)果: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由運行結(jié)果可以看出, ,分式線性函數(shù)收斂,其值為 618.31。易見函數(shù)的不動點為 618.31(吸引點) 。2.3 下面函數(shù)的迭代是否會產(chǎn)生混沌?(56 頁練習 7(1) )1202()1)xxf解:程序如下: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);13for 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運行結(jié)果:0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.500.10.20.30.40.50.60.70.80.91x1 - 2 abs(x - 1/2)142.4 函數(shù) 稱為 Logistic 映射,試從“蜘蛛網(wǎng)”()1)(01)fxx圖觀察它取初值為 產(chǎn)生的迭代序列的收斂性,將觀察記錄填人下.5表,若出現(xiàn)循環(huán),請指出它的周期 (56 頁練習 8)3.3 3.5 3.56 3.568 3.6 3.84序列收斂情況 T=2 T=4 T=8 T=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 運行結(jié)果:150 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 100.10.20.30.40.50.60.70.80.91x-(33 x (x - 1)/10當 =3.5 時,上述程序稍加修改,得:0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 100.10.20.30.40.50.60.70.80.91x-(7 x (x - 1)/2當 =3.56 時,得:160 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 100.10.20.30.40.50.60.70.80.91x-(89 x (x - 1)/25當 =3.568 時,得:0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 100.10.20.30.40.50.60.70.80.91x-(446 x (x - 1)/12517當 =3.6 時,得:0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 100.10.20.30.40.50.60.70.80.91x-(18 x (x - 1)/5當 =3.84 時,得:0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 100.10.20.30.40.50.60.70.80.91x-(96 x (x - 1)/25182.5 對于 Martin 迭代,取參數(shù) 為其它的值會得到什么圖形?參考下,abc表(取自 63 頁練習 13) cm m m-m -m m-m m/1000 -mm/1000 m/1000 0.5m/1000 m -mm/100 m/10 -10-m/10 17 4解:取 m=10000;迭代次數(shù) 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:Nm(:,n+1)=f(m(1,n),m(2,n),g(m(1,n);endplot(m(1,:),m(2,:),'kx');axis equal在命令窗口中執(zhí)行 Martin(10000,10000,10000,20000) ,得:19-2 -1.5 -1 -0.5 0 0.5 1 1.5 2x 104-50000500010000150002000025000執(zhí)行 Martin(-10000,-10000,10000,20000) ,得:-2 -1.5 -1 -0.5 0 0.5 1 1.5 2x 104-25000-20000-15000-10000-50000500020執(zhí)行 Martin(-10000,10,-10000,20000) ,得:-12000 -10000 -8000 -6000 -4000 -2000 0 2000-10000-8000-6000-4000-20000執(zhí)行 Martin(10,10,0.5,20000) ,得:-20 -10 0 10 20 30-10-505101520253021執(zhí)行 Martin(10,10000,-10000,20000) ,得:-5000-4000-3000-2000-1000 0 1000 2000 3000 4000 5000-4000-3000-2000-100001000200030004000執(zhí)行 Martin(100,1000,-10,20000) ,得:-600 -400 -200 0 200 400 600 800-500-400-300-200-100010020030040050022執(zhí)行 Martin(-1000,17,4,20000) ,得:-1200 -1000 -800 -600 -400 -200 0 200-1200-1000-800-600-400-20002.6 能否找到分式函數(shù) (其中 是整數(shù)),使它產(chǎn)生2axbcde,abcde的迭代序列(迭代的初始值也是整數(shù))收斂到 (對于 為整數(shù)的學3m3號,請改為求 )。如果迭代收斂,那么迭代的初值與收斂的速度有什310m么關(guān)系.寫出你做此題的體會.提示:教材 54 頁練習 4 的一些分析。若分式線性函數(shù) 的迭代收斂到指定的數(shù) ,則 為()axbfcd2的不動點,因此()fx2abcd化簡得: 。(2)()0cbd若 為整數(shù),易見 。,a2,ca23取滿足這種條件的不同的 以及迭代初值進行編。,abcd解:取 m=10000;根據(jù)上述提示,取:運行結(jié)果如下: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.00022434,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.00022572,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,運行結(jié)果:1,0.0112,9998.83,0.0002000364,100005,0.00026,100007,0.0002268,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.00022746,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.00022884,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,運行結(jié)果: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.00022921,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.00023059,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.0002