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

    %% Plot Worst-Case Gain of Uncertain System
% Plot the worst-case gain of the following system:
%
% $$sys = \frac{{{s^2} + 3s}}{{{s^2} + 2s + a}}.$$ 
%
% The uncertain parameter _a_ = 2 $\pm$ 1. 
%%
a = ureal('a',2);
usys = tf([1 3 0],[1 2 a]);
wcsigma(usys) 
%%
% The |Worst| curve identifies the single response within the uncertainty
% that yields the highest gain at any frequency. The |Worst-case gain
% (upper bound)| curve is the envelope produced by finding the highest gain
% within the uncertainty at each frequency.
%
% The |Worst perturbation| curve identifies the combination of uncertain
% elements within the specified range that yields the highest overall gain.
% This perturbation corresponds to the |wcu| output of |wcgain|. The
% |Worst-case gain| curves show the lower and upper bounds on the
% worst-case gain at each frequency. For any perturbation within the
% specified uncertainty range, the principal gains (singular values) of the
% perturbed system lie below the |Worst-case gain (upper bound)| curve.
%%
% Focus the plot on the region between 0.1 and 10 rad/s.
w = {0.1 10};
wcsigma(usys,w) 
%%
% Examine the effect on the worst-case response of increasing the uncertainty
% range. To do this without changing the uncertainty specified in |usys|,
% use the |ULevel| option of |wcOptions|. This option scales the normalized
% uncertainty by the factor you specify. For example, examine the
% worst-case response a 50% greater uncertainty range.  
opts = wcOptions('ULevel',1.5);
wcsigma(usys,w,opts) 
%%
% The plot shows that increasing the uncertainty range substantially
% increases the worst-case gain at low frequencies.