📄 reinf2_19.m
字号:
%%%%%%%%%%% 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -