📄 imp_inv.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 + -