function obj = balredOptions(varargin)
%BALREDOPTIONS  Creates option set for BALRED.
%
%   OPT = BALREDOPTIONS returns the default options for BALRED.
%
%   OPT = BALREDOPTIONS('Option1',Value1,'Option2',Value2,...) uses name/value
%   pairs to override the default values for 'Option1','Option2',...
%
%   Supported options include:
%
%   StateProjection  State elimination method ('matchDC' or 'truncate').
%                    Specifies how to eliminate the weakly coupled states
%                    (states with smallest Hankel singular values). The
%                    "MatchDC" method (default) preserves the DC gain
%                    (steady-state value of step response) and tends
%                    to better match the time response. The "Truncate"
%                    method tends to better match the frequency response
%                    and is recommended with relative-error control.
%
%   ErrorBound       Error bound type ('absolute' or 'relative').
%                    Set to 'absolute' to control the absolute error 
%                    ||G-Gr||. Set to 'relative' to control the relative 
%                    error ||G\(G-Gr)||. Relative error gives a better match 
%                    across frequency while absolute error emphasizes areas
%                    with most gain.
%
%   Regularization   Regularization level (default = 'auto').
%                    With ErrorBound='relative', BALRED reduces the model
%                    [SYS,ALPHA*I] instead of SYS. Set this option to 'auto'
%                    to let BALRED pick a suitable ALPHA. Specify a value
%                    ALPHA>=0 to override this default. This regularization
%                    ensures a well-defined relative error at all frequencies.
%
%   FreqIntervals    Restricts gramians to specific frequency intervals.
%                    The default is [] (unrestricted gramians over full
%                    frequency range). Use this option to emphasize some
%                    frequency bands and ignore other. Set this option to a
%                    two-column matrix where each row specifies one
%                    interval.
%
%   TimeIntervals    Restricts gramians to specific time intervals.
%                    The default is [] (unrestricted gramians over full
%                    time range). Use this option to emphasize some time
%                    intervals and ignore other. Set this option to a
%                    two-column matrix where each row specifies one
%                    interval.
%
%   SepTol           Max loss of accuracy in stable/unstable decomposition 
%                    (default = factor 10). For models with unstable poles,  
%                    BALRED first extracts the stable dynamics using STABSEP. 
%                    Use this option to control the decomposition accuracy 
%                    (see STABSEPOPTIONS for details). Increasing SepTol
%                    helps separate nearby stable and unstable modes at the 
%                    expense of accuracy.
%                       
%   Offset           Offset for the stable/unstable boundary (default = 1e-8).
%                    In the stable/unstable decomposition, the stable term 
%                    includes only poles satisfying
%                       Continuous time:   Re(s) < -Offset * max(1,|Im(s)|)
%                       Discrete time:      |z|  < 1 - Offset
%                    Increase the value of "Offset" to treat poles close to 
%                    the stability boundary as unstable.
%
%   Example:
%      sys = zpk([-3 -.5],[-1e-6 -.49 -10],1);
%      opt = balredOptions('ErrorBound','rel','Offset',.001);
%      rsys = balred(sys,2,opt)  % treats -1e-6 as unstable
%
%   See also BALRED, STABSEP, STABSEPOPTIONS.

%   Author(s): P.Gahinet
%   Copyright 1984-2020 The MathWorks, Inc.
try
   obj = initOptions(ltioptions.balred,varargin);
catch E
   throw(E)
end
