




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、目錄第一章1第二章5第三章12第四章32第五章47第六章54補(bǔ)充題 歐拉法,龍格庫(kù)塔法解方程,黑板上的題57第一章1.創(chuàng)建表達(dá)式%可以用syms先符號(hào)運(yùn)算再帶入值x=1;y=2;z=(sqrt(4*x2+1)+0.5457*exp(-0.75*x2-3.75*y2-1.5*x)/(2*sin(3*y)-1)z = -1.4345 2.計(jì)算復(fù)數(shù)x=(-1+sqrt(-5)/4;y=x+8+10jy = 7.7500 +10.5590i 3.help命令學(xué)三維曲線x=-5:0.1:5;y=x;X,Y=meshgrid(x,y);Z=(sin(sqrt(X.2+Y.2)./(sqrt(X.2+Y.2
2、);subplot(221);surf(X,Y,Z);colormap(cool);subplot(222);plot3(X,Y,Z,'linewidth',4); %繪制三維曲線,也可以隨意給定一個(gè)三維曲線的函數(shù)。如果畫這個(gè)曲面,那么將繪出一族三維曲線grid on;subplot(223);meshz(X,Y,Z); %地毯繪圖subplot(224);meshc(X,Y,Z); %等高線繪圖4.peaks等高線(更改原函數(shù))subplot(221);contour(peaks1,20);subplot(222);contour3(peaks1,10); %可以定義等高線條
3、數(shù)subplot(223);contourf(peaks1,10);subplot(224);peaks1;z = 3*(1-x).2.*exp(-(x.2) - (y+1).2) . - 10*(x/5 - x.3 - y.5).*exp(-x.2-y.2) . - 1/3*exp(-(x+1).2 - y.2) 5. LOGO繪制membranelogo第一章書后習(xí)題1.合法性不合法合法不合法不合法合法2.運(yùn)行命令及探討a=sqrt(2)a = 1.4142 答:不是精確的。是一個(gè)近似??赏ㄟ^改變format進(jìn)行位數(shù)顯示調(diào)整。例如:format long;a=sqrt(2)format s
4、hort;a =1.4142 或可使用digits任意指定輸出位數(shù)。例如:digits(50);a=sqrt(2);vpa(a)ans =1.4142426718753769 常見情況下毋需太高精度。3.運(yùn)行結(jié)果討論format long;w1=a(2/3)w2=a2(1/3)w3=(a(1/3)2w1 =1.259921049894873w2 = 1.259921049894873w3 = 1.259921049894873 測(cè)試結(jié)果為相同,說明MATLAB程序執(zhí)行時(shí)經(jīng)過的過程相同。4.clearclfclcclear 為從內(nèi)存中清除變量和函數(shù)clf為清除figure中的已繪圖形以及子圖形c
5、lc為清除命令行窗口5.產(chǎn)生二維數(shù)組顯然第一第二個(gè)方法可以實(shí)現(xiàn)。例如:s=1 2 3;4 5 6;7 8 9s = 1 2 3 4 5 6 7 8 9即是一個(gè)簡(jiǎn)便的鍵入矩陣的方法。第二章1 數(shù)據(jù)類型class(3/7+0.1)class(sym(3/7+0.1)class(vpa(sym(3/7+0.1),4)class(vpa(sym(3/7+0.1)ans =doubleans =symans =symans =sym 2 哪些精準(zhǔn)?a1=sin(sym(pi/4)+exp(sym(0.7)+sym(pi/3);a2=sin(sym(pi/4)+exp(sym(0.7)*exp(sym(p
6、i/3);a3=sin(sym('pi/4')+exp(sym('0.7')*exp(sym('pi/3');a4=sin(sym('pi/4')+exp(sym('0.7+pi/3');a5=sin(sym(pi/4)+exp(sym(0.7+pi/3);a6=sin(sym(pi/4)+sym(exp(0.7+pi/3);a7=sin(sym(pi/4+exp(0.7+pi/3);a8=sym(sin(pi/4+exp(0.7+pi/3);digits(64);vpa(a2-a1)vpa(a3-a1)vpa(a
7、4-a1) %為精確值vpa(a5-a1)vpa(a6-a1)vpa(a7-a1)vpa(a8-a1)ans =8.7726891121158158175e-72ans =8.7726891121158158175e-72ans =0.0ans =-0.71695958461952263725448756502087045ans =-0.28176563341755777826288ans =-0.9717949568364259064934ans =-0.0048456667 可以看到,除了a4為精確,其余均存在很小的誤差。其中a2及a3的誤差較小,小于eps精度,故可認(rèn)為為精確的。3 獨(dú)立
8、自由變量a1=sym('sin(w*t)') ;a2=sym('a*exp(-X)' );a3=sym('z*exp(j*th)');symvar(a1,1)symvar(a2,1)symvar(a3,1)ans =wans =aans =z 6 符號(hào)解syms x k;f1=x.k;s1=symsum(f1,k,0,inf);s2=subs(f1,x,(-1/3);s3=subs(f1,x,(1/pi);s4=subs(f1,x,3);symsum(s2,k,0,inf)double(symsum(s3,k,0,inf)symsum(s4,k,
9、0,inf)ans =3/4ans = 1.4669ans =Inf7 限定性假設(shè)reset(symengine);syms k;syms x positive;f1=(2/(2*k+1)*(x-1)/(x+1)(2*k+1);f1_s=symsum(f1,k,0,inf);simplify(f1_s,'steps',27,'IgnoreAnalyticConstraints',true)ans =log(x) 8 符號(hào)計(jì)算syms t;yt=abs(sin(t);dydt=diff(yt,t)dydt0=limit(dydt,t,0,'left'
10、;)dydtpi=subs(dydt,t,(pi/2) dydt =sign(sin(t)*cos(t)dydt0 =-1dydtpi =0 9 積分值syms x;fx=exp(-abs(x)*abs(sin(x)fxint=int(fx,-5*pi,1.7*pi);vpa(fxint,64)fx =abs(sin(x)*exp(-x)ans =3617514.63564742427351773680704 10二重積分syms x y;fxy=x2+y2;int(int(fxy,y,1,x2),x,1,2)ans =1006/105 11 繪出曲線syms t x;fx=int(sin(t
11、)./t),t,0,x);ezplot(fx)fx4=subs(fx,x,4.5)fx4 =sinint(9/2)12 積分表達(dá)式syms x;syms n positive;yn=int(sin(x).n,x,0,pi/2)yn3=subs(yn,n,1/3);vpa(yn3,32)yn =beta(1/2, n/2 + 1/2)/2ans =1.2935547796148952674767575125656 13 序列卷積syms a b n;syms k positive;xk=a.k;hk=b.k;kn=subs(xk,k,k-n)*subs(hk,k,n);yk=symsum(kn,
12、n,0,k)yk =piecewise(a = b and b = 0, bk*(k + 1), a = b or b = 0, (a*ak - b*bk)/(a - b) 所以答案為a*ak - b*bk)/(a - b)20求解solvereset(symengine)syms x y;s=solve('x2+y2-1','x*y-2','x','y')s.xs.ys = x: 4x1 sym y: 4x1 symans =(15(1/2)*i)/2 + 1/2)(1/2)/2 - (15(1/2)*i)/2 + 1/2)(3
13、/2)/2 - (15(1/2)*i)/2 + 1/2)(1/2)/2 + (15(1/2)*i)/2 + 1/2)(3/2)/2 (1/2 - (15(1/2)*i)/2)(1/2)/2 - (1/2 - (15(1/2)*i)/2)(3/2)/2 - (1/2 - (15(1/2)*i)/2)(1/2)/2 + (1/2 - (15(1/2)*i)/2)(3/2)/2ans = (15(1/2)*i)/2 + 1/2)(1/2)-(15(1/2)*i)/2 + 1/2)(1/2) (1/2 - (15(1/2)*i)/2)(1/2)-(1/2 - (15(1/2)*i)/2)(1/2) 2
14、3 求通解clear all;yso=simplify(dsolve('Dy*y*0.1+0.3*x=0','x')yso = (- 3*x2 + 2*C3)(1/2)-(- 3*x2 + 2*C3)(1/2) %此題存疑holdon;clear all;reset(symengine);syms x;y1=(- 3*x2 + 2*1)(1/2);y2=-(- 3*x2 + 2*1)(1/2);h1=ezplot(y1,x,-2 2 -2 2,1);h2=ezplot(y2,x,-2 2 -2 2,1);gridon;title('');warn
15、ing off;axis(-2 2 -2 2);set(h1,'color','r','linewidth',2);set(h2,'color','r','linewidth',2);xlabel('Y');ylabel('x'); %對(duì)于第二章存在問題的習(xí)題的探討2.23clear all;syms x;yso=simplify(dsolve('Dy*y*0.1+0.3*x=0','x') %此題存疑holdon;clear all;
16、reset(symengine);syms x;y1=(- 3*x2 + 2*1)(1/2);y2=-(- 3*x2 + 2*1)(1/2);h1=ezplot(y1,x,-2 2 -2 2,1);h2=ezplot(y2,x,-2 2 -2 2,1);gridon;title('');warning off;axis(-2 2 -2 2);set(h1,'color','r','linewidth',2);set(h2,'color','r','linewidth',2);xlab
17、el('Y');ylabel('x'); yso =(- 3*x2 + 2*C3)(1/2)-(- 3*x2 + 2*C3)(1/2)%以上方法可以繪出正常的橫坐標(biāo)為y縱坐標(biāo)為x的圖像,但發(fā)現(xiàn)在y=0處x延伸至正負(fù)無(wú)窮。h1=ezplot(y1,-2 2 -2 2,1);h2=ezplot(y2,-2 2 -2 2,1);%以上方法繪出的圖像存在一個(gè)空隙,且默認(rèn)為y-x圖像。reset(symengine);syms x y S;S = dsolve('Dy*y/5+x/4=0','x');ezplot(subs(y2-(S(1)
18、2, 'C3', 1),-2,2 -2,2,2);grid on;%用橢圓方程繪圖不產(chǎn)生間隙24 一階微分方程syms a b;ys=dsolve('Dy-a*x2-b*x=0','y(0)=2',x)ys =(x2*(3*b + 2*a*x)/6 + 2 25 邊值問題fs=dsolve('Df-3*f=4*g,Dg+4*f=3*g','f(0)=0,g(0)=1')fs = g: 1x1 symf: 1x1 sym fs.gfs.fans =cos(4*t)*exp(3*t)ans =sin(4*t)*exp(
19、3*t) 第三章3.行下標(biāo)列下標(biāo)rng('default');A=rand(3,5);L=A>0.5 L = 1 1 0 1 1 1 1 1 0 0 0 0 1 1 1 a,b=find(L=1) IND=sub2ind(size(A),a,b)IND = 1 2 4 5 8 9 10 12 13 15 4.循環(huán)運(yùn)算、數(shù)組運(yùn)算t=0:0.1:10;N=length(t); y1=zeros(size(t); for k=1:N y1(k)=1-exp(-0.5*t(k)*cos(2*t(k);endplot(t,y1);xlabel('t');ylabel
20、('y1'); y2=1-exp(-0.5*t).*cos(2*t); plot(t,y2);xlabel('t');ylabel('y2'); 5.回答問題clear all;A=magic(3);B=rand(3);A*BB*Aans = 5.4072 11.5771 3.0037 6.3884 10.3215 4.9680 2.7058 7.5337 4.8496ans = 2.5916 3.8303 5.2097 3.4833 5.6313 3.6800 10.9646 9.0086 12.3554 相同,對(duì)于矩陣而言對(duì)位相乘無(wú)差異不相同
21、,點(diǎn)乘及矩陣乘法進(jìn)行的不是同一種運(yùn)算。不相同,左乘右乘運(yùn)算不同。相同,A左點(diǎn)除B等同于B右點(diǎn)除A,均是對(duì)位計(jì)算。不相同,左除右除運(yùn)算亦不相同。A*AB-BA*(AB)-BA*(A*inv(B)-B ans = -0.0562 -0.6902 -0.0436 -0.1051 -0.3282 -0.4311 -0.8011 -0.9350 -0.3763ans =1.0e-15 * 0 -0.1110 -0.0278 0 0 0 0 0.1110 0ans = -80.2971 65.0383 107.2212 -8.0299 91.2626 70.5679 -66.2535 153.4898 6
22、6.4342 不相同。第二個(gè)更接近0。具體原理需要參考線性代數(shù)書有點(diǎn)忘了。Aeye(3)eye(3)/A ans = 0.1472 -0.1444 0.0639 -0.0611 0.0222 0.1056 -0.0194 0.1889 -0.1028ans =0.1472 -0.1444 0.0639 -0.0611 0.0222 0.1056 -0.0194 0.1889 -0.1028 相同。因?yàn)閷?duì)于對(duì)角陣,二者均可化為同一形式。6.結(jié)果不同A=1 2; 3 4;B1=A.(0.5)B2=0.5.AB3=A(0.5)B4=0.5A B1 = 1.0000 1.4142 1.7321 2.0
23、000B2 = 0.5000 0.2500 0.1250 0.0625B3 = 0.5537 + 0.4644i 0.8070 - 0.2124i 1.2104 - 0.3186i 1.7641 + 0.1458iB4 = 0.9910 -0.4422 -0.6634 0.3276 A1=B1.*B1A3=B3*B3norm(A1-A3,'fro')A1 = 1.0000 2.0000 3.0000 4.0000A3 = 1.0000 + 0.0000i 2.0000 + 0.0000i 3.0000 - 0.0000i 4.0000 + 0.0000ians = 1.2831
24、e-15 可見誤差在eps量級(jí),可以認(rèn)為相等。7.繪出圖形x=-3*pi:pi/15:3*pi;y=x;X,Y=meshgrid(x,y); warning off; Z=sin(X).*sin(Y)./X./Y;共有10個(gè)非數(shù)數(shù)據(jù)。surf(X,Y,Z)shadinginterpx=-3*pi:pi/15:3*pi;Lx=(x=0);xx=x+Lx*realmin;y=xx;X,Y=meshgrid(xx,y); warning off; Z=sin(X).*sin(Y)./X./Y;surf(X,Y,Z)shadinginterp即消除零點(diǎn)處的斷點(diǎn)即可8.兩種思路%第二種思路functio
25、n z=zpoly_z(x,y)ifx+y<=-1 z=0.546*exp(-0.75*y.2-3.75*x.2+1.5*x);elseifx+y>-1 & x+y<=1z=0.758*exp(-y.2-6*x.2);else z=0.546*exp(-0.75*y.2-3.75*x.2-1.5*x);end x=-1.5:0.1:1.5;y=-3:0.1:3;X,Y=meshgrid(x,y);Z=zpoly_z(X,Y);surf(X,Y,Z);%第一種思路x=-1.5:0.1:1.5;y=-3:0.2:3;LX=length(x);LY=length(y);fo
26、r ii=1:LXforjj=1:LYif x(ii)+y(jj)<=-1z=0.546*exp(-0.75*y.2-3.75*x.2+1.5*x);elseif x(ii)+y(jj)>-1 & x(ii)+y(jj)<=1z=0.758*exp(-y.2-6*x.2);else z=0.546*exp(-0.75*y.2-3.75*x.2-1.5*x);endendendX,Y=meshgrid(x,y);Z=zpoly_z(X,Y);surf(X,Y,Z); %其實(shí)for循環(huán)完全無(wú)意義9.矩陣計(jì)算%第一問老師取消rng defaultA=randn(50,70)
27、+1i*randn(50,70);B=randn(70,60)+1i*randn(70,60);C=randn(50,60)+1i*randn(50,60);D=randn(60,1)+1i*randn(60,1);G=(A*B-C)*DGr=real(G),70,70Gi=imag(G)Gn=norm(G,2)G = 1.0e+02 * -0.1776 + 1.9914i 0.6088 + 0.3316i -0.1340 - 0.8615i 0.0752 - 0.0759i -0.1171 - 1.8169i 0.2005 - 1.4540i -1.4501 + 0.1897i 0.6445
28、 + 0.1657i -1.0651 + 0.1191i 0.3301 - 0.0450i -1.4338 + 0.8707i -0.9491 + 1.4840i 1.1314 + 1.2751i -0.5158 - 0.0725i -0.2746 + 0.2518i -1.0279 - 0.8409i -1.1161 - 2.3362i 0.1346 + 1.3500i 0.4220 - 1.2839i 0.2650 - 0.2849i -1.0212 + 0.5374i 0.0563 + 0.4151i -1.9074 - 0.2448i 0.1645 + 1.2071i 1.1870 +
29、 0.0085i 1.2304 + 0.6672i 0.3303 - 1.6027i -0.5728 - 0.5519i 0.3738 + 0.2863i -0.6682 - 0.7565i 1.6063 + 1.2886i 0.6994 - 1.3377i 0.6523 + 0.0318i -0.2143 - 2.8209i 1.7026 - 0.1371i 0.9285 + 1.5852i -0.7550 - 0.2427i -1.3879 - 1.8978i -0.5266 - 0.8334i -0.0849 + 0.1680i 1.1590 + 0.2109i -1.8938 + 0.
30、6709i 0.3406 - 1.8211i -1.0916 - 1.8076i 0.2062 - 1.4363i 1.3679 + 0.2061i -0.4541 + 0.8056i 1.3574 + 0.8773i -0.1071 + 0.0948i 0.1042 + 2.2812iGr = -17.7553 60.8848 -13.4003 7.5175 -11.7073 20.0458 -145.0055 64.4517 -106.5069 33.0077 -143.3779 -94.9055 113.1368 -51.5804 -27.4560 -102.7914 -111.6150
31、 13.4596 42.2009 26.5006 -102.1225 5.6295 -190.7388 16.4525 118.6963 123.0361 33.0336 -57.2817 37.3849 -66.8175 160.6261 69.9436 65.2278 -21.4319 170.2597 92.8549 -75.5045 -138.7923 -52.6574 -8.4902 115.9030 -189.3844 34.0593 -109.1584 20.6169 136.7896 -45.4089 135.7386 -10.7050 10.4240Gi = 199.1404
32、 33.1590 -86.1452 -7.5887 -181.6856 -145.4039 18.9686 16.5731 11.9053 -4.5021 87.0651 148.4022 127.5072 -7.2483 25.1791 -84.0887 -233.6194 135.0018 -128.3931 -28.4923 53.7385 41.5139 -24.4788 120.7113 0.8532 66.7238 -160.2738 -55.1871 28.6287 -75.6522 128.8596 -133.7671 3.1772 -282.0866 -13.7111 158
33、.5203 -24.2673 -189.7767 -83.3384 16.7992 21.0869 67.0898 -182.1134 -180.7631 -143.6344 20.6149 80.5622 87.7339 9.4764 228.1237Gn = 1.0253e+03 y2=1-exp(-0.5*t).*cos(2*t); plot(t,y2);xlabel('t');ylabel('y2'); 5.回答問題clear all;A=magic(3);B=rand(3);A*BB*Aans = 5.4072 11.5771 3.0037 6.388
34、4 10.3215 4.9680 2.7058 7.5337 4.8496ans = 2.5916 3.8303 5.2097 3.4833 5.6313 3.6800 10.9646 9.0086 12.3554 相同,對(duì)于矩陣而言對(duì)位相乘無(wú)差異不相同,點(diǎn)乘及矩陣乘法進(jìn)行的不是同一種運(yùn)算。不相同,左乘右乘運(yùn)算不同。相同,A左點(diǎn)除B等同于B右點(diǎn)除A,均是對(duì)位計(jì)算。不相同,左除右除運(yùn)算亦不相同。A*AB-BA*(AB)-BA*(A*inv(B)-B ans = -0.0562 -0.6902 -0.0436 -0.1051 -0.3282 -0.4311 -0.8011 -0.9350 -0.3
35、763ans =1.0e-15 * 0 -0.1110 -0.0278 0 0 0 0 0.1110 0ans = -80.2971 65.0383 107.2212 -8.0299 91.2626 70.5679 -66.2535 153.4898 66.4342 不相同。第二個(gè)更接近0。具體原理需要參考線性代數(shù)書有點(diǎn)忘了。Aeye(3)eye(3)/A ans = 0.1472 -0.1444 0.0639 -0.0611 0.0222 0.1056 -0.0194 0.1889 -0.1028ans =0.1472 -0.1444 0.0639 -0.0611 0.0222 0.1056
36、 -0.0194 0.1889 -0.1028 相同。因?yàn)閷?duì)于對(duì)角陣,二者均可化為同一形式。6.結(jié)果不同A=1 2; 3 4;B1=A.(0.5)B2=0.5.AB3=A(0.5)B4=0.5A B1 = 1.0000 1.4142 1.7321 2.0000B2 = 0.5000 0.2500 0.1250 0.0625B3 = 0.5537 + 0.4644i 0.8070 - 0.2124i 1.2104 - 0.3186i 1.7641 + 0.1458iB4 = 0.9910 -0.4422 -0.6634 0.3276 A1=B1.*B1A3=B3*B3norm(A1-A3,
37、9;fro')A1 = 1.0000 2.0000 3.0000 4.0000A3 = 1.0000 + 0.0000i 2.0000 + 0.0000i 3.0000 - 0.0000i 4.0000 + 0.0000ians = 1.2831e-15 可見誤差在eps量級(jí),可以認(rèn)為相等。7.繪出圖形x=-3*pi:pi/15:3*pi;y=x;X,Y=meshgrid(x,y); warning off; Z=sin(X).*sin(Y)./X./Y;共有10個(gè)非數(shù)數(shù)據(jù)。surf(X,Y,Z)shadinginterpx=-3*pi:pi/15:3*pi;Lx=(x=0);xx=x
38、+Lx*realmin;y=xx;X,Y=meshgrid(xx,y); warning off; Z=sin(X).*sin(Y)./X./Y;surf(X,Y,Z)shadinginterp即消除零點(diǎn)處的斷點(diǎn)即可8.兩種思路%第二種思路function z=zpoly_z(x,y)ifx+y<=-1 z=0.546*exp(-0.75*y.2-3.75*x.2+1.5*x);elseifx+y>-1 & x+y<=1z=0.758*exp(-y.2-6*x.2);else z=0.546*exp(-0.75*y.2-3.75*x.2-1.5*x);end x=-1
39、.5:0.1:1.5;y=-3:0.1:3;X,Y=meshgrid(x,y);Z=zpoly_z(X,Y);surf(X,Y,Z);%第一種思路x=-1.5:0.1:1.5;y=-3:0.2:3;LX=length(x);LY=length(y);for ii=1:LXforjj=1:LYif x(ii)+y(jj)<=-1z=0.546*exp(-0.75*y.2-3.75*x.2+1.5*x);elseif x(ii)+y(jj)>-1 & x(ii)+y(jj)<=1z=0.758*exp(-y.2-6*x.2);else z=0.546*exp(-0.75*
40、y.2-3.75*x.2-1.5*x);endendendX,Y=meshgrid(x,y);Z=zpoly_z(X,Y);surf(X,Y,Z); %其實(shí)for循環(huán)完全無(wú)意義9.矩陣計(jì)算%第一問老師取消rng defaultA=randn(50,70)+1i*randn(50,70);B=randn(70,60)+1i*randn(70,60);C=randn(50,60)+1i*randn(50,60);D=randn(60,1)+1i*randn(60,1);G=(A*B-C)*DGr=real(G),70,70Gi=imag(G)Gn=norm(G,2)G = 1.0e+02 * -0
41、.1776 + 1.9914i 0.6088 + 0.3316i -0.1340 - 0.8615i 0.0752 - 0.0759i -0.1171 - 1.8169i 0.2005 - 1.4540i -1.4501 + 0.1897i 0.6445 + 0.1657i -1.0651 + 0.1191i 0.3301 - 0.0450i -1.4338 + 0.8707i -0.9491 + 1.4840i 1.1314 + 1.2751i -0.5158 - 0.0725i -0.2746 + 0.2518i -1.0279 - 0.8409i -1.1161 - 2.3362i 0.
42、1346 + 1.3500i 0.4220 - 1.2839i 0.2650 - 0.2849i -1.0212 + 0.5374i 0.0563 + 0.4151i -1.9074 - 0.2448i 0.1645 + 1.2071i 1.1870 + 0.0085i 1.2304 + 0.6672i 0.3303 - 1.6027i -0.5728 - 0.5519i 0.3738 + 0.2863i -0.6682 - 0.7565i 1.6063 + 1.2886i 0.6994 - 1.3377i 0.6523 + 0.0318i -0.2143 - 2.8209i 1.7026 -
43、 0.1371i 0.9285 + 1.5852i -0.7550 - 0.2427i -1.3879 - 1.8978i -0.5266 - 0.8334i -0.0849 + 0.1680i 1.1590 + 0.2109i -1.8938 + 0.6709i 0.3406 - 1.8211i -1.0916 - 1.8076i 0.2062 - 1.4363i 1.3679 + 0.2061i -0.4541 + 0.8056i 1.3574 + 0.8773i -0.1071 + 0.0948i 0.1042 + 2.2812iGr = -17.7553 60.8848 -13.400
44、3 7.5175 -11.7073 20.0458 -145.0055 64.4517 -106.5069 33.0077 -143.3779 -94.9055 113.1368 -51.5804 -27.4560 -102.7914 -111.6150 13.4596 42.2009 26.5006 -102.1225 5.6295 -190.7388 16.4525 118.6963 123.0361 33.0336 -57.2817 37.3849 -66.8175 160.6261 69.9436 65.2278 -21.4319 170.2597 92.8549 -75.5045 -
45、138.7923 -52.6574 -8.4902 115.9030 -189.3844 34.0593 -109.1584 20.6169 136.7896 -45.4089 135.7386 -10.7050 10.4240Gi = 199.1404 33.1590 -86.1452 -7.5887 -181.6856 -145.4039 18.9686 16.5731 11.9053 -4.5021 87.0651 148.4022 127.5072 -7.2483 25.1791 -84.0887 -233.6194 135.0018 -128.3931 -28.4923 53.738
46、5 41.5139 -24.4788 120.7113 0.8532 66.7238 -160.2738 -55.1871 28.6287 -75.6522 128.8596 -133.7671 3.1772 -282.0866 -13.7111 158.5203 -24.2673 -189.7767 -83.3384 16.7992 21.0869 67.0898 -182.1134 -180.7631 -143.6344 20.6149 80.5622 87.7339 9.4764 228.1237Gn = 1.0253e+03 第四章1 數(shù)值差分d=0.001;dxdt_diff=dif
47、f(y)/d;dxdt_grad=gradient(y)/d;hold on;plot(t,y,'-r');plot(t(1:end-1),dxdt_diff,'-g');plot(t,dxdt_grad,'-b');數(shù)值求導(dǎo)后存在很多的毛刺2 數(shù)值計(jì)算d=1e-5;t=0:d:10;t=t+(t=0)*realmin;%去除影響fx=sin(t)./t;y=cumtrapz(fx)*d;plot(t,y);yt1=find(t=4.5);y45=y(yt1)y45 = 1.6541嘗試integrald=1e-5;t=0:d:10;t=t+(t
48、=0)*realmin;%去除影響fx=(t)sin(t)./t;y=integral(fx,0,10)%plot(t,y);%yt1=find(t=4.5);%y45=y(yt1)y = 1.6583 3 數(shù)值積分d=1e-5;t=0:d:pi;t=t+(t=0)*realmin;%去除影響fx=(t)exp(sin(t).3);s=integral(fx,0,pi)s = 5.1370符號(hào)驗(yàn)算syms x;fxx=exp(sin(x)3);ss=int(fxx,x,0,pi)ss =int(exp(sin(x)3), x, 0, pi) 此時(shí)符號(hào)運(yùn)算不如數(shù)值運(yùn)算可以得出解析解4 求數(shù)值積分clear;fx=(x)exp(-abs(x).*abs(sin(x); format long ;s=integral(fx,-5*pi,inf,'Abstol',1e-9) s = 1.8886x=linspace(-5*pi,50,1e7);dx=x(2)-x(1);st=trapz(exp(-abs(x).*abs
溫馨提示
- 1. 本站所有資源如無(wú)特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度企業(yè)年會(huì)短視頻拍攝制作合同
- 二零二五年度戶外廣告發(fā)布合作合同
- 二零二五年度草原雇傭放羊與生態(tài)補(bǔ)償協(xié)議
- 二零二五年度資質(zhì)借用及資源共享協(xié)議
- 2025年度施工安全協(xié)議個(gè)人責(zé)任履行細(xì)則
- 二零二五年度房地產(chǎn)項(xiàng)目銷售代理與節(jié)能環(huán)保技術(shù)合作合同
- 二零二五年度休閑度假村包租合作合同
- 二零二五年度醫(yī)療行業(yè)勞動(dòng)合同管理規(guī)范與醫(yī)護(hù)人員保障措施
- 掛靠證件合同模板(2025年度)適用于文化創(chuàng)意產(chǎn)業(yè)
- 二零二五年度電子商務(wù)借款居間服務(wù)合同協(xié)議
- 《論文所用框架圖》課件
- 人教版三年級(jí)下冊(cè)說課標(biāo)、說教材
- 2022版《義務(wù)教育科學(xué)課程標(biāo)準(zhǔn)》試題及答案
- 《民法典》背景下違約精神損害賠償制度適用問題
- 松下機(jī)器人操作手冊(cè)
- 數(shù)字電路邏輯設(shè)計(jì)(第3版)PPT全套完整教學(xué)課件
- 境外道路貨物運(yùn)輸應(yīng)急預(yù)案
- 管理學(xué)-北京師范大學(xué)中國(guó)大學(xué)mooc課后章節(jié)答案期末考試題庫(kù)2023年
- 2023年司法鑒定程序通則
- 網(wǎng)店運(yùn)營(yíng)PPT全套完整教學(xué)課件
- 1.跨境電子商務(wù)概述
評(píng)論
0/150
提交評(píng)論