资源简介
分数阶PID控制的MATLAB、SIMULINK工具箱
代码片段和文件信息
function varargout = bodeFr(F Q w delay)
% [gain phase w] = bodeFr(F Q w delay)
% Bode diagram of a fractional plant. Paramter w may be a vector with the
% frequencies of the plot (in rad/s) or a cell with the limits of the
% frequency range of the plot (in rad/s). If empty a suitable range is
% provided.
% F may be of the form [P I lambda D mu] in which case the plant is
% P + I/(s^lambda) + D*(s^mu) and parameter Q is irrelevant; or be an lti
% object in which case Q will be the commensurate order (the default value
% of which will be 1. For instance plant 1/(1+s^.5) correponds to
% F = tf(1[1 1]) and Q = 0.5.
% Parameter delay is an optional delay the default being 0.
% A Bode diagram is plot if there are no return values.
% Otherwise the function returns the gain (absolute value) and the phase
% (in degrees) at frequencies w (in rad/s).
% Duarte Val閞io 2004
if nargin < 4 delay = 0; end % there is no delay by default
if nargin < 3 | isempty(w) % no data on w was provided
try % F is given as an ltimodel
temp = abs([tzero(F); pole(F)]);
catch % length(F) == 5 F is given as a list of parameters for a fractional PID
P = F(1); I = F(2); lambda = F(3); D = F(4); mu = F(5);
temp = sort([abs((-P+sqrt(P^2-4*D*I))/(2*D)) abs((-P-sqrt(P^2-4*D*I))/(2*D))]);
end % now temp has the zeros and poles of the plant
if min(temp)
wmax = 10^ceil(log10(max(temp))) * 100; %limits are powers of 10
wmin = 10^floor(log10(min(temp))) / 100;
else % temp has zeros
wmax = 100;
wmin = .01;
end
w = logspace(log10(wmin) log10(wmax) 10 * ceil(log10(wmax/wmin)));
end
% there are 10 frequencies per decade
if iscell(w) % only wmax and wmin were provided
wmin = w{1};
wmax = w{2};
w = logspace(log10(wmin) log10(wmax) 10 * ceil(log10(wmax/wmin)));
end
if nargin < 2 | isempty(Q) Q = 1; end % integer plants assumed as default
resp = freqrespFr(F Q w delay); % freqrespFr does the important work
gain = abs(resp);
phase = rad2deg(unwrap(angle(resp)));
if nargout == 0 % there are no output variables draw a plot
subplot(211)
semilogx(w 20*log10(gain))
grid on
title(‘Bode diagram‘)
xlabel(‘frequency / rad s^{-1}‘)
ylabel(‘gain / dB‘)
subplot(212)
semilogx(w phase)
grid on
ylabel(‘phase / ?)
else
varargout{1} = gain; % absolute value (NOT dB)
if nargout > 1 varargout{2} = phase; end % degrees
if nargout > 2 varargout{3} = w; end % rad/s
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2584 2005-08-17 12:46 ninteger\bodeFr.m
文件 2658 2005-08-17 18:01 ninteger\contents.m
文件 1779 2005-08-17 11:36 ninteger\crone1.m
文件 7442 2005-07-04 11:48 ninteger\crone2.m
文件 8274 2005-07-07 13:05 ninteger\crone2z.m
文件 14716 2004-02-16 18:34 ninteger\crone3.m
文件 1416 2005-07-14 12:13 ninteger\freqrespFr.m
文件 1363 2004-01-19 21:58 ninteger\hartley.m
文件 3387 2005-07-12 13:38 ninteger\lawro.m
文件 3431 2005-07-28 17:08 ninteger\levy.m
文件 762 2003-07-30 20:48 ninteger\matsudaCFE.m
文件 1927 2005-06-29 15:48 ninteger\newton.m
文件 2406 2005-07-14 13:12 ninteger\nicholsFr.m
文件 14751 2005-06-27 18:45 ninteger\nid.m
文件 19910 2005-08-01 18:27 ninteger\nintblocks.mdl
文件 2681 2005-06-27 11:02 ninteger\nipid.m
文件 5599 2005-08-23 16:53 ninteger\normh2Fr.m
文件 1030 2005-07-15 11:15 ninteger\normhinfFr.m
文件 2442 2005-07-14 13:12 ninteger\nyquistFr.m
文件 4560 2004-12-03 14:27 ninteger\sanko.m
文件 2247 2005-08-23 17:49 ninteger\sigmaFr.m
文件 3632 2004-08-10 12:20 ninteger\vinagre.m
文件 977 2002-07-18 13:56 ninteger\cfractions\contfrac.m
文件 1345 2004-08-24 11:23 ninteger\cfractions\contfraceval.m
文件 872 2003-08-04 09:44 ninteger\cfractions\contfracf.m
文件 1106 2002-07-24 18:20 ninteger\cfractions\contfracfeval.m
文件 51512 2003-09-22 12:43 ninteger\gui\crone2Gui.fig
文件 29634 2004-07-27 14:03 ninteger\gui\crone2Gui.m
文件 29376 2003-09-22 23:33 ninteger\gui\crone3Gui1.fig
文件 13312 2003-09-22 23:54 ninteger\gui\crone3Gui1.m
............此处省略21个文件信息
相关资源
- MATLAB单双目标定工具箱
- T-S模糊辨识与广义预测控制MATLAB源程
- BP算法的改进在Matlab的实现研究
- 人脸识别系统 现成的matlab代码
- svpwm的matlab仿真227144
- 基于DWT的数字水印算法的MatLab实现
- yalmip 工具包
- 量子聚类算法matlab实现
- harris特征点提取,matlab
- 两阶段单纯形法的Matlab实现
- 一种实时坏点检测和修复算法的matl
- 图像边界提取与处理matlab的实现
- 提升小波变换的matlab程序
- Matlab编写的DPIV速度场程序
- 基本鱼群算法 MATLAB函数
- 遗传算法之一元函数求最值matlab
- A*算法航迹规划
- 信道容量的仿真代码
- MATLAB RGB和YUV格式相互转化
- MATLAB FIR语音滤波
- 细化算法GUI实现 机器人路径规划
- 最小生成树的MATLAB程序
- 基于MATLAB对FSK信号调制与解调的仿真
- 基于遗传算法的机器人路径规划MATL
- 无向图中最大团问题的matlab代码
- UKF无迹卡尔曼滤波算法matlab代码
- 遗传算法图像分割Matlab编写
- 盲源分离的JADE算法的Matlab程序
- 基于埃米特样条函数提取包络线实现
- 自相关和周期自相关函数matlab
评论
共有 条评论