reinf2_19.m

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

M
42
字号
%%%%%%%%%%% Reinforcement Problem 2.19 %%%%%%%%%%%   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                 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- Sinusoidal input sequence ---%cleardisp('Reinforcement Problem 2.19')z1 = exp(j*pi/10);zz = [z1; conj(z1)]pp = [0.2; 0.4; 0.6; 0.8]gn = 2G = zpk(zz,pp,gn,1)         % build G(z) as ZPK object with Ts = 1[magzG,thetazG] = xy2p(zz)  % magnitude and angle of system zeros k = 0:40;                   % discrete time  u = 10*sin(pi*k/10);        % discrete input sequence              y = lsim(G,u,k);            % system response due to u(k)figurestem(k,y,'filled');grid     % plot responsehold onplot(k,u,'o')               % plot inputhold offtext(26,11,'input')text(10,13,'output')title('Response for Reinforcement Problem 2.19')xlabel('Discrete time k')%-- verify that poles of input transform are same as zeros of G(z) --%  transform of input: per #18 in Franklin, Powell, Workman%  numU(z) = z*sin(pi/10)%  denU(z) = z^2 -2*cos(pi/10)*z  + 1numU = sin(pi/10);denU = [1 -2*cos(pi/10)  1]pU = roots(denU)	            [magpU,thetapU] = xy2p(pU)    % magnitude & angle of input poles%%%%%%%%%%

⌨️ 快捷键说明

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