📄 reinf2_12.m
字号:
%%%%%%%%%%% Reinforcement Problem 2.12 %%%%%%%%%%% 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- Step response of a fourth-order system ---%cleardisp('Reinforcement Problem 2.12')numG = [0.3 0.4 0.5] % create G(z)denG = [1 -1.3 0.455 0.0628 -0.037] % ...as TF objectG = tf(numG,denG,1) % ...with unit sampling periodnumGstep = [numG 0] % add a zero at z=0 to G(z)denGstep = conv(denG,[1 -1]) % add a pole at z=1 to G(z)Gstep = tf(numGstep,denGstep,1) % create zG(z)/(z-1) as TF objectdtime = [0:19]; % define discrete time samples[yi,ki] = impulse(Gstep,length(dtime)); % step response via impulse cmd[ys,ks] = step(G,length(dtime)); % step response via step commandfiguretitle('Step Response for Reinforcement Problem 2.12')subplot(2,1,1)stem(ki,yi,'filled');grid % plot impulse response of Gstep(z)legend('via impulse cmd',4)xlabel('Discrete time')subplot(2,1,2)stem(ks,ys,'o');grid % plot step response of G(z)legend('via step command',4)xlabel('Discrete time')disp('DC gain is:')disp(dcgain(G)) % DC gain of G(z)%%%%%%%%%%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -