?? timdly.m
字號:
function [mmm,ddd] = timdly(cloop,num,den,wrang,tdly,cmpc)
%
% TIMDLY is a function used to evaluate the frequency response of
% a system containing a pure time delay element exp(-TDLY*s)
% over the frequency range of WRANG. The system is given by
% the open loop transfer function [NUM,DEN]. CLOOP is an
% identifier. The results are returned in [MMM,DDD], which
% are the magnitude and phase arrays of the system.
%
% [MMM, DDD] = TIMDLY(CLOOP, NUM, DEN, WRANG, TDLY, CMPC)
%
% MMM, DDD -- the magnitude and phase over WRANG
% CLOOP -- identifier, see CONFIG
% NUM, DEN -- the num and den of the system
% WRANG -- the frequency range
% TDLY -- the time delay constant
% CMPC -- the complex form of feedback loop
%
% Author: Ole Barup Sorensen, Rapid Data Ltd
% Copyright (c) 1989-94 by Rapid Data Ltd
% Revision 10:06 07/02/94
[mmm,ddd] = bode(num,den,wrang);
ddd = ddd - 180 / pi * tdly * wrang';
if cloop ~= 0
j = sqrt(-1);
ddd0 = pi/180 * ddd;
rfr = mmm .* cos(ddd0); ifr = mmm .* sin(ddd0);
cmpfr = rfr + j * ifr;
cmp1 = cmpfr;
if cloop == 1, cmp1 = cmpfr .* cmpc; end
cmp1 = ones(size(cmp1)) + cmp1;
cmpfr = cmpfr ./ cmp1;
mmm = abs(cmpfr); ddd = angle(cmpfr); ddd0 = 180/pi*ddd;
end
nc = length(ddd);
for i=1:nc
xx = ddd(i);
while (xx >= 0 | xx <= -360),
xx = xx-360*sign(xx);
end
ddd(i) = xx;
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -