reinf3_16.m
来自「离散控制系统设计的MATLAB 代码」· M 代码 · 共 47 行
M
47 行
%%%%%%%%%% Reinforcement Problem 3.16 %%%%%%%%%%%% 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ---- Gain variation ----%cleardisp('Reinforcement Problem 3.16')Ts = 1;%---- H(z) is same for each caseH = tf([1 -0.8],[2 1],Ts) % feedback path in TF formdtime = 0:Ts:20;figureK = [1 2 5 10];%-------- run 4 cases, plotting step responses as subplots ----for ii = 1:4, kG = K(ii) G = tf(kG,conv([1 0],[10 -2 1]),Ts) % forward path in TF form T = feedback(G,H) % closed-loop system y = step(T,dtime); % compute step response subplot(2,2,ii) stem(dtime,y,':','filled');grid % plot step response title(['Reinf 3.16: K = ',num2str(kG)])end%----- rerun the 4 cases, plotting CL poles in z plane -----figureucircle;gridhold onfor ii = 1:4, kG = K(ii); disp(['==== K = ',num2str(kG),' ====']) G = tf(kG,conv([1 0],[10 -2 1]),Ts) % forward path in TF form T = feedback(G,H) % closed-loop system [zT,pT,kT] = zpkdata(T,'v') % CL zeros,poles,gain [magpT,thetapT] = xy2p(pT) % polar form of CL poles plot(pT,'*')endhold offtitle('Pole-zero plot for Reinforcement Problem 3.16')xlabel('Real part of z')ylabel('Imaginary part of z')%%%%%%%%%%
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?