%% Overshoot Constraint
% Create a tuning goal that limits the overshoot of the step response from signals named 'r' to 'y' in a control system to 10 percent.

Req = TuningGoal.Overshoot('r','y',10);

%
% The overshoot tuning goal is evaluated as a constraint on the peak system gain, assuming second-order model characteristics (see Algorithms). Visualizing the tuning goal shows a shaded area where the target peak gain is exceeded.

viewGoal(Req)

% If you visualize the tuning goal with a tuned system, the plot includes the corresponding system response.
%
% Configure other characteristics of the tuning goal by setting properties. For instance, configure the tuning goal to apply only to the second model in a model array to tune. Also, configure it to be evaluated with a loop open at an analysis point in the control system called OuterLoop.

Req.Models = 2;
Req.Openings = 'OuterLoop';

% Copyright 2012 The MathWorks, Inc.