%% Step Response Requirement with Specified Tolerance
% Create a requirement for the step response from a signal named 'r' to a signal named 'y'. Constrain the step response to match the transfer function H = 10/(s+10), but allow 20% relative variation between the target the tuned responses.

H = tf(10,[1 10]);
Req = TuningGoal.StepResp('r','y',H);

%
% By default, this requirement allows a relative gap of 0.1 between the target and tuned responses. To change the relative gap to 20%, set the RelGap property of the requirement.

Req.RelGap = 0.2;

%
% Examine the requirement.

viewGoal(Req);

% The dashed line shows the target step response specified by this requirement. You can use this requirement to tune a control system model, T, that contains valid input and output locations named 'r' and 'y'. If you do so, the command viewGoal(Req,T) plots the achieved step response from 'r' to 'y' for comparison to the target response.
% Copyright 2012 The MathWorks, Inc.