例8_7
对连续模型
H(s)?6(s?3)
(s?1)(s?2)(s?5)采用MATLAB提供的各种函数进行离散化处理,得到稍有差异的状态方程。 解:
disp('Contunue system'); k=6; z=[-3];
p=[-1,-2,-5];
[a,b,c,d]=zp2ss(z,p,k); %discrete system t=0.1;
disp('Discrete system --using c2d'); [a1,b1]=c2d(a,b,t)
disp('Discrete system--using c2dm with zoh'); [a2,b2,c2,d2]=c2dm(a,b,c,d,t,'zoh')
disp('Discrete system--using c2dm with foh'); [a3,b3,c3,d3]=c2dm(a,b,c,d,t,'foh')
disp('Discrete system--using c2dm with Tustin'); [a4,b4,c4,d4]=c2dm(a,b,c,d,t,'tustin')
Contunue system
Discrete system --using c2d a1 =
0.9048 0 0 0.1338 0.4651 -0.2237 0.0243 0.2237 0.9602 b1 =
0.0952 0.0784 0.0135
Discrete system--using c2dm with zoh a2 =
0.9048 0 0 0.1338 0.4651 -0.2237 0.0243 0.2237 0.9602 b2 =
0.0952 0.0784 0.0135 c2 =
0 0 1.8974 d2 = 0
Discrete system--using c2dm with foh a3 =
0.9048 0 0 0.1338 0.4651 -0.2237 0.0243 0.2237 0.9602 b3 =
0.0906
0.0611 0.0240 c3 =
0 0 1.8974 d3 =
0.0089
Discrete system--using c2dm with Tustin a4 =
0.9048 0 0 0.1385 0.4545 -0.2300 0.0219 0.2300 0.9636 b4 =
0.9524 0.7965 0.1259 c4 =
0.0021 0.0218 0.1863 d4 =
0.0119 回目录
2.控制系统的时域分析 例8_8
典型二阶系统
2?n H(s)?22s?2??ns??n其中?n为自然频率(无阻尼振荡频率),?为相对阻尼系数。试绘制出?n?6,?分别为
0.1,0.2,…,1.2,2.0时的单位阶跃响应。 解: wn=6;
kosi=[0.1:0.1:1.0,2.0]; figure(1); hold on;
for kos=kosi num=wn.^2;
den=[1,2*kos*wn,wn.^2]; step(num,den) end;
%title('Step response'); hold off;
Step ResponseFrom: U(1)1.81.61.41.2AmplitudeTo: Y(1)10.80.60.40.200246810Time (sec.) 回目录
例8_9
对典型二阶系统
2?n H(s)?22s?2??ns??n绘制出当??0.7,?n取2,4,6,8,10,12时的单位阶跃响应。
w=[2:2:12]; kos=0.7; figure(1); hold on; for wn=w
num=wn.^2;
den=[1,2*kos*wn,wn.^2]; step(num,den) end;
%title('Step response'); hold off;
Step ResponseFrom: U(1)1.41.21AmplitudeTo: Y(1)0.80.60.40.2000.511.522.533.54Time (sec.) 回目录
例8_10
求三阶系统
5(s2?5s?6)H(s)?3 2s?6s?10s?8的单位阶跃响应。 解:
num=[5 25 30]; den=[1 6 10 8]; figure
step(num,den);
title('Step response'); hold off; Step responseFrom: U(1)4.543.53AmplitudeTo: Y(1)2.521.510.500123456Time (sec.) 回目录