q7.m
来自「Robust自动控制讲义」· M 代码 · 共 35 行
M
35 行
% Uses the robust control toolbox from Matlab v. 7
% Mixed sensitivity design
close all;
% Part (b)
s = tf('s'); % Laplace transform variable 's'.
G = (4*s+1)/((s-0.01)*(s^2+0.1*s+1)); % plant to be controlled
Gss=ss(G);
Wp=(0.5*s+10)/(s+0.01); % Sensitivity weight
Wu=[0.001]; % Control weight
Wt=(2*s+1)/(10*s+2); % Complementary sensitivity weight
[Kss,N,N_norm,INFO]=mixsyn(Gss,Wp,Wu,Wt);
K = tf(Kss);
Kzp=zpk(K)
% Part (c)
L=G*K; % loop transfer function
S=inv(1+L); % Sensitivity
T=1-S; % complementary sensitivity
[Gm,Pm,wcg,wcp] = margin(L); % Calculate the gain margin and phase margins.
Gm_dB = 20*log10(Gm);
% Part (d)
figure;
step(T);
figure;
sigma(S,1/Wp,'-.');title('|S|(-) and |1/Wp| (-.)');
figure;
sigma(T,1/Wt,'-.');title('|T| (-) and |1/Wt| (-.)');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?