1、 2 3 4 1 0 0 3 2 4 1 0 0 0 0 0 0 0 53、 A=magic(8) 64 2 3 61 60 6 7 57 9 55 54 12 13 51 50 16 17 47 46 20 21 43 42 24 40 26 27 37 36 30 31 33 32 34 35 29 28 38 39 25 41 23 22 44 45 19 18 48 49 15 14 52 53 11 10 56 8 58 59 5 4 62 63 1 B=A(2:2:end,:)4、 sum(sym(2).0:63)ans =184*7095516155、t=-1:0.03:-0.2
2、5,-0.249:0.007:0.249,0.25:0.4:1;y=sin(1./t);plot(t,y)t=-pi:0.05:-1.8,-1.799:0.001:-1.2,-1.2:0.005:1.2,1.201:1.8,1.81:pi;y=sin(tan(t)-tan(sin(t);6、三维图xx=-2:.1:-1.2,-1.1:0.02:-0.9,-0.8:0.1:0.8,0.9:1.1,1.2:2;yy=-1:-0.2,-0.1:0.1,0.2:x,y=meshgrid(xx,yy);z=1./(sqrt(1-x).2+y.2)+1./(sqrt(1+x).2+y.2);surf(x,
3、y,z),shading flat;zlim(0,15)三视图x,y=meshgrid(-2:2);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);7、(1)syms x;f=(3x+9x)(1/x);L=limit(f,x,inf)L =9 (2)syms x y;f=(x*y)/(sqrt(x*y+1)-1);L=limit(limit(f,x,0),y,0)2(3)Syms x y;f=(1-cos(x2+y2)/(x2+y
4、2)*exp(x2+y2);8、(1)syms t;x=log(cos(t);y=cos(t)-t*sin(t);f1=diff(y,t)/diff(x,t)f1 =-(-2*sin(t)-t*cos(t)/sin(t)*cos(t)(2)syms t;f2=diff(y,t,2)/diff(x,t,2);subs(f2,t,sym(pi)/3)3/8-1/24*pi*3(1/2)9、 syms x y t;f=int(exp(-t2),t,0,x*y);I=simple(x/y*diff(f,x,2)-2*diff(diff(f,x),y)+diff(f,y,2)I =-2*exp(-x2*
5、y2)*(-x2*y2+1+x3*y)10、(1)syms m n;limit(symsum(1/(2*m)2-1),m,1,n),n,inf)1/2 (2)syms m n;limit(symsum(n*(1/(n2+m*pi),m,1,n),n,inf)111、(1)syms a t;syms a positive;x=a*(cos(t)+t*sin(t);y=a*(sin(t)-t*cos(t);I=simple(int(x2+y2)*sqrt(diff(x,t)2+diff(y,t)2),t,0,2*pi)(2*pi2+4*pi4)*a3(2)syms x y a b c t;x=c*
6、cos(t)/a;y=c*sin(t)/b;P=y*x3+exp(y);Q=x*y3+x*exp(y)-2*y;ds=diff(x,t);diff(y,t);I=int(P,Q*ds,t,0,pi)-2/15*c*(-2*c4+15*b4)/b4/a12、function A=vander(v) n=length(v); v=v(:); A=sym(ones(n); for j=n-1:-1:1, A(:,j)=v.*A(:,j+1); endsyms a b c d e; A=vander(a b c d e);B=simple(det(A)(c-d)*(b-d)*(b-c)*(a-d)*(
7、a-c)*(a-b)*(-d+e)*(e-c)*(e-b)*(e-a)13A=-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;V,J=jordan(sym(A)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/4J = -4, 0, 0, 0 0, -2, 1, 0 0, 0, -2, 1 0, 0, 0, -214、数值解A=3,-6,-4,0,5;1,4,2,-2,4;-6,3,-6,7,3;-13,10,0,-11,0;0,4,0,
8、3,4;B=3,-2,1;-2,-9,2;-2,-1,9;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 2.7917e-013解析解function X=lyap(A,B,C)if nargin=2,C=B;B=A;endnr,nc=size(C);A0=kron(A,
9、eye(nc)+kron(eye(nr),Btry C1=Cx0=-inv(A0)*C1(:X=reshape(x0,nc,nr)catch, error(singular matrix found.),endC=-2,1,-1;X=lyap(sym(A),B,C),norm(double(A*X+X*B+C) 434641749950/107136516451, 4664546747350/321409549353, -503105815912/321409549353 -3809507498/107136516451, -8059112319373/321409549353, 880921
10、527508/321409549353 -1016580400173/107136516451, -8334897743767/321409549353, 1419901706449/321409549353 -288938859984/107136516451, -6956912657222/321409549353, 927293592476/321409549353 -827401644798/107136516451, -10256166034813/321409549353, 1209595497577/321409549353 015、function F=funm(A,fun,x
11、) V,J=jordan(A); v1=0,diag(J,1); v2=find(v1=0), length(v1)+1; for i=1:length(v2)-1 v_lambda(i)=J(v2(i),v2(i); v_n(i)=v2(i+1)-v2(i); m=length(v_lambda); F=sym();m J1=J(v2(i):v2(i)+v_n(i)-1,v2(i):v2(i)+v_n(i)-1); fJ=funJ(J1,fun,x); F=diagm(F,fJ); F=V*F*inv(V); function fJ=funJ(J,fun,x) lam=J(1,1); f1=
12、fun; fJ=subs(fun,x,lam)*eye(size(J); H=diag(diag(J,1),1); H1=H; for i=2:length(J) f1=diff(f1,x); a1=subs(f1,x,lam); fJ=fJ+a1*H1; H1=H1*H/i; function A=diagm(A1,A2) A=A1; n,m=size(A); n1,m1=size(A2); A(n+1:n+n1,m+1:m+m1)=A2;syms x t; A=-4.5,0,0.5,-1.5; -0.5,-4,0.5,-0.5;1.5,1,-2.5,1.5; 0,-1,-1,-3;A=sy
13、m(A);B=expm(A*t),C=funm(A,sin(x*t),x),D= funm(A,exp(x*t)*sin(x2*exp(x*t)*t),x) 1/2*exp(-3*t)-1/2*t*exp(-3*t)+1/2*exp(-5*t)+1/2*t2*exp(-3*t), 1/2*exp(-5*t)-1/2*exp(-3*t)+t*exp(-3*t), 1/2*t*exp(-3*t)+1/2*t2*exp(-3*t), 1/2*exp(-5*t)-1/2*exp(-3*t)-1/2*t*exp(-3*t)+1/2*t2*exp(-3*t) 1/2*t*exp(-3*t)+1/2*exp
14、(-5*t)-1/2*exp(-3*t), 1/2*exp(-3*t)+1/2*exp(-5*t), 1/2*t*exp(-3*t), 1/2*t*exp(-3*t)+1/2*exp(-5*t)-1/2*exp(-3*t) 1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t), -1/2*exp(-5*t)+1/2*exp(-3*t), exp(-3*t)+1/2*t*exp(-3*t), 1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t) -1/2*t2*exp(-3*t), -t*exp(-3*t), -1/2*t2*e
15、xp(-3*t)-t*exp(-3*t), exp(-3*t)-1/2*t2*exp(-3*t)C = -1/2*sin(5*t)+1/2*sin(3*t)*t2-1/2*cos(3*t)*t-1/2*sin(3*t), -1/2*sin(5*t)+cos(3*t)*t+1/2*sin(3*t), 1/2*cos(3*t)*t+1/2*sin(3*t)*t2, -1/2*sin(5*t)+1/2*sin(3*t)+1/2*sin(3*t)*t2-1/2*cos(3*t)*t -1/2*sin(5*t)+1/2*cos(3*t)*t+1/2*sin(3*t), -1/2*sin(5*t)-1/2
16、*sin(3*t), 1/2*cos(3*t)*t, -1/2*sin(5*t)+1/2*cos(3*t)*t+1/2*sin(3*t) 1/2*sin(5*t)+1/2*cos(3*t)*t-1/2*sin(3*t), 1/2*sin(5*t)-1/2*sin(3*t), -sin(3*t)+1/2*cos(3*t)*t, 1/2*sin(5*t)+1/2*cos(3*t)*t-1/2*sin(3*t) -1/2*sin(3*t)*t2, -cos(3*t)*t, -cos(3*t)*t-1/2*sin(3*t)*t2, -sin(3*t)-1/2*sin(3*t)*t2D = 1/2*ex
17、p(-5*t)*sin(25*exp(-5*t)*t)+1/2*t2*exp(-3*t)*sin(9*t*exp(-3*t)+t*exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)-1/2*exp(-3*t)*sin(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)2+1/2*exp(-3*t)*cos(9*t*exp(-3*t)*(2*t*exp(-3*t)-12*t2*exp(-3*t)+9*t3*exp(-3*t)-1/2*t*exp(-3*t)*sin(9*t*exp(-3*t)-
18、1/2*exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)+1/2*exp(-3*t)*sin(9*t*exp(-3*t), 1/2*exp(-5*t)*sin(25*exp(-5*t)*t)+t*exp(-3*t)*sin(9*t*exp(-3*t)+exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)-1/2*exp(-3*t)*sin(9*t*exp(-3*t), 1/2*t*exp(-3*t)*sin(9*t*exp(-3*t)+1/2*exp(-3*t)*
19、cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)+1/2*t2*exp(-3*t)*sin(9*t*exp(-3*t)+t*exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)-1/2*exp(-3*t)*sin(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)2+1/2*exp(-3*t)*cos(9*t*exp(-3*t)*(2*t*exp(-3*t)-12*t2*exp(-3*t)+9*t3*exp(-3*t), 1/2*exp(-5*t
20、)*sin(25*exp(-5*t)*t)-1/2*exp(-3*t)*sin(9*t*exp(-3*t)+1/2*t2*exp(-3*t)*sin(9*t*exp(-3*t)+t*exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)-1/2*exp(-3*t)*sin(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)2+1/2*exp(-3*t)*cos(9*t*exp(-3*t)*(2*t*exp(-3*t)-12*t2*exp(-3*t)+9*t3*exp(-3*t)-1/2*t*ex
21、p(-3*t)*sin(9*t*exp(-3*t)-1/2*exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t) 1/2*exp(-5*t)*sin(25*exp(-5*t)*t)+1/2*t*exp(-3*t)*sin(9*t*exp(-3*t)+1/2*exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)-1/2*exp(-3*t)*sin(9*t*exp(-3*t), 1/2*exp(-5*t)*sin(25*exp(-5*t)*t)+1/2*exp(-3*t)
22、*sin(9*t*exp(-3*t), 1/2*t*exp(-3*t)*sin(9*t*exp(-3*t)+1/2*exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t), 1/2*exp(-5*t)*sin(25*exp(-5*t)*t)+1/2*t*exp(-3*t)*sin(9*t*exp(-3*t)+1/2*exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)-1/2*exp(-3*t)*sin(9*t*exp(-3*t) -1/2*exp(-5*t)*sin(
23、25*exp(-5*t)*t)+1/2*t*exp(-3*t)*sin(9*t*exp(-3*t)+1/2*exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)+1/2*exp(-3*t)*sin(9*t*exp(-3*t), -1/2*exp(-5*t)*sin(25*exp(-5*t)*t)+1/2*exp(-3*t)*sin(9*t*exp(-3*t), exp(-3*t)*sin(9*t*exp(-3*t)+1/2*t*exp(-3*t)*sin(9*t*exp(-3*t)+1/2*exp(-3*t)*cos(9*t*ex
24、p(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t), -1/2*exp(-5*t)*sin(25*exp(-5*t)*t)+1/2*t*exp(-3*t)*sin(9*t*exp(-3*t)+1/2*exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)+1/2*exp(-3*t)*sin(9*t*exp(-3*t) -1/2*t2*exp(-3*t)*sin(9*t*exp(-3*t)-t*exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)
25、+1/2*exp(-3*t)*sin(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)2-1/2*exp(-3*t)*cos(9*t*exp(-3*t)*(2*t*exp(-3*t)-12*t2*exp(-3*t)+9*t3*exp(-3*t), -t*exp(-3*t)*sin(9*t*exp(-3*t)-exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t), -t*exp(-3*t)*sin(9*t*exp(-3*t)-exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*
26、exp(-3*t)+9*t2*exp(-3*t)-1/2*t2*exp(-3*t)*sin(9*t*exp(-3*t)-t*exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)+1/2*exp(-3*t)*sin(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)2-1/2*exp(-3*t)*cos(9*t*exp(-3*t)*(2*t*exp(-3*t)-12*t2*exp(-3*t)+9*t3*exp(-3*t), exp(-3*t)*sin(9*t*exp(-3*t)-1/2*t2*e
27、xp(-3*t)*sin(9*t*exp(-3*t)-t*exp(-3*t)*cos(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)+1/2*exp(-3*t)*sin(9*t*exp(-3*t)*(-6*t*exp(-3*t)+9*t2*exp(-3*t)2-1/2*exp(-3*t)*cos(9*t*exp(-3*t)*(2*t*exp(-3*t)-12*t2*exp(-3*t)+9*t3*exp(-3*t)第二部分(1)syms t alpha;f=sin(alpha*t)/t;F=laplace(f)F =atan(alpha/s)(2)syms t alpha;f=t5*sin(alpha*t);F=la
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1