reinf3_3.m

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

M
39
字号
%%%%%%%%%%% Reinforcement Problem 3.3 %%%%%%%%%%%%   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                 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    ---- Interchanging two systems ----%cleardisp('Reinforcement Problem 3.3')Ts = 1;G1 = tf(0.02*[2 1.4],[1 -1.7 0.72],Ts)   % G1 in TF formpp = 0.9*exp(j*pi/5)pG2 = [pp; conj(pp); -0.8]          % poles of G2 as column vectorG2 = zpk(-0.2,pG2,0.5,Ts)           % G2 in ZPK form%---- reverse order of connection from Ex 3.1 ----T = G1*G2                       % series combination in ZPK formk = [0:Ts:50];                  % discrete time sequencey = step(T,k);                  % step response figurestem(k,y,':','filled'); grid    % plot responsetitle('Step response for Reinforcement Problem 3.3')xlabel('Discrete time k')%----- compute poles & zeros of G1, G2, & T ----[zG1,pG1,kG1] = zpkdata(G1,'v');    % zeros, poles, & gain of G1(z)[zG2,pG2,kG2] = zpkdata(G2,'v');    % zeros, poles, & gain of G2(z)[zT,pT,kT] = zpkdata(T,'v');        % zeros, poles, & gain of T(z)%---- display all zeros in polar form[magzG1,thetazG1] = xy2p(zG1)[magzG2,thetazG2] = xy2p(zG2)[magzT,thetazT] = xy2p(zT)%---- display all poles in polar form[magpG1,thetapG1] = xy2p(pG1)[magpG2,thetapG2] = xy2p(pG2)[magpT,thetapT] = xy2p(pT)%%%%%%%%%%

⌨️ 快捷键说明

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