classdef (CaseInsensitiveProperties = true, TruncatedProperties = true) ...
      SparseModalTruncationOptions < mor.ModalTruncationOptions
   % Options for model reduction with sparse Modal Truncation method.
   %
   %   Focus          Frequency range of interest (default = [0 Inf]).
   %                  Set Focus=[FMIN FMAX] to only compute modes in
   %                  this frequency range. When set to [0,Inf], the
   %                  algorithm focuses on the smallest-magnitude modes.
   %
   %   MaxOrder       Max order of modal approximation (default = 1000).
   %                  This limits the number of eigenvalues computed by the
   %                  Krylov-Schur iterations and the order of the modal
   %                  approximation of the original sparse model.
   %
   %   ModeOnly       Only compute modes (default = false).
   %                  When ModeOnly=true, only the pole locations are computed.
   %                  When ModeOnly=false, the modal components and their
   %                  contributions are also available for mode selection.
   %
   %   DCFrequency    Frequency for DC contribution/matching (default = 0).
   %                  For models with integrators, modal contributions can't
   %                  be evaluated at DC since the DC gain is infinite. Set
   %                  DCFrequency to a positive value to evaluate modal
   %                  contributions and match gains at a different frequency.
   %                  The default value corresponds to the DC contributions.
   %
   %   InputScaling   Input and output scaling (default = []).
   %   OutputScaling  Use these options to emphasize specific input and output
   %                  channels in MIMO models. The modal (DC) contributions 
   %                  are evaluated for the scaled system. The default is no
   %                  scaling.
   %
   %   ModeTol        Accuracy of computed modes (default=1e-12).
   %                  Tolerance for identifying converged eigenvalues in
   %                  Krylov-Schur iterations.
   %
   %   SepTol         Relative accuracy of modal decomposition (default=1e-12).
   %                  Limits the condition number of the block diagonalizing
   %                  transformation to roughly SepTol/eps. Increasing SepTol
   %                  may yield smaller modal components at the expense of
   %                  accuracy.

   %  Copyright 2020-2023 The MathWorks, Inc.
   properties
      Focus (1,2) double {mustBeNonnegative} = [0,Inf];
      MaxOrder (1,1) double {mustBeInteger,mustBePositive} = 1000;
      ModeTol (1,1) double {mustBePositive,mustBeFinite} = 1e-12;  % REVISIT: Increase?
   end
   
   methods
                  
      function this = set.Focus(this,value)
         if value(1)<value(2)
            this.Focus = value;
         else
            error(message('Control:transformation:MODALROM12','Focus'))
         end
      end

   end

   methods (Access = protected)
      % Reorder properties
      function propgrp = getPropertyGroups(~)
         proplist = {'Focus','MaxOrder','ModeOnly','DCFrequency','InputScaling','OutputScaling','ModeTol','SepTol'};
         propgrp = matlab.mixin.util.PropertyGroup(proplist);
      end
   end
  
end

