cp3_4a.m
来自「离散控制系统设计的MATLAB 代码」· M 代码 · 共 70 行
M
70 行
%%%%%%%%%% Comprehensive Problem 3.4(a) %%%%%%%%%
% 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 3.4a')
disp('Proportional control of hydro-turbine system')
dhydro % read data
disp('discrete-time transfer function')
Gz = tf(dnum,dden,Ts) % form tf object
disp('*****>'), pause
disp('Closed-loop system transfer function for ')
disp('...proportional control Kp = 0.5')
Kp = 0.5;
T = feedback(Gz*Kp,1)
disp('*****>'), pause
disp('Poles of closed-loop system')
xy2p(pole(T));
disp('Zeros of closed-loop system')
xy2p(tzero(T));
disp('DC gain of closed-loop system')
dcgain(T)
disp('*****>'), pause
disp('Step response of hydro-turbine to step reference input')
figure
[y,dt] = step(T);
plot(dt,y,'o')
xlabel('Time (s)')
ylabel('Amplitude')
title('CP3.4a: Closed-loop Response of Power P to Unit Step of Reference Input')
grid
disp('*****>'), pause
disp('Repeat computations for Kp = 0.735')
disp('Closed-loop system transfer function for ')
disp('...proportional control Kp = 0.735')
Kp = 0.735
T = feedback(Gz*Kp,1)
disp('*****>'), pause
disp('Poles of closed-loop system')
xy2p(pole(T));
disp('Zeros of closed-loop system')
xy2p(tzero(T));
disp('DC gain of closed-loop system')
dcgain(T)
disp('*****>'), pause
disp('Step response of hydro-turbine to step reference input')
figure
dt = [0:Ts:20]';
y = step(T,dt);
plot(dt,y,'o')
xlabel('Time (s)')
ylabel('Amplitude')
title('CP3.4a: Closed-loop Response of Power P to Unit Step of Reference Input')
grid
disp('*****>'), pause
disp('end of Comprehensive Problem 3.4a')
%%%%%%%%%%
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?