⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imp_inv.m

📁 离散控制系统设计的MATLAB 代码
💻 M
字号:
function [Gz] = imp_inv(Gs,Ts)
% function [Gz] = imp_inv(Gs,Ts)
% function to convert a continuous-time system into a 
%   discrete-time system using the impulse invariant 
%   transform (standard z-transform).
%
% inputs - Gs - Continuous-time LTI system object
%          Ts - sampling time
% output - Gz - equivalent discrete-time LTI system object

%%%%%%%%%%%%%%%%%%% imp_inv.m %%%%%%%%%%%%%%%%%%%
%   Discrete-Time Control Problems using        %
%       MATLAB and the Control System Toolbox   %
%   by J.H. Chow, D.K. Frederick, & N.W. Chbat  %
%         Brooks/Cole Publishing Company        %
%                September 2002                 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[num,den] = tfdata(Gs);
num = num{1}; den = den{1};
[nrow,ncol] = size(den);
if nrow ~= 1
   disp('Functiion imp_inv applies only to single-input systems')
   return
end
[r,p,k] = residue(num,den);
pz = exp(p*Ts);
kz = sum(r);
rz = r.*exp(p*Ts);
[numz,denz] = residue(rz,pz,kz);
Gz = tf(Ts*real(numz),real(denz),Ts);
%%%%%%%%%%

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -