当前位置:文档之家› 控制系统仿真大作业

控制系统仿真大作业

控制系统仿真实验报告专业班级:自动F0903 姓名:罗新勇学号: 200948280311 指导教师:张杰实验一、熟悉MATLAB 环境及矩阵、数组的数学计算一、 实验目的1、熟悉启动和退出Matlab 的方法;2、熟悉Matlab 命令窗口的组成;3、掌握建立矩阵的方法;二、 实验内容:1、帮助命令使用help 命令,查找 sqrt (开方)函数的使用方法;2、先求下列表达式的值,然后显示Matlab 工作空间的使用情况并保存全部变量。

.3,9.2,8.2,...,8.2,9.2,0.3,23.0ln)3.0sin(2)3(545.0212),1log(21)2(185sin 2)1(3.03.0322201---=+++-=⎥⎦⎤⎢⎣⎡-+=++=+=-a a a e ez i x x x z e z aa 其中提示:利用冒号表达式生成a 向量,求各点的函数值时用点乘运算。

⎪⎩⎪⎨⎧=<≤+-<≤-<≤=5.2:5.0:0,32,1221,110,)4(2224t t t t t t t t z 其中提示:用逻辑表达式求分段函数值。

(1)z1=2*sin(85/180*pi)/(1+(exp(1))^2) z1 =0.2375(2)x=[2 1+2i;-0.45 5] x =2.0000 1.0000 + 2.0000i -0.4500 5.0000 z2=0.5*log(x+sqrt(1+x^2)) z2 =0.7114 - 0.0253i 0.8968 + 0.3658i 0.2139 + 0.9343i 1.1541 - 0.0044i (3)a=-3.0:0.1:3.0 a =Columns 1 through 5-3.0000 -2.9000 -2.8000 -2.7000 -2.6000 Columns 6 through 10-2.5000 -2.4000 -2.3000 -2.2000 -2.1000 Columns 11 through 15-2.0000 -1.9000 -1.8000 -1.7000 -1.6000 Columns 16 through 20-1.5000 -1.4000 -1.3000 -1.2000 -1.1000 Columns 21 through 25-1.0000 -0.9000 -0.8000 -0.7000 -0.6000 Columns 26 through 30-0.5000 -0.4000 -0.3000 -0.2000 -0.1000 Columns 31 through 350 0.1000 0.2000 0.3000 0.4000 Columns 36 through 400.5000 0.6000 0.7000 0.8000 0.9000 Columns 41 through 451.0000 1.1000 1.2000 1.3000 1.4000 Columns 46 through 501.5000 1.6000 1.7000 1.8000 1.9000 Columns 51 through 552.0000 2.1000 2.2000 2.3000 2.4000 Columns 56 through 602.5000 2.6000 2.7000 2.8000 2.9000 Column 613.0000z3=((exp(0.3*a)-exp(-0.3*a)).*sin(a+0.3))/2+log((a+0.3)/2) z3 =Columns 1 through 30.7388 + 3.1416i 0.7696 + 3.1416i 0.7871 + 3.1416i Columns 4 through 60.7913 + 3.1416i 0.7822 + 3.1416i 0.7602 + 3.1416i Columns 7 through 90.7254 + 3.1416i 0.6784 + 3.1416i 0.6196 + 3.1416i Columns 10 through 120.5496 + 3.1416i 0.4688 + 3.1416i 0.3780 + 3.1416i Columns 13 through 150.2775 + 3.1416i 0.1680 + 3.1416i 0.0497 + 3.1416i Columns 16 through 18-0.0771 + 3.1416i -0.2124 + 3.1416i -0.3566 + 3.1416i Columns 19 through 21-0.5104 + 3.1416i -0.6752 + 3.1416i -0.8536 + 3.1416i Columns 22 through 24-1.0497 + 3.1416i -1.2701 + 3.1416i -1.5271 + 3.1416i Columns 25 through 27-1.8436 + 3.1416i -2.2727 + 3.1416i -2.9837 + 3.1416i Columns 28 through 30-37.0245 -3.0017 -2.3085 Columns 31 through 33-1.8971 -1.5978 -1.3575 Columns 34 through 36-1.1531 -0.9723 -0.8083 Columns 37 through 39-0.6567 -0.5151 -0.3819 Columns 40 through 42-0.2561 -0.1374 -0.0255 Columns 43 through 450.0792 0.1766 0.2663 Columns 46 through 480.3478 0.4206 0.4841 Columns 49 through 510.5379 0.5815 0.6145 Columns 52 through 540.6366 0.6474 0.6470 Columns 55 through 570.6351 0.6119 0.5777 Columns 58 through 600.5327 0.4774 0.4126 Column 610.33880.7114 - 0.0253i 0.8968 + 0.3658i0.2139 + 0.9343i 1.1541 - 0.0044i(4)t=0:0.5:2.5;if t<1,z4=t.^2,elseif t<2,z4=t.^2-1,else z4=t.^2-2.*t+1,end; z4 =1.0000 0.2500 0 0.2500 1.00002.25003、已知:(1)A=[12 34 -4;34 7 87;3 65 7],B=[1 3 -1;2 0 3;3 -2 7],A+6*B,A =12 34 -434 7 873 65 7B =1 3 -12 0 33 -2 7ans =18 52 -1046 7 10521 53 49I=eye(3),I =1 0 00 1 00 0 1>> A-B+Ians =12 31 -332 8 840 67 1(2)A*Bans =68 44 62309 -72 596154 -5 241>> A.*Bans =12 102 468 0 2619 -130 49(3)A^3ans =37226 233824 48604247370 149188 60076678688 454142 118820>> A.^3ans =1728 39304 -6439304 343 65850327 274625 343(4)A/Bans =16.4000 -13.6000 7.600035.8000 -76.2000 50.200067.0000 -134.0000 68.0000>> B\Aans =109.4000 -131.2000 322.8000-53.0000 85.0000 -171.0000-61.6000 89.8000 -186.2000三、预习要求:利用所学知识,编写实验内容中1到3的相应程序,并写在预习报告上。

实验四、控制系统稳定性、时域和频域分析的MATLAB 实现一、实验目的1.熟悉MATLAB 的仿真及应用环境。

2.在MATLAB 的环境下研究控制系统稳定性。

3.使用频率分析法对系统进行相位超前、迟后、迟后-超前校正。

二、实验内容:1、若(3)(5)()(1)()(6)S S H S S S S α++=+++,当α分别取-3,-1,1,3,10时,判断系统的可控性与可观性,并求相应的状态空间模型。

当α=3时,以采样时间T=0.1s ,将系统离散化。

(1)当a=-3时num=conv([1 3],[1 5]);den1=conv(conv([1 1],[1 6]),[1-3]);[a,b,c,d]=tf2ss(num,den1),q1=obsv(a,c);n=rank(q1),m=ctrb(a,b);rank(m) a =-4 15 18 1 0 0 0 1 0 b = 1 0 0c =1 8 15 d = 0 n = 3 ans =3(2) 当a=-1时 num=conv([13],[15]);den1=conv(conv([11],[16]),[1-1]);[a,b,c,d]=tf2ss(num,den1),q1=obsv(a,c);n=rank(q1),m=ctrb(a,b);rank(m) a =-6 1 6 1 0 0 0 1 0 b = 1c =1 8 15d =n =3ans =3(3) 当a=1时num=conv([1 3],[1 5]);den1=conv(conv([1 1],[1 6]),[11]);[a,b,c,d]=tf2ss(num,den1),q1=obsv(a,c);n=rank(q1),m=ctrb(a,b);rank(m)a =-8 -13 -61 0 00 1 0b =1c =1 8 15d =n =3ans =3(4) 当a=3时num=conv([1 3],[1 5]);den1=conv(conv([1 1],[1 6]),[13]);[a,b,c,d]=tf2ss(num,den1),q1=obsv(a,c);n=rank(q1),m=ctrb(a,b);rank(m)a =-10 -27 -181 0 00 1 0b =1c =1 8 15d =n =2ans =3[abar,bbar,cbar,T,k] = obsvf(a,b,c)abar =-3.0000 16.2660 -27.4484-0.0000 -5.7310 9.67100.0000 0.1316 -1.2690bbar =-0.94350.3263-0.0587cbar =0.0000 -0.0000 -17.0294T =-0.9435 0.3145 -0.10480.3263 0.8249 -0.4617-0.0587 -0.4698 -0.8808k =1 1 0(5)a=10num=conv([1 3],[1 5]);den1=conv(conv([1 1],[1 6]),[110]);[a,b,c,d]=tf2ss(num,den1),q1=obsv(a,c);n=rank(q1),m=ctrb(a,b);rank(m)a =-17 -76 -601 0 00 1 0b =1c =1 8 15d =n =3ans =3hs=zpk(z,p,k,0.1)Zero/pole/gain:(z+3) (z+5)-----------------(z+1) (z+3) (z+6)Sampling time: 0.1 2、开环系统30(1)()(2)(3)(6)S H S S S S S +=++-,绘制系统nyquist 曲线并判断闭环系统的稳定性,绘制出闭环系统的单位冲激响应。

相关主题