您的当前位置:首页正文

matlab实验

2022-04-15 来源:意榕旅游网
2. >> A=[1,2,3,4;4,3,2,1;2,3,4,1;3,2,4,1] A =

1 2 3 4 4 3 2 1 2 3 4 1 3 2 4 1

>> B=[1+4j,2+3j,3+2j,4+1j;4+1j,3+2j,2+3j,1+4j;2+3j,3+2j,4+1j,1+4j;3+2j,2+3j,4+1j,1+4j] B =

1.0000 + 4.0000i 2.0000 + 3.0000i 3.0000 + 2.0000i 4.0000 + 1.0000i 4.0000 + 1.0000i 3.0000 + 2.0000i 2.0000 + 3.0000i 1.0000 + 4.0000i 2.0000 + 3.0000i 3.0000 + 2.0000i 4.0000 + 1.0000i 1.0000 + 4.0000i 3.0000 + 2.0000i 2.0000 + 3.0000i 4.0000 + 1.0000i 1.0000 + 4.0000i

>> A(5,6)=5 A =

1 2 3 4 0 0 4 3 2 1 0 0 2 3 4 1 0 0 3 2 4 1 0 0 0 0 0 0 0 5

3. >> A=magic(8); >> B=A(2:2:end,:) B =

9 55 54 12 13 51 50 16 40 26 27 37 36 30 31 33 41 23 22 44 45 19 18 48 8 58 59 5 4 62 63 1

4. >> format long;sum(2.^[0:63])

ans =

1.844674407370955e+019

>> sum(sym(2).^[0:200]) ans =

3213876088517980551083924184682325205044405987565585670602751

5. >> t=[-1:0.01:1]; >> y=sin(t);plot(t,y)

10.80.60.40.20-0.2-0.4-0.6-0.8-1-1-0.8-0.6-0.4-0.200.20.40.60.81

>> t=[-pi:0.05:pi];

>> y=sin(tan(t))-tan(sin(t)); >> plot(t,y)

3210-1-2-3-4-3-2-101234

6. >> xx=[-2:.1:-1.2,-1.1:0.02:-0.9,-0.8:0.1:0.8,0.9:0.02:1.1,1.2:0.1:2]; yy=[-1:0.1:-0.2,-0.1:0.02:0.1,0.2:.1:1]; [x,y]=meshgrid(xx,yy);

z=1./(sqrt((1-x).^2+y.^2))+1./(sqrt((1+x).^2+y.^2)); subplot(224),surf(x,y,z);

subplot(221),surf(x,y,z),view(0,90); subplot(222),surf(x,y,z),view(90,0); subplot(223),surf(x,y,z),view(0,0);

10.50-0.5-1-26060 4020-10120 -1-0.500.51100405020010-1012-1-2020-2

7.

(1) >> syms x;f=(3^x+9^x)^(1./x);limit(f,x,inf)

ans =

9

(2) >> syms x y;f=x*y/(sqrt(x*y+1)-1);

>> L1=limit(limit(f,x,0),y,0)

L1 =

2

(3) >> syms x y;f=(1-cos(x^2+y^2))/((x^2+y^2)*exp(x^2+y^2));

>> l=limit(limit(f,x,0),y,0)

l =

0

8. >> syms t;y=cos(t)-t*sin(t);x=log(cos(t)); f=diff(y,t,1)/diff(x,t,1) f =

(cos(t)*(2*sin(t) + t*cos(t)))/sin(t)

>> l=diff(y,t,2)/diff(x,t,2);subs(l,t,sym(pi)/3) ans =

3/8 - (pi*3^(1/2))/24

9. >> syms x y t;f=exp(-t^2);I=int(f,t,0,x*y) I =

(pi^(1/2)*erf(x*y))/2

>> syms x y t;h=exp(-t^2);f=int(h,t,0,x*y) f =

(pi^(1/2)*erf(x*y))/2

>> result=((x)/(y))*simple(diff(f,x,2))-2*simple(diff(diff(f,x,1),y,1))+diff(f,y,2) result =

(2*(2*x^2*y^2 - 1))/exp(x^2*y^2) - (2*x^3*y)/exp(x^2*y^2) - (2*x^2*y^2)/exp(x^2*y^2)

10.(1)>> syms n;

>> s=symsum(1/((2*n)^2-1),n,1,inf) s = 1/2

(2)>> limit(n*symsum(1/(n^2+k*pi),k,1,n),n,inf) ans = 1

11.(1)>> syms t a;x=a*(cos(t)+t*sin(t));y=a*(sin(t)-t*cos(t)); I=int((x^2+y^2)*sqrt(diff(x,t)^2+diff(y,t)^2),t,0,2*pi) I =

2*pi^2*(2*pi^2 + 1)*(a^2)^(3/2)

(2)>> syms t a b c;x=c*cos(t)/a;y=c*cos(t)/b;

>> F=[y*x^3+exp(y),x*y^3+x*exp(y)-2*y];ds=[diff(x,t);diff(y,t)]; >> I=int(F*ds,t,pi,0) I =

((2*a^3*c^5)/5 + (2*b^3*c^5)/5)/(a^4*b^4)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^4*a^3*c^2*d+e^4*a^3*d^2*b-e^4*a^3*d^2*c-e^4*b^3*a^2*c+e^4*b^3*a^2*d+e^4*b^3*c^2*a-e^4*b^3*c^2*d-e^4*b^3*d^2*a+e^4*b^3*d^2*c+e^4*c^3*a^2*b-e^4*c^3*a^2*d-e^4*c^3*b^2*a+e^4*c^3*b^2*d+e^4*c^3*d^2*a-e^4*c^3*d^2*b-e^4*d^3*a^2*b+e^4*d^3*a^2*c+e^4*d^3*b^2*a-e^4*d^3*b^2

*c-e^4*d^3*c^2*a+e^4*d^3*c^2*b-c^4*e^3*d^2*a ans =

(c-d)*(b-d)*(b-c)*(a-d)*(a-c)*(a-b)*(-d+e)*(e-c)*(e-b)*(e-a)

13. jordan(A) ans = -4 -2 -2 -2 v =

[ 0, 1/2, 1/2, -1/4] [ 0, 0, 1/2, 1] [ 1/4, 1/2, 1/2, -1/4] [ 1/4, 1/2, 1, -1/4] j =

[ -4, 0, 0, 0] [ 0, -2, 1, 0] [ 0, 0, -2, 1] [ 0, 0, 0, -2]

14.试用数值方法和解析方法求取下面的

>>

A=[-2,0.5,-0.5,0.5;0,-1.5,0.5,-0.5;2,0.5,-4.5,0.5;2,1,-2,-2];A=sym(A);eig(A),[v,j]=

Sylvester方程,并验证得出的结果。

64031422636713100114030B=[3 -2 1;-2 -9 2;-2 -1 9];

543X04211123214X292561

219644663数值法:>> A=[3,-6,-4,0,5;1 4 2 -2 4;-6 3 -6 7 3;-13 10 0 -11 0;0 4 0 3 4]; C=[-2 1 -1;4 1 2;5 -6 1;6 -4 -4;-6 6 -3];

X = lyap(A,B,C),norm(A*X+X*B+C) X =

-4.0569 -14.5128 1.5653 0.0356 25.0743 -2.7408 9.4886 25.9323 -4.4177 2.6969 21.6450 -2.8851 7.7229 31.9100 -3.7634 ans =

3.3061e-13

解析法:>> x=lyapsym(sym(A),B,C),norm(A*X+X*B+C) x =

[ -434641749950/107136516451, -4664546747350/321409549353, 503105815912/321409549353]

[ 3809507498/107136516451, 8059112319373/321409549353, -880921527508/321409549353]

[ 1016580400173/107136516451, 8334897743767/321409549353, -1419901706449/321409549353]

[ 288938859984/107136516451, 6956912657222/321409549353, -927293592476/321409549353]

[ 827401644798/107136516451, 10256166034813/321409549353, -1209595497577/321409549353] ans =

3.3061e-13

第二部分

10.试求出下面微分方程的通解。

(t)2tx(t)t2x(t)t1;(2)y(x)2xy(x)xex。 x(1)2(1)>> syms t; x=dsolve('D2x+2*t*Dx+t^2*x=t+1') x=

=

exp(t-1/2*t^2)*C2+exp(-t-1/2*t^2)*C1-1/2*i*pi^(1/2)*2^(1/2)*erf(1/2*i*2^(1/2)*(-1+t))*exp(-1/2+t-1/2*t^2) (2) y =

C5*exp(-x^2) + (x^2*exp(-x^2))/2

>> syms x; y=dsolve('Dy+2*x*y=x*exp(-x^2)','x')

11. 考虑著名的化学反应方程组,选定,,且,绘制仿真结果的三维相轨迹,并得出其在x-y平面上的投影。在实际求解中建议将作为附加参数,同样的方程若设,,时,绘制出状态变量的二维图和三维图。

>> f=inline('[-x(2)-x(3);x(1)+a*x(2);b+(x(1)-c)*x(3)]','t','x','flag','a','b','c'); >> [t,x]=ode45(f,[0,100],[0;0;0],[],0.2,0.2,5.7); >> plot(t,x); >> figure;

>> plot3(x(:,1),x(:,2),x(:,3));grid on

2520151050-5-10-1501020304050607080901002520151050100-10-20-5-10051510

>> [t,x]=ode45(f,[0,100],[0;0;0],[],0.2,0.5,10); >> plot3(x(:,1),x(:,2),x(:,3));grid on

40302010020100-10-20-20-1010020

12.试选择状态变量,将下面的非线性微分方程组转换成一阶显式微分方程组,并用 MATLAB对其求解,绘制出解的相平面或相空间曲线。

xy(3x)2(y)362txy(3)xextyy (1)4x(1)2,xy(1)2,y(1)7,(1)6y>> f=inline(['[x(2); -x(1)-x(3)-(3*x(2))^2+(x(4))^3+6*x(5)+2*t; ',... 'x(4); x(5); -x(5)-x(2)-exp(-x(1))-t]'],'t','x');

>> [t1,x1]=ode45(f,[1,0],[2, 4, -2, 7, 6]');[t2,x2]=ode45(f,[1,2],[2, 4, -2, 7, 6]'); >> t=[t1(end:-1:1); t2]; x=[x1(end:-1:1,:); x2]; >> plot(t,x);figure; plot(x(:,1),x(:,3))

121086420-2-4-6-800.20.40.60.811.21.41.61.8286420-2-4-612345678910

14.用生成一组较稀疏的数据,并用一维数据插值的方法对给出的数据进行曲线拟合,并将结果与理论曲线相比较。

>> t=0:.2:3;y=t.^2.*exp(-5*t).*sin(t);plot(t,y,'o'); >> hold on;x1=0:0.01:3;y1=interp1(t,y,x1,'spline'); >> plot(x1,y1)

12x 10-31086420-200.511.522.53

因篇幅问题不能全部显示,请点此查看更多更全内容