www.gusucode.com > robust 案例源码程序 matlab代码 > robust/OptimalLoopsynLoopShapingControlExample.m

    %% Optimal loopsyn Loop-Shaping Control
% Calculate the optimal |loopsyn| loop shaping control for a 5-state,
% 4-output, 5-input plant with a full-rank nonmininum-phase zero at _s_ =
% 10.
%%

% Copyright 2015 The MathWorks, Inc.

rng(0,'twister');
s = tf('s'); 
w0 = 5; 
Gd = 5/s;                           % desired bandwidth w0=5
G =((s-10)/(s+100))*rss(3,4,5);     % 4-by-5 non-min-phase plant
[K,CL,GAM,INFO] = loopsyn(G,Gd);  
sigma(G*K,'r',Gd*GAM,'k-.',Gd/GAM,'k-.',{.1,100})  % plot result
legend('G*K','Gd*GAM','Gd/GAM')
%%
% This plot shows that the controller |K| optimally fits |sigma(G*K)|.  The
% controller falls between |sigma(Gd)+ GAM| and |sigma(Gd)- GAM| (expressed in dB).  In this
% example, |GAM| = 2.0423 = 6.2026 dB.