ex7_1.m

来自「离散控制系统设计的MATLAB 代码」· M 代码 · 共 27 行

M
27
字号
%%%%%%%%%%%%%%%%%% Example 7.1 %%%%%%%%%%%%%%%%%%
%   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                 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   ---- Damping ratio computation ----
%
clear
disp('Example 7.1')

Ts = 0.1                            % sampling time
Gp = tf(1,[1 1 0])                  % plant in continuous tf form
Gz = c2d(Gp,Ts,'zoh')               % discretization with zero-order hold
Kz = tf(5*[1 -0.9],[1 -0.7],Ts)     % controller in discrete tf form
disp('******>'), pause
Ta = feedback(Gz*Kz,1,-1)           % CL transfer function
p = pole(Ta);                       % closed-loop poles in z-plane
[r,del] =xy2p(p);                   % poles in polar form
damp(Ta)                            % damping ratios
disp('******>'), pause
sig = -log(r)/Ts                    % real part of equiv. s-plane pole
w = del/Ts                          % imag part of equiv. s-plane pole
zeta = cos(atan(-w./sig))           % damping ratio
wn = sqrt(sig.^2+w.^2)              % undamped natural frequency
%%%%%%%%%%

⌨️ 快捷键说明

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