reinf7_8.m

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

M
28
字号
%%%%%%%%%%% Reinforcement Problem 7.8 %%%%%%%%%%%
%   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                 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Ts = 0.1
Gp = tf(1,[1 8 32])
Gz  = c2d(Gp,Ts);
Kz = 20 + tf([10 0],[1 -1],Ts)
%Kz = 20 + tf(10,[1 -1],Ts)
margin(Gz*Kz)
% get closed-loop system
Gcl = feedback(Gz*Kz,1)

[mag_CLdB,ph_CL,w] = bodedb(Gcl);    % CL magnitude in dB & phase
lfg_CL = dcgain(Gcl)                 % dc gain as ratio
lfg_CLdB = 20*log10(lfg_CL);        % dc gain in decibels

BW = bwcalc(mag_CLdB,w,lfg_CLdB)    % closed-loop bandwidth in rad/s
[M_pw,i] = max(mag_CLdB)            % maximum CL frequency response
wp = w(i)                           % .....at this frequency (rad/s)

damp(Gcl)
[y,t] = step(Gcl);
[Moa,tpa,tra,tsa,essa] = tstats(t,y,dcgain(Gcl))
%%%%%%%%%%

⌨️ 快捷键说明

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