www.gusucode.com > control 案例程序 matlab源码代码 > control/TrackingRequirementMaximumTrackingErrorVsFrequencyExample.m

    %% Tracking Requirement With Maximum Tracking Error as a Function of Frequency
% Create a tracking requirement specifying that a signal |'theta'| track
% a signal |'theta_ref'|. The maximum relative error
% is 0.01 (1%) in the frequency range [0,1]. The
% relative error increases to 1 (100%) at the frequency 100. 
%%
% Use an |frd| model to specify the error profile as a function of frequency.
err = frd([0.01 0.01 1],[0 1 100]);
Req = TuningGoal.Tracking('theta_ref','theta',err);
%%
% The software converts |err| into a smooth function of frequency that
% approximates the piecewise specified requirement. Display the error
% requirement using |viewSpec|.
viewSpec(Req)
%%
% The yellow region indicates where the requirement is violated.