%% Integral Minimum Gain Specified as Gain Value at Single Frequency
% Create a tuning goal that specifies a minimum loop gain profile of the form L = K / s. The gain profile attains the value of -20 dB (0.01) at 100 rad/s.

Req = TuningGoal.MinLoopGain('X',100,0.01);
viewGoal(Req)

% viewGoal confirms that the tuning goal is correctly specified. You can use this tuning goal to tune a control system that has a loop-opening location identified as 'X'. Since loop gain values less than 1 are ignored, this tuning goal specifies minimum gain only below 1 rad/s, with no restriction on loop gain at higher frequency.
%
% Although the specified gain profile (dashed line) is a pure integrator, for numeric reasons, the gain profile enforced during tuning levels off at very low frequencies, as described in Algorithms. To see the regularized gain profile, expand the axes of the tuning-goal plot.

xlim([10^-4,10^2])
ylim([-20,80])

% The shaded region reflects the modified gain profile.
% Copyright 2012 The MathWorks, Inc.