东北大学matlab作业_第1页
东北大学matlab作业_第2页
东北大学matlab作业_第3页
东北大学matlab作业_第4页
东北大学matlab作业_第5页
已阅读5页,还剩19页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Matlab 上机实验作业第一部分:2.用MATLAB语句输入矩阵和 , 前面给出的是矩阵,如果给出命令将得出什么结果?解 A=1,2,3,4;4,3,2,1;2,3,4,1;3,2,4,1A = 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+4jb = 1.0000 + 4.0000i 2.0000 + 3.0000i 3.0000 + 2.0000i 4.0000 + 1.0000i 4.0000 + 1.0000i

2、 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)=5A = 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 53假设已知矩阵,试给出相应的MATLAB命令,将其全部偶数行提取出来,赋给矩阵,用

3、命令生成矩阵,用上述命令检验一下结果是不是正确。解 A=magic(8)A = 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 1B=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 4

4、5 19 18 48 8 58 59 5 4 62 63 14用数值方法可以求出,试不采用循环的形式求出和式的数值解。由于数值方法是采用double形式进行计算的,难以保证有效位数字,所以结果不一定精确。试采用运算的方法求该和式的精确值。解 sum(sym(2).1:63) ans =18446744073709551615选择合适的步距绘制出下面的图形。(1),其中; (2),其中解(1) t=-1:0.03:1;y=sin(1./t);plot(t,y)4(2) x=-pi:0.01:-1.8,-1.799:0.001:-1.2,-1.2:0.01:1.2,1.201:0.001:1.8,

5、1.8:0.01:pi;y=sin(tan(x)-tan(sin(x);plot(x,y)6.试绘制出二元函数的三维图和三视图。解xx=-2:0.1:-1.2,-1.1:0.03:-0.9,-0.8:0.1:0.8,0.9:0.03:1.1,1.2:0.1:2;yy=-1:0.1:-0.2,-0.1:0.02:0.1,0.2:0.1:1;x,y=meshgrid(xx,yy);z=1./(sqrt(1-x).2+y.2)+1./(sqrt(1+x).2+y.2);surf(x,y,z),shading flat;zlim(0,15) xx=-2:0.1:-1.2,-1.1:0.03:-0.9,

6、-0.8:0.1:0.8,0.9:0.03:1.1,1.2:0.1:2;yy=-1:0.1:-0.2,-0.1:0.02:0.1,0.2:0.1:1;z=1./(sqrt(1-x).2+y.2)+1./(sqrt(1+x).2+y.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); (2); (3)解(1) syms x;f=(3x+9x)(1/x);limit(f,x,inf) ans = 9(2

7、) syms x y;fb=x*y/(sqrt(x*y+1)-1);limit(limit(fb,x,0),y,0) ans =(3) syms x y;fc=(1-cos(x2+y2)/(x2+y2)*exp(x2+y2);limit(limit(fc,x,0),y,0) ans = 08.已知参数方程,试求出和解 syms t;x=log(cos(t);y=cos(t)-t*sin(t);diff(y,t)/diff(x,t) ans = -(-2*sin(t)-t*cos(t)/sin(t)*cos(t) f=diff(y,t,2)/diff(x,t,2);subs(f,t,sym(pi

8、)/3) ans = 3/8-1/24*pi*3(1/2)9假设,试求解: syms t x y;f=int(exp(-t2),t,0,x*y);F=simple(x/y*diff(f,x,2)-2*diff(diff(f,x),y)+diff(f,y,2) F = -2*exp(-x2*y2)*(-x2*y2+1+x3*y)10.试求出下面的极限。(1);(2)解(1) syms k n; symsum(1/(2*k)2-1),k,1,inf) ans = 1/2(2) syms k n;limit(n*symsum(1/(n2+k*pi),k,1,n),n,inf) ans = 111试求

9、出以下的曲线积分。 (1),为曲线, 。 (2),其中为正向上半椭圆。解(1)syms a,t;Syms a positive; x=a*(cos(t)+t*sin(t);y=a*(sin(t)-t*cos(t);f=x2+y2;h=int(f*sqrt(diff(x,t)2+diff(y,t)2),t,0,2*pi) h = 2*a3*pi2+4*a3*pi4 (2) syms a b c positive;syms t;x=(c/a)*cos(t);y=(c/a)*sin(t);F=y*x3+exp(y),x*y3+x*exp(y)-2*y;ds=diff(x,t);diff(y,t);I

10、=int(F*ds,t,0,pi) I = -2/15*c*(-2*c4+15*a4)/a512试求出Vandermonde矩阵的行列式,并以最简的形式显示 结果。 syms a b c d e;A=a4,a3,a2,a,1;b4,b3,b2,b,1;c4,c3,c2,c,1;d4,d3,d2,d,1;e4,e3,e2,e,1;simplify(det(A) ans = (a - b)*(a - c)*(a - d)*(b - c)*(a - e)*(b - d)*(b - e)*(c - d)*(c - e)*(d - e)13试对矩阵进行Jordan变换,并得出变换矩阵。解 A=-2 0.

11、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(A)V = 0 0.50000000000000 0.50000000000000 -0.25000000000000 0 0 0.50000000000000 1.00000000000000 0.25000000000000 0.50000000000000 0.50000000000000 -0.25000000000000 0.25000000000000 0.50000000000000 1.00000000000000 -0.25000000000000J

12、= -4 0 0 0 0 -2 1 0 0 0 -2 1 0 0 0 -214.试用数值方法和解析方法求取下面的Sylvester方程,并验证得出的结果。解 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;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.05689641914739 14.51278207738230 -1.56531072870960 -0.035557

13、50760035 -25.07427777300226 2.74080695262868 -9.48864527098864 -25.93232765032886 4.41773341615773 -2.69692229648079 -21.64500921402601 2.88508413748940 -7.72287238941912 -31.90996053309000 3.76340871020125ans =2.791709573159607e-01315.假设已知矩阵如下,试求出,解 syms t;A=-4.5,0,0.5,-1.5;-0.5,-4,0.5,-0.5;1.5,1,-

14、2.5,1.5;0,-1,-1,-3;B=simple(expm(A*t)C=simple(sin(A*t)D=simple(expm(A*t)*sin(A2*expm(A*t)*t) B = 1/2/exp(t)3-1/2*t/exp(t)3+1/2/exp(t)5+1/2*t2/exp(t)3, 1/2/exp(t)5-1/2/exp(t)3+t/exp(t)3, 1/2*t/exp(t)3+1/2*t2/exp(t)3, 1/2/exp(t)5-1/2/exp(t)3-1/2*t/exp(t)3+1/2*t2/exp(t)3 1/2*t/exp(t)3+1/2/exp(t)5-1/2/e

15、xp(t)3, 1/2/exp(t)3+1/2/exp(t)5, 1/2*t/exp(t)3, 1/2*t/exp(t)3+1/2/exp(t)5-1/2/exp(t)3 1/2*t/exp(t)3-1/2/exp(t)5+1/2/exp(t)3, -1/2/exp(t)5+1/2/exp(t)3, 1/exp(t)3+1/2*t/exp(t)3, 1/2*t/exp(t)3-1/2/exp(t)5+1/2/exp(t)3 -1/2*t2/exp(t)3, -t/exp(t)3, -1/2*t2/exp(t)3-t/exp(t)3, 1/exp(t)3-1/2*t2/exp(t)3 C = -

16、sin(9/2*t), 0, sin(1/2*t), -sin(3/2*t) -sin(1/2*t), -sin(4*t), sin(1/2*t), -sin(1/2*t) sin(3/2*t), sin(t), -sin(5/2*t), sin(3/2*t) 0, -sin(t), -sin(t), -sin(3*t) D = (1/2*exp(-3*t)-1/2*t*exp(-3*t)+1/2*exp(-5*t)+1/2*t2*exp(-3*t)*sin(t*(17/2*exp(-3*t)-21/2*t*exp(-3*t)+25/2*exp(-5*t)+9/2*t2*exp(-3*t)+(

17、1/2*exp(-5*t)-1/2*exp(-3*t)+t*exp(-3*t)*sin(t*(-15/2*exp(-3*t)+9/2*t*exp(-3*t)+25/2*exp(-5*t)+(1/2*t*exp(-3*t)+1/2*t2*exp(-3*t)*sin(t*(3/2*exp(-3*t)+9/2*t*exp(-3*t)-25/2*exp(-5*t)+(1/2*exp(-5*t)-1/2*exp(-3*t)-1/2*t*exp(-3*t)+1/2*t2*exp(-3*t)*sin(t*(-exp(-3*t)+6*t*exp(-3*t)-9/2*t2*exp(-3*t), (1/2*exp

18、(-3*t)-1/2*t*exp(-3*t)+1/2*exp(-5*t)+1/2*t2*exp(-3*t)*sin(t*(25/2*exp(-5*t)-21/2*exp(-3*t)+9*t*exp(-3*t)+(1/2*exp(-5*t)-1/2*exp(-3*t)+t*exp(-3*t)*sin(t*(25/2*exp(-5*t)+9/2*exp(-3*t)+(1/2*t*exp(-3*t)+1/2*t2*exp(-3*t)*sin(t*(-25/2*exp(-5*t)+9/2*exp(-3*t)+(1/2*exp(-5*t)-1/2*exp(-3*t)-1/2*t*exp(-3*t)+1/

19、2*t2*exp(-3*t)*sin(t*(6*exp(-3*t)-9*t*exp(-3*t), (1/2*exp(-3*t)-1/2*t*exp(-3*t)+1/2*exp(-5*t)+1/2*t2*exp(-3*t)*sin(t*(-3/2*t*exp(-3*t)+9/2*t2*exp(-3*t)-2*exp(-3*t)+(1/2*exp(-5*t)-1/2*exp(-3*t)+t*exp(-3*t)*sin(t*(9/2*t*exp(-3*t)-3*exp(-3*t)+(1/2*t*exp(-3*t)+1/2*t2*exp(-3*t)*sin(t*(9/2*t*exp(-3*t)+6*e

20、xp(-3*t)+(1/2*exp(-5*t)-1/2*exp(-3*t)-1/2*t*exp(-3*t)+1/2*t2*exp(-3*t)*sin(t*(-3*t*exp(-3*t)-9/2*t2*exp(-3*t)+5*exp(-3*t), (1/2*exp(-3*t)-1/2*t*exp(-3*t)+1/2*exp(-5*t)+1/2*t2*exp(-3*t)*sin(t*(25/2*exp(-5*t)-1/2*exp(-3*t)-21/2*t*exp(-3*t)+9/2*t2*exp(-3*t)+(1/2*exp(-5*t)-1/2*exp(-3*t)+t*exp(-3*t)*sin(

21、t*(-15/2*exp(-3*t)+9/2*t*exp(-3*t)+25/2*exp(-5*t)+(1/2*t*exp(-3*t)+1/2*t2*exp(-3*t)*sin(t*(3/2*exp(-3*t)+9/2*t*exp(-3*t)-25/2*exp(-5*t)+(1/2*exp(-5*t)-1/2*exp(-3*t)-1/2*t*exp(-3*t)+1/2*t2*exp(-3*t)*sin(t*(8*exp(-3*t)+6*t*exp(-3*t)-9/2*t2*exp(-3*t) (1/2*t*exp(-3*t)+1/2*exp(-5*t)-1/2*exp(-3*t)*sin(t*(

22、17/2*exp(-3*t)-21/2*t*exp(-3*t)+25/2*exp(-5*t)+9/2*t2*exp(-3*t)+(1/2*exp(-3*t)+1/2*exp(-5*t)*sin(t*(-15/2*exp(-3*t)+9/2*t*exp(-3*t)+25/2*exp(-5*t)+1/2*t*exp(-3*t)*sin(t*(3/2*exp(-3*t)+9/2*t*exp(-3*t)-25/2*exp(-5*t)+(1/2*t*exp(-3*t)+1/2*exp(-5*t)-1/2*exp(-3*t)*sin(t*(-exp(-3*t)+6*t*exp(-3*t)-9/2*t2*e

23、xp(-3*t), (1/2*t*exp(-3*t)+1/2*exp(-5*t)-1/2*exp(-3*t)*sin(t*(25/2*exp(-5*t)-21/2*exp(-3*t)+9*t*exp(-3*t)+(1/2*exp(-3*t)+1/2*exp(-5*t)*sin(t*(25/2*exp(-5*t)+9/2*exp(-3*t)+1/2*t*exp(-3*t)*sin(t*(-25/2*exp(-5*t)+9/2*exp(-3*t)+(1/2*t*exp(-3*t)+1/2*exp(-5*t)-1/2*exp(-3*t)*sin(t*(6*exp(-3*t)-9*t*exp(-3*t

24、), (1/2*t*exp(-3*t)+1/2*exp(-5*t)-1/2*exp(-3*t)*sin(t*(-3/2*t*exp(-3*t)+9/2*t2*exp(-3*t)-2*exp(-3*t)+(1/2*exp(-3*t)+1/2*exp(-5*t)*sin(t*(9/2*t*exp(-3*t)-3*exp(-3*t)+1/2*t*exp(-3*t)*sin(t*(9/2*t*exp(-3*t)+6*exp(-3*t)+(1/2*t*exp(-3*t)+1/2*exp(-5*t)-1/2*exp(-3*t)*sin(t*(-3*t*exp(-3*t)-9/2*t2*exp(-3*t)+

25、5*exp(-3*t), (1/2*t*exp(-3*t)+1/2*exp(-5*t)-1/2*exp(-3*t)*sin(t*(25/2*exp(-5*t)-1/2*exp(-3*t)-21/2*t*exp(-3*t)+9/2*t2*exp(-3*t)+(1/2*exp(-3*t)+1/2*exp(-5*t)*sin(t*(-15/2*exp(-3*t)+9/2*t*exp(-3*t)+25/2*exp(-5*t)+1/2*t*exp(-3*t)*sin(t*(3/2*exp(-3*t)+9/2*t*exp(-3*t)-25/2*exp(-5*t)+(1/2*t*exp(-3*t)+1/2*

26、exp(-5*t)-1/2*exp(-3*t)*sin(t*(8*exp(-3*t)+6*t*exp(-3*t)-9/2*t2*exp(-3*t) (1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(17/2*exp(-3*t)-21/2*t*exp(-3*t)+25/2*exp(-5*t)+9/2*t2*exp(-3*t)+(-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(-15/2*exp(-3*t)+9/2*t*exp(-3*t)+25/2*exp(-5*t)+(exp(-3*t)+1/2*t*exp(-3*t)

27、*sin(t*(3/2*exp(-3*t)+9/2*t*exp(-3*t)-25/2*exp(-5*t)+(1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(-exp(-3*t)+6*t*exp(-3*t)-9/2*t2*exp(-3*t), (1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(25/2*exp(-5*t)-21/2*exp(-3*t)+9*t*exp(-3*t)+(-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(25/2*exp(-5*t)+9/2*

28、exp(-3*t)+(exp(-3*t)+1/2*t*exp(-3*t)*sin(t*(-25/2*exp(-5*t)+9/2*exp(-3*t)+(1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(6*exp(-3*t)-9*t*exp(-3*t), (1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(-3/2*t*exp(-3*t)+9/2*t2*exp(-3*t)-2*exp(-3*t)+(-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(9/2*t*exp(-3

29、*t)-3*exp(-3*t)+(exp(-3*t)+1/2*t*exp(-3*t)*sin(t*(9/2*t*exp(-3*t)+6*exp(-3*t)+(1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(-3*t*exp(-3*t)-9/2*t2*exp(-3*t)+5*exp(-3*t), (1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(25/2*exp(-5*t)-1/2*exp(-3*t)-21/2*t*exp(-3*t)+9/2*t2*exp(-3*t)+(-1/2*exp(

30、-5*t)+1/2*exp(-3*t)*sin(t*(-15/2*exp(-3*t)+9/2*t*exp(-3*t)+25/2*exp(-5*t)+(exp(-3*t)+1/2*t*exp(-3*t)*sin(t*(3/2*exp(-3*t)+9/2*t*exp(-3*t)-25/2*exp(-5*t)+(1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)*sin(t*(8*exp(-3*t)+6*t*exp(-3*t)-9/2*t2*exp(-3*t) -1/2*t2*exp(-3*t)*sin(t*(17/2*exp(-3*t)-21/2*t*exp(-

31、3*t)+25/2*exp(-5*t)+9/2*t2*exp(-3*t)-t*exp(-3*t)*sin(t*(-15/2*exp(-3*t)+9/2*t*exp(-3*t)+25/2*exp(-5*t)+(-1/2*t2*exp(-3*t)-t*exp(-3*t)*sin(t*(3/2*exp(-3*t)+9/2*t*exp(-3*t)-25/2*exp(-5*t)+(exp(-3*t)-1/2*t2*exp(-3*t)*sin(t*(-exp(-3*t)+6*t*exp(-3*t)-9/2*t2*exp(-3*t), -1/2*t2*exp(-3*t)*sin(t*(25/2*exp(-5

32、*t)-21/2*exp(-3*t)+9*t*exp(-3*t)-t*exp(-3*t)*sin(t*(25/2*exp(-5*t)+9/2*exp(-3*t)+(-1/2*t2*exp(-3*t)-t*exp(-3*t)*sin(t*(-25/2*exp(-5*t)+9/2*exp(-3*t)+(exp(-3*t)-1/2*t2*exp(-3*t)*sin(t*(6*exp(-3*t)-9*t*exp(-3*t), -1/2*t2*exp(-3*t)*sin(t*(-3/2*t*exp(-3*t)+9/2*t2*exp(-3*t)-2*exp(-3*t)-t*exp(-3*t)*sin(t*

33、(9/2*t*exp(-3*t)-3*exp(-3*t)+(-1/2*t2*exp(-3*t)-t*exp(-3*t)*sin(t*(9/2*t*exp(-3*t)+6*exp(-3*t)+(exp(-3*t)-1/2*t2*exp(-3*t)*sin(t*(-3*t*exp(-3*t)-9/2*t2*exp(-3*t)+5*exp(-3*t), -1/2*t2*exp(-3*t)*sin(t*(25/2*exp(-5*t)-1/2*exp(-3*t)-21/2*t*exp(-3*t)+9/2*t2*exp(-3*t)-t*exp(-3*t)*sin(t*(-15/2*exp(-3*t)+9/

34、2*t*exp(-3*t)+25/2*exp(-5*t)+(-1/2*t2*exp(-3*t)-t*exp(-3*t)*sin(t*(3/2*exp(-3*t)+9/2*t*exp(-3*t)-25/2*exp(-5*t)+(exp(-3*t)-1/2*t2*exp(-3*t)*sin(t*(8*exp(-3*t)+6*t*exp(-3*t)-9/2*t2*exp(-3*t)第二部分1.对下列的函数进行Laplace变换。(1);(2);(3)。解:(1) syms t alpha;f=sin(alpha*t)/t;F=laplace(f) F = atan(alpha/s)(2) syms

35、t alpha;f=t5*sin(alpha*t);F=laplace(f) F = 120/(s2+alpha2)3*sin(6*atan(alpha/s)(3)syms t alpha;f=t8*cos(alpha*t);F=laplace(f) F = 40320/(s2+alpha2)(9/2)*cos(9*atan(alpha/s)2.对下面的式进行Laplace反变换。(1);(2);(3)。解(1) syms s a b;f=1/(sqrt(s2)*(s2-a2)*(s+b);F=ilaplace(f) F =-1/2/(a-b)/a2*exp(-a*t)+1/2/(a+b)/a

36、2*exp(a*t)-1/a2/b+1/b/(a2-b2)*exp(-b*t)(2) syms s a b;f=sqrt(s-a)-sqrt(s-b);F=ilaplace(f) F =1/2/t/(t*pi)(1/2)*(exp(b*t)-exp(a*t)(3) syms s a b;f=log(s-a)/(s-b);F=ilaplace(f) F =(exp(b*t)-exp(a*t)/t3.试求出下面函数的Fourier变换,对得出的结果再进行Fourier反变换,观察是否能得出原来函数。(1);(2)。解(1) syms x;f=x2*(3*pi-2*abs(x);F=fourier(

37、f)f1=ifourier(F) F = -6*(4+pi2*dirac(2,w)*w4)/w4f1 =x2*(-4*x*heaviside(x)+3*pi+2*x)(2) syms t;f=t2*(t-2*pi)2;F=fourier(f) f1=ifourier(F) F =2*pi*(-4*pi2*dirac(2,w)+4*i*pi*dirac(3,w)+dirac(4,w) f1 =x2*(2*pi-x)24.请将下述时域序列函数进行Z变换,并对结果进行反变换检验。(1);(2);(3)。解(1) syms a T k z;f=cos(k*a*T);F=ztrans(f,k,z)f1=

38、iztrans(F,z,k) F = (z-cos(a*T)*z/(z2-2*z*cos(a*T)+1) f1 = cos(k*a*T)(2)syms a T k z;f=(k*T)2*exp(-a*k*T);F=ztrans(f,k,z)f1=iztrans(F,z,k) F = T2*z*exp(-a*T)*(z+exp(-a*T)/(z-exp(-a*T)3 f1 = T2*(1/exp(a*T)k*k2(3) syms a T k z;f=(1/a)*(a*k*T-1+exp(-a*k*T);F=ztrans(f,k,z)f1=iztrans(F,z,k) F = 1/a*(a*T*z

39、/(z-1)2-z/(z-1)+z/exp(-a*T)/(z/exp(-a*T)-1) f1 = (k*a*T+(1/exp(a*T)k-1)/a5.用数值求解函数求解下述一元和二元方程的根,并对得出的结果进行检验。(1);(2)解(1) syms x;f=exp(-(x+1)2+pi/2)*sin(5*x+2);t=solve(f)subs(f,x,-2/5) t = -2/5 ans = 0(2) syms x y;f=(x2+y2+x*y)*exp(-x2-y2-x*y);x1=solve(x2+y2+x*y)*exp(-x2-y2-x*y),x)simple(subs(f,x,x1)

40、x1 = (-1/2+1/2*i*3(1/2)*y (-1/2-1/2*i*3(1/2)*yans = 0 06.试求出使得取得极小值的值。解 syms c x;f=(exp(x)-c*x)2;F=int(f,x,0,1);f1=diff(F,c);solve(f1) ans = 37.试求解下面的非线性规划问题。 解可以用下面的语句描述目标函数:function y=exc6fun6(x)y=exp(x(1)*(4*x(1)2+2*x(2)2+4*x(1)*x(2)+2*x(2)+1);这时调用非线性最优化问题求解函数可以得出如下结果: A=; B=; Aeq=; Beq=; xm=-10;

41、 -10; xM=10; 10;x0=(xm+xM)/2;ff=optimset;ff.TolX=1e-10;ff.TolFun=1e-20;x=fmincon(exc6fun6,x0,A,B,Aeq,Beq,xm,xM,exc6fun6a,ff)Maximum number of function evaluations exceeded;increase OPTIONS.MaxFunEvalsx =0.419473260539100.41947326053910可以看出该结果并非原问题的解,故继续求解如下: i=1; x=x0;while (1)x,a,b=fmincon(exc6fun6

42、,x,A,B,Aeq,Beq,xm,xM,exc6fun6a,ff);if b0, break; endi=i+1;endx,ix =1.18249727581645-1.73976692398900i =58.求解下面的整数线性规划问题。 解 f=-592 381 273 55 48 37 23;A=3534 2356 1767 589 528 451 304; B=119567;intlist=1;1;1;1;1;1;1;ctype=-1;xm=zeros(7,1); xM=inf*ones(7,1);res,b=ipslv_mex(f,A,B,intlist,xM,xm,ctype)re

43、s =32210000b =09.试求出微分方程的解析解通解,并求出满足边界条件的解析解。解 syms x y;y1=dsolve(D2y-(2-1/x)*Dy+(1-1/x)*y=x2*exp(-5*x),x) y1 = exp(x)*C2+exp(x)*log(x)*C1+1/1296*(6*exp(6*x)*Ei(1,6*x)+11+30*x+36*x2)*exp(-5*x) y=dsolve(D2y-(2-1/x)*Dy+(1-1/x)*y=x2*exp(-5*x),y(1)=sym(pi),y(sym(pi)=1,x) y =-1/1296*exp(x)*(6*exp(1)*Ei(1,6)+77*exp(-5)-1296*sym(pi)/exp(1)-1/1296*exp(x)*log(x)*(-6*Ei(1,6)*exp(6*sym(pi)+6)-77*exp(6*sym(pi)+1296*sym(pi)*exp(6*sym(pi)+5)-3*i*pi*csgn(sym(

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论