%% Controller Synthesis with Target Performance Level
% For controllers that are close to optimal performance, controller gains can sometimes get large. If you know that your application does not require the optimal achievable performance level, you can limit the range of \gamma values that hinfsyn tests. Suppose you know that \gamma \approx 1\ldotp 5 is good enough for your application. Using the same plant as in the example docid:robust_ref.mw_654ac62b-c5c6-4359-a4c0-0777764684b6, compute a controller using a target performance range of [1.4,1.6]. Turn on the display to see the progress of the computation.

load hinfsynExData P
ncont = 1; 
nmeas = 2; 

opts = hinfsynOptions('Display','on');
gamRange = [1.4 1.6];
[K,CL,gamma,info] = hinfsyn(P,nmeas,ncont,gamRange,opts);

%
% The display shows all the performance levels tested by hinfsyn. In this case, all tested performance levels pass the tests that hinfsyn applies for closed-loop stability (see docid:robust_ref.mw_55b1558e-5549-4ae7-964e-87618c26beb0). Although the smallest tested level is 1.41, the controller returned for that value achieves an actual performance level of gamma, which is about 0.95. The smallest tested level is returned in the gamma field of the info structure.

info.gamma

%
% If you try to obtain a performance level that is not achievable with any controller, the display informs you that the target is too small, and returns an empty controller and closed-loop system. For example, suppose you try to achieve a performance level of 0.75.

gamTry = 0.75
[K,CL,gamma] = hinfsyn(P,nmeas,ncont,gamTry,opts)

%
% Copyright 2018 The MathWorks, Inc.