📄 reinf2_11.m
字号:
%%%%%%%%%%% Reinforcement Problem 2.11 %%%%%%%%%%% 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 third-order system ---%cleardisp('Reinforcement Problem 2.11')numG = [0.2 1.1 0.5] % create G(z)denG = [1 0.7 0.5 0.1] % ...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:14]; % 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.11')subplot(2,1,1)stem(ki,yi,'filled');grid % plot impulse response of Gstep(z)legend('via impulse cmd')xlabel('Discrete time')subplot(2,1,2)stem(ks,ys,'o');grid legend('via step command')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 + -