cp2_4.m
来自「离散控制系统设计的MATLAB 代码」· M 代码 · 共 58 行
M
58 行
%%%%%%%%%%% Comprehensive Problem 2.4 %%%%%%%%%%%
% 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 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Hydro-turbine System
clear
disp('Comprehensive Problem 2.4')
disp('Open-loop response of hydro-turbine system')
dhydro % read data
disp('discrete-time transfer function')
Gz = tf(dnum,dden,Ts) % form tf object
% step response of hydro-turbine to q
[y,dt] = step(Gz);
figure
stem(dt,y,':')
xlabel('Time (s)')
ylabel('Amplitude')
title('CP2.4: Response of Power P to unit Step of Actuator Input u')
grid
disp('*****>'), pause
% extract numerator and denominator of transfer function
[numGz,denGz] = tfdata(Gz,'v')
[r,p,k] = residue(numGz,denGz)
disp('Note that r(2) is negative')
disp(' ')
disp('*****>'), pause
t = [0:0.07:7]';
disp('Response due to the first pole')
p(1)
y = rpole2k(p(1),r(1),t);
figure
stem(t,y,':'), grid
title('CP2.4: Response due to the first pole')
xlabel('Time (s)')
ylabel('Amplitude')
disp('*****>'), pause
disp('Response due to the second pole')
p(2)
y = rpole2k(p(2),r(2),t);
figure
stem(t,y,':'), grid
title('CP2.4: Response due to the second pole')
xlabel('Time (s)')
ylabel('Amplitude')
disp('*****>'), pause
disp('End of Comprehensive Problem 2.4')
%%%%%%%%%%
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?