第五章 线性离散控制系统  

 

5.7 Matlab在离散系统中应用

 

连续系统离散化,在Matlab中应用CZDM函数。它的一般格式为

例 已知开环离散控制系统结构如图,求开环脉冲传递函数。采样周期T=1秒。

解 先用解析求G(Z)

用Matlab可以很方便求得上述结果
%This script converts the transfer function
%G(S)=1/s(s+1) to a discrete-time system
%with a sampling period of T=1 sec
%
num=[1];den=[1,1,0];
T=1;
[numZ,denZ]=c2dm(num,den,T,'Zoh');
printsys(numZ,denZ,'Z')

打印结果

假定离散系统如图5-54所示。输入为单位阶跃,可用dstep函数求输出响应。

例 已知离散系统结构如图所示,输入为单位阶跃,采样周期T=1秒,求输出响应。

解: 由

可绘制输出响应如图

如果用Matlab的dstep函数,可很快得到离散输出y*(t)和连续输出结果y(t)
%This script gene rather the unit step response ,y(kt),
%for the sampled data system given in example
%
num=[0 0.368 0.264]; den=[1 -1 0.632];
dstep(num,den)




This script computes the continuous-time unit
%step response for the system in example
%
numg=[1];deng=[1 1 0];
[nd,dd]=pade(1,2)
numd=dd-nd;
dend=conv([1 0],dd);
[numdm,dendm]=minreal(numd,dend);
%
[n1,d1]=series(numdm,dendm,numg,deng);
[num,den]=cloop(n1,d1);
t=[0:0.1:20];
step(num,den,t)