%% Second-Order Step Response With Known Natural Period and Overshoot
% Create a requirement that specifies a second-order step response with a natural period of 5 seconds, and a 10% overshoot. Create the requirement for the step response from a signal named 'r' to a signal named 'y'.

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

%
% When you use this requirement to tune a control system model, T, the natural period 5 is taken to be expressed in the prevailing units of the control system. For example, if T is a genss model and the property T.TimeUnit is 'seconds', then this requirement specifies a target natural period of 5 seconds for the response from the input 'r' to the output 'y' of 'T'.
% The specified parameters of the response is converted into a reference state-space model stored in the ReferenceModel property of the requirement.

refsys = tf(Req.ReferenceModel)

%
% As expected, refsys is a second-order model.
% Examine the requirement. The viewGoal command displays the target response, which is the step response of the reference model.

viewGoal(Req);

% The dashed line shows the target step response specified by this requirement, a second-order response with 10% overshoot and a natural period of five seconds.
% Copyright 2012 The MathWorks, Inc.