




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、MATLAB语言与应用实验课程任务书第一部分MATLAB语言编程、科学绘图与基本数学问题求解1、 用MATLAB语句输入矩阵和 , 前面给出的是矩阵,如果给出命令将得出什么结果?>> A=1,2,3,4;4,3,2,1;2,3,4,1;3,2,4,1B=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+4jA(6,5)=5A = 1 2 3 4 4 3 2 1 2 3 4 1 3 2 4 1B = 1.0000 + 4.0000i 2.0000 + 3.0000i 3.0000
2、+ 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.0000iA = 1 2 3 4 0 4 3 2 1 0 2 3 4 1 0 3 2 4 1 0 0 0 0 0 0 0 0 0 0 52、 假设已知
3、矩阵,试给出相应的MATLAB命令,将其全部偶数行提取出来,赋给矩阵,用命令生成矩阵,用上述命令检验一下结果是不是正确。>> A=magic(8)B=A(2:2:end, :)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 = 9 55 54 12 13 51
4、 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 13、 用数值方法可以求出,试不采用循环的形式求出和式的数值解。由于数值方法是采用double形式进行计算的,难以保证有效位数字,所以结果不一定精确。试采用运算的方法求该和式的精确值。>> sum(sym(2).0:63) ans =4、 选择合适的步距绘制出下面的图形。(1),其中; >> t=-1:0.005:-0.001,0.001:0.005:1;y=sin(1./t);plot(t,y)(2),其中。>>
5、 t=-pi:0.05:-1.8,-1.799:0.001:-1.2,-1.2:0.05:1.2,1.201:0.001:1.8,1.81:0.05:pi;y=sin(tan(t)-tan(sin(t);plot(t,y)5、 试绘制出二元函数的三维图和三视图。>>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:0.1:1;x,y=meshgrid(xx,yy);z=1./(sqrt(1-x).2+y.2)+1./(sqrt(1+x).
6、2+y.2);surf(x,y,z),shading flat;figure;zlim(0,15)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);6、 试求出如下极限。(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) L =
7、2(3)。>> syms x y;f=(1-cos(x2+y2)/(x2+y2)*exp(x2+y2);L=limit(limit(f,x,0),y,0) L = 07、 已知参数方程,试求出和。>> syms t;x=log(cos(t);y=cos(t)-t*sin(t);f1=diff(y,t)/diff(x,t)f2=diff(f1,t)subs(f2,t,pi/3) f1 = -(-2*sin(t)-t*cos(t)/sin(t)*cos(t) f2 = -(-3*cos(t)+t*sin(t)/sin(t)*cos(t)+(-2*sin(t)-t*cos(t
8、)/sin(t)2*cos(t)2-2*sin(t)-t*cos(t) ans = -2.66518、 假设,试求。>> syms x y t;f=exp(-t2);I=simple(int(f,t,0,x*y)F=(x/y)*(diff(diff(I,x),x)-2*(diff(diff(I,x),y)+diff(diff(I,y),y) I = 1/2*pi(1/2)*erf(x*y)F =2*x2*y2*exp(-x2*y2)-2*exp(-x2*y2)-2*x3*y*exp(-x2*y2)9、 试求出下面的极限。 (1);>> syms n;limit(syms
9、um(1/(2*n)2-1),n,inf) ans = 0(2)。>> syms n;limit(symsum(n/(n2+n*pi),n,inf)ans = Inf10、 试求出以下的曲线积分。 (1),为曲线,。>> syms t a;x=a*(cos(t)+t*sin(t);y=a*(sin(t)-t*cos(t);I=int(x2+y2,t,0,2*pi) I = 8/3*a2*pi3+2*a2*pi (2),其中为正向上半椭圆。>> syms a b c t;F=y*x3+exp(y),x*y3+x*exp(y)-2*y;ds=diff(x,t);
10、diff(y,t);I=simple(int(F*ds,t,2*pi,0) I=4*a2*pi2+712/27*a5*pi3-3254/81*a5*pi-1120/27*a5*pi2-64/15*a5*pi5+112/9*a5*pi4-a/exp(pi*a)2+a11、 试求出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;simple(det(A)ans =(c-d)*(b-d)*(b-c)*(a-d
11、)*(a-c)*(a-b)*(-d+e)*(e-c)*(e-b)*(e-a)12、 试对矩阵进行Jordan变换,并得出变换矩阵。>> 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;J=jordan(A)J = -4 0 0 0 0 -2 1 0 0 0 -2 1 0 0 0 -213、 试用数值方法和解析方法求取下面的Sylvester方程,并验证得出的结果。先编写出Sylvester型方程的解析解求解程序lyap.m,置于sym目录下:function X=lyap(A,B,C)if nargin=2,C=
12、B;B=A'endnr,nc=size(C);A0=kron(A,eye(nc)+kron(eye(nr),B');try C1=C'x0=-inv(A0)*C1(:);X=reshape(x0,nc,nr)'catch,error('singular matrix found.'),end>> 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,
13、6,-3;X=lyap(A,B,C),norm(A*X+X*B+C)Y=lyap(sym(A),B,C),norm(double(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.7634ans = 2.7059e-013Y = ans = 014、 假设已知矩阵如下,试求出,。>> 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)31/2*t/exp(t)3+1/2/exp(t)5-1/2/exp(t
15、)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)31/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)3C = -sin(9/2*t), 0,
16、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)+(1/2*exp(-5*t)-1/
17、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(-3*t)-1/2*t*exp(
18、-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/2*t2*exp(-3*t)*si
19、n(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*exp(-3*t)+(1/2*exp(
20、-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(t*(-15/2*exp(-3*t)+
21、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*(17/2*exp(-3*t)-21/2*
22、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*exp(-3*t),(1/2*t*exp(
23、-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),(1/2*t*exp(-3*t)+1/
24、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)+5*exp(-3*t),(1/2*t*exp
25、(-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*exp(-5*t)-1/2*exp(-3*t)
26、*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)*sin(t*(3/2*exp(-3*t)+9/
27、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*exp(-3*t)+(exp(-3*t)+1/2*
28、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*t)-3*exp(-3*t)+(exp(-3*t)
29、+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(-5*t)+1/2*exp(-3*t)*sin(t*(
30、-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(-3*t)+25/2*exp(-5*t)+9/2*t2*e
31、xp(-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*t)-21/2*exp(-3*t)+9*t*exp(-
32、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*(9/2*t*exp(-3*t)-3*exp(-3*t)+
33、(-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/2*t*exp(-3*t)+25/2*exp(-5*t)+(
34、-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);>> syms t a;f=sin(a*t)/t;F=laplace(f) F =atan(a/s)(2);>> syms t a;f=t5*sin(a*t);F=laplac
35、e(f) F =120/(s2+a2)3*sin(6*atan(a/s)(3)。>> syms t a;f=t8*cos(a*t);F=laplace(f) F =40320/(s2+a2)(9/2)*cos(9*atan(a/s)2、 对下面的式进行Laplace反变换。(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)/a2*exp(a*t)-1/a2/b+1/b/(a2-b2)*exp(-b*t)(2);>> s
36、yms 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);>> syms x;f=x2*(3*pi-2*abs(x);F=fourier(f)f1=ifourier(F) F = -6*(4+pi2*dir
37、ac(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);>> syms a T k z;f=cos(k*a*T);F=ztrans(f,k,z)f1=iztrans(F,z,k) F = (z-cos(a*
38、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)3f1 =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/(z-1)2-z/(z-
39、1)+z/exp(-a*T)/(z/exp(-a*T)-1)f1 =(-1+k*a*T+(1/exp(a*T)k)/a5、 用数值求解函数求解下述一元和二元方程的根,并对得出的结果进行检验。(1);>> syms x;f=exp(-(x+1)2+pi/2)*sin(5*x+2);t=solve(f) t =-2/5 >> subs(f,x,-2/5)ans =0(2)。>> syms x y;f=(x2+y2+x*y)*exp(-x2-y2-x*y);y1=solve('(x2+y2+x*y)*exp(-x2-y2-x*y)','y&
40、#39;) y1 = (-1/2+1/2*i*3(1/2)*x (-1/2-1/2*i*3(1/2)*x>> simple(subs(f,y,y1)ans = 0 06、 试求出使得取得极小值的值。>> syms c x;f=(exp(x)-c*x)2;F=int(f,x,0,1) F =1/2*exp(1)2+1/3*c2-1/2-2*c>> D=diff(F,c) D =2/3*c-2>> solve(D) ans =37、 试求解下面的非线性规划问题。 先编写如下非线性约束函数:function c,ceq=opt_con1(x)ceq=x
41、(1)+x(2);x(1)*x(2)-x(1)-x(2)+1.5;-x(1)*x(2)-10;c=;>> y=(x)exp(x(1)*(4*x(1)*x(1)+2*x(2)*x(2)+4*x(1)*x(2)+2*x(2)+1); ff=optimset;ff.TolFun=1e-30;ff.TolX=1e-20;A=;B=;Aeq=;Beq=;xm=-10;-10;xM=10;10;x0=(xm+xM)/2; x,f_opt,c,d=fmincon(y,x0,A,B,Aeq,Beq,xm,xM,opt_con1,ff)x = 0 0f_opt = 1c = -2d = iterat
42、ions: 1 funcCount: 6 stepsize: 2 algorithm: 'medium-scale: SQP, Quasi-Newton, line-search' firstorderopt: 2.0000 cgiterations: message: 1x143 char8、 求解下面的整数线性规划问题。 MATLAB 7.*下无法用ipslv_mex()函数求解:>>f=-592 381 273 55 48 37 23'A=3534 2356 1767 589 528 451 304;B=119567;Ae=;Be=;xm=0,0,0,
43、0,0,0,0;ff=optimset;ff.LargeScale='off' ff.TolX=1e-15;ff.TolFun=1e-20;ff.TolCon=1e-20;x,f_opt,key,c=linprog(f,A,B,Ae,Be,xm,ff)x = 33.8333 0 0.0000 0.0000 -0.0000 -0.0000 0.0000f_opt =-2.0029e+004key = 1c = iterations: 7 algorithm: 'medium-scale: active-set' cgiterations: message:
44、9;Optimization terminated.'9、 试求出微分方程的解析解通解,并求出满足边界条件的解析解。>> syms x;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)',&
45、#39;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(pi)*exp(6*sym(pi)+6)-6*Ei(1,6*sym(pi)*exp(6*sym(pi)+6)-3*i*pi*ex
46、p(6*sym(pi)+6)-3*i*pi*csgn(6*i*sym(pi)*exp(6*sym(pi)+6)-30*sym(pi)*exp(6)+3*i*pi*csgn(sym(pi)*csgn(6*i*sym(pi)*exp(6*sym(pi)+6)-36*sym(pi)2*exp(6)-11*exp(6)+1296*exp(5*sym(pi)+6)/log(sym(pi)*exp(-6*sym(pi)-6)+1/1296*(6*exp(6*x)*Ei(1,6*x)+11+30*x+36*x2)*exp(-5*x)10、 试求出下面微分方程的通解。(1);>> syms t;x=dsolve('D2x+2*t*Dx+t2*x=t+1') x =exp(-1-1/2*t)*t)*C2+exp(-1/2*t*(-2+t)*C1-1/2*i*pi(1/2)*2(1/2)*erf(1/2*i*2(1/2)*t-1/2*i*2(1/2)*exp(-1/2*(t-1)2)(2)。>> y=dsolve('Dy+2*x*y=x*exp(-x2)') y =(1/2*exp(-x*(x-2*t)+C1)*exp(-2*x*t)11
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 超市食品购销合同协议
- 软装合同补充协议范本
- 路灯维护外包合同协议
- 烧烤转让协议书
- 车间加班刷漆合同协议
- 运费类购销合同协议
- 配偶扶养协议书范本
- 雷雨天我不怕活动方案
- 旅游协调协议书
- 运输土方工程合同协议
- 2025年新高考语文古诗文理解性默写(含新高考60篇)
- 工业气体储存、经营项目环评资料环境影响
- 《相貌各异的我们》说课稿-2023-2024学年科学六年级下册教科版
- 年处理4万吨丙酮-水连续精馏塔设计
- 年终分红方案-员工利润分红方案
- 商务会议花卉布置合同
- 构美-空间形态设计学习通超星期末考试答案章节答案2024年
- 数易姓名学完整版本
- 校园小品《我的未来不是梦》剧本
- 智慧火电厂综合安防解决方案
- 《历史研究》格式-20210720155944
评论
0/150
提交评论