# doc-cache created by Octave 6.1.0
# name: cache
# type: cell
# rows: 3
# columns: 95
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
Anderson


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
Frequency-weighted coprime factorization controller reduction.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
Frequency-weighted coprime factorization controller reduction.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
BMWengine


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1277
 -- Function File: SYS = BMWengine ()
 -- Function File: SYS = BMWengine ("SCALED")
 -- Function File: SYS = BMWengine ("UNSCALED")
     Model of the BMW 4-cylinder engine at ETH Zurich's control
     laboratory.
          OPERATING POINT
          Drosselklappenstellung     alpha_DK = 10.3 Grad
          Saugrohrdruck              p_s = 0.48 bar
          Motordrehzahl              n = 860 U/min
          Lambda-Messwert            lambda = 1.000
          Relativer Wandfilminhalt   nu = 1
          INPUTS
          U_1 Sollsignal Drosselklappenstellung   [Grad]
          U_2 Relative Einspritzmenge             [-]
          U_3 Zuendzeitpunkt                      [Grad KW]
          M_L Lastdrehmoment                      [Nm]
          STATES
          X_1 Drosselklappenstellung     [Grad]
          X_2 Saugrohrdruck              [bar]
          X_3 Motordrehzahl              [U/min]
          X_4 Messwert Lamba-Sonde       [-]
          X_5 Relativer Wandfilminhalt   [-]
          OUTPUTS
          Y_1 Motordrehzahl              [U/min]
          Y_2 Messwert Lambda-Sonde      [-]
          SCALING
          U_1N, X_1N   1 Grad
          U_2N, X_4N, X_5N, Y_2N   0.05
          U_3N   1.6 Grad KW
          X_2N   0.05 bar
          X_3N, Y_1N   200 U/min


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
Model of the BMW 4-cylinder engine at ETH Zurich's control laboratory.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
Boeing707


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 389
 -- Function File: SYS = Boeing707 ()
     Creates a linearized state-space model of a Boeing 707-321 aircraft
     at V=80 m/s (M = 0.26, GA0 = -3 deg, ALPHA0 = 4 deg, KAPPA = 50
     deg).

     System inputs: (1) thrust and (2) elevator angle.

     System outputs: (1) airspeed and (2) pitch angle.

     *Reference*: R. Brockhaus: 'Flugregelung' (Flight Control),
     Springer, 1994.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Creates a linearized state-space model of a Boeing 707-321 aircraft at
V=80 m...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
MDSSystem


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 165
Robust control of a mass-damper-spring system.

   Type 'which MDSSystem' to locate,

   'edit MDSSystem' to open and simply

   'MDSSystem' to run the example file.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Robust control of a mass-damper-spring system.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
Madievski


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2420
Demonstration of frequency-weighted controller reduction.  The system
considered in this example has been studied by Madievski and Anderson
[1] and comprises four spinning disks.  The disks are connected by a
flexible rod, a motor applies torque to the third disk, and the angular
displacement of the first disk is the variable of interest.  The
state-space model of eighth order is non-minimumphase and unstable.  The
continuous-time LQG controller used in [1] is open-loop stable and of
eighth order like the plant.  This eighth-order controller shall be
reduced by frequency-weighted singular perturbation approximation (SPA).
The major aim of this reduction is the preservation of the closed-loop
transfer function.  This means that the error in approximation of the
controller K by the reduced-order controller KR is minimized by
     min ||W (K-Kr) V||
      Kr               inf
   where weights W and V are dictated by the requirement to preserve (as
far as possible) the closed-loop transfer function.  In minimizing the
error, they cause the approximation process for K to be more accurate at
certain frequencies.  Suggested by [1] is the use of the following
stability and performance enforcing weights:
                  -1                      -1
     W = (I - G K)   G,      V = (I - G K)
   This example script reduces the eighth-order controller to orders
four and two by the function call 'Kr = spaconred (G, K, nr, 'feedback',
'-')' where argument NR denotes the desired order (4 or 2).  The
key-value pair ''feedback', '-'' allows the reduction of negative
feedback controllers while the default setting expects positive feedback
controllers.  The frequency responses of the original and reduced-order
controllers are depicted in figure 1, the step responses of the closed
loop in figure 2.  There is no visible difference between the step
responses of the closed-loop systems with original (blue) and fourth
order (green) controllers.  The second order controller (red) causes
ripples in the step response, but otherwise the behavior of the system
is unaltered.  This leads to the conclusion that function 'spaconred' is
well suited to reduce the order of controllers considerably, while
stability and performance are retained.
*Reference*
[1] Madievski, A.G. and Anderson, B.D.O. 'Sampled-Data Controller
Reduction Procedure', IEEE Transactions of Automatic Control, Vol.  40,
No.  11, November 1995


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
Demonstration of frequency-weighted controller reduction.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
VLFamp


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1003
 -- Function File: VLFamp
 -- Function File: RESULT = VLFamp (VERBOSE)
     Calculations on a two stage preamp for a multi-turn, air-core
     solenoid loop antenna for the reception of signals below 30kHz.

     The Octave Control Package functions are used extensively to
     approximate the behavior of operational amplifiers and passive
     electrical circuit elements.

     This example presents several 'screen' pages of documentation of
     the calculations and some reasoning about why.  Plots of the
     results are presented in most cases.

     The process is to display a 'screen' page of text followed by the
     calculation and a 'Press return to continue' message.  To proceed
     in the example, press return.  ^C to exit.

     At one point in the calculations, the process may seem to hang,
     but, this is because of extensive calculations.

     The returned transfer function is more than 100 characters long so
     will wrap in screens that are narrow and appear jumbled.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Calculations on a two stage preamp for a multi-turn, air-core solenoid
loop a...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
WestlandLynx


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1260
 -- Function File: SYS = WestlandLynx ()
     Model of the Westland Lynx Helicopter about hover.
          INPUTS
          main rotor collective
          longitudinal cyclic
          lateral cyclic
          tail rotor collective
          STATES
          pitch attitude           theta       [rad]
          roll attitude            phi         [rad]
          roll rate (body-axis)    p           [rad/s]
          pitch rate (body-axis)   q           [rad/s]
          yaw rate                 xi          [rad/s]
          forward velocity         v_x         [ft/s]
          lateral velocity         v_y         [ft/s]
          vertical velocity        v_z         [ft/s]
          OUTPUTS
          heave velocity           H_dot       [ft/s]
          pitch attitude           theta       [rad]
          roll attitude            phi         [rad]
          heading rate             psi_dot     [rad/s]
          roll rate                p           [rad/s]
          pitch rate               q           [rad/s]

     *References*
     [1] Skogestad, S. and Postlethwaite I. (2005) 'Multivariable
     Feedback Control: Analysis and Design: Second Edition'.  Wiley.
     <http://www.nt.ntnu.no/users/skoge/book/2nd_edition/matlab_m/matfiles.html>


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Model of the Westland Lynx Helicopter about hover.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
acker


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 496
 -- Function File: K = acker (A, B, P)
     Calculates the state feedback matrix of a completely controllable
     SISO system using Ackermann's formula

     Given the state-space system
                .
                x = Ax + bu

     and the desired closed-loop behaviour

                p(s) = s^n + a1*s^(n-1) + ... + an

     via the vector p containing the roots of the polynom, the state
     feedback matrix k is calculated:

                k = (k1 k2 ... kn)

     See also: place.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Calculates the state feedback matrix of a completely controllable SISO
system...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
append


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 116
 -- Function File: SYS = append (SYS1, SYS2, ..., SYSN)
     Group LTI models by appending their inputs and outputs.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Group LTI models by appending their inputs and outputs.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3
arx


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1953
 -- Function File: [SYS, X0] = arx (DAT, N, ...)
 -- Function File: [SYS, X0] = arx (DAT, N, OPT, ...)
 -- Function File: [SYS, X0] = arx (DAT, OPT, ...)
 -- Function File: [SYS, X0] = arx (DAT, 'NA', NA, 'NB', NB)
     Estimate ARX model using QR factorization.

          A(q) y(t) = B(q) u(t) + e(t)

     *Inputs*
     DAT
          iddata identification dataset containing the measurements,
          i.e.  time-domain signals.
     N
          The desired order of the resulting model SYS.
     ...
          Optional pairs of keys and values.  ''key1', value1, 'key2',
          value2'.
     OPT
          Optional struct with keys as field names.  Struct OPT can be
          created directly or by function 'options'.  'opt.key1 =
          value1, opt.key2 = value2'.

     *Outputs*
     SYS
          Discrete-time transfer function model.  If the second output
          argument X0 is returned, SYS becomes a state-space model.
     X0
          Initial state vector.  If DAT is a multi-experiment dataset,
          X0 becomes a cell vector containing an initial state vector
          for each experiment.

     *Option Keys and Values*
     'NA'
          Order of the polynomial A(q) and number of poles.

     'NB'
          Order of the polynomial B(q)+1 and number of zeros+1.  NB <=
          NA.

     'NK'
          Input-output delay specified as number of sampling instants.
          Scalar positive integer.  This corresponds to a call to
          function 'nkshift', followed by padding the B polynomial with
          NK leading zeros.

     *Algorithm*
     Uses the formulae given in [1] on pages 318-319, 'Solving for the
     LS Estimate by QR Factorization'.  For the initial conditions,
     SLICOT IB01CD is used by courtesy of NICONET e.V.
     (http://www.slicot.org)

     *References*
     [1] Ljung, L. (1999) 'System Identification: Theory for the User:
     Second Edition'.  Prentice Hall, New Jersey, USA.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Estimate ARX model using QR factorization.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
augstate


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 264
 -- Function File: AUGSYS = augstate (SYS)
     Append state vector x of system SYS to output vector y.

          .                  .
          x = A x + B u      x = A x + B u
          y = C x + D u  =>  y = C x + D u
                             x = I x + O u


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Append state vector x of system SYS to output vector y.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
augw


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2976
 -- Function File: P = augw (G, W1, W2, W3)
     Extend plant for stacked S/KS/T problem.  Subsequently, the robust
     control problem can be solved by h2syn or hinfsyn.

     *Inputs*
     G
          LTI model of plant.
     W1
          LTI model of performance weight.  Bounds the largest singular
          values of sensitivity S.  Model must be empty '[]', SISO or of
          appropriate size.
     W2
          LTI model to penalize large control inputs.  Bounds the
          largest singular values of KS.  Model must be empty '[]', SISO
          or of appropriate size.
     W3
          LTI model of robustness and noise sensitivity weight.  Bounds
          the largest singular values of complementary sensitivity T.
          Model must be empty '[]', SISO or of appropriate size.

     All inputs must be proper/realizable.  Scalars, vectors and
     matrices are possible instead of LTI models.

     *Outputs*
     P
          State-space model of augmented plant.

     *Block Diagram*

              | W1 | -W1*G |     z1 = W1 r  -  W1 G u
              | 0  |  W2   |     z2 =          W2   u
          P = | 0  |  W3*G |     z3 =          W3 G u
              |----+-------|
              | I  |    -G |     e  =    r  -     G u
                                                                +------+  z1
                      +---------------------------------------->|  W1  |----->
                      |                                         +------+
                      |                                         +------+  z2
                      |                 +---------------------->|  W2  |----->
                      |                 |                       +------+
           r   +    e |   +--------+  u |   +--------+  y       +------+  z3
          ----->(+)---+-->|  K(s)  |----+-->|  G(s)  |----+---->|  W3  |----->
                 ^ -      +--------+        +--------+    |     +------+
                 |                                        |
                 +----------------------------------------+
                         +--------+
                         |        |-----> z1 (p1x1)          z1 = W1 e
           r (px1) ----->|  P(s)  |-----> z2 (p2x1)          z2 = W2 u
                         |        |-----> z3 (p3x1)          z3 = W3 y
           u (mx1) ----->|        |-----> e (px1)            e = r - y
                         +--------+
                         +--------+
                 r ----->|        |-----> z
                         |  P(s)  |
                 u +---->|        |-----+ e
                   |     +--------+     |
                   |                    |
                   |     +--------+     |
                   +-----|  K(s)  |<----+
                         +--------+

     *References*
     [1] Skogestad, S. and Postlethwaite I. (2005) 'Multivariable
     Feedback Control: Analysis and Design: Second Edition'.  Wiley.

     See also: h2syn, hinfsyn, mixsyn.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Extend plant for stacked S/KS/T problem.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
bode


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1236
 -- Function File: bode (SYS)
 -- Function File: bode (SYS1, SYS2, ..., SYSN)
 -- Function File: bode (SYS1, SYS2, ..., SYSN, W)
 -- Function File: bode (SYS1, 'STYLE1', ..., SYSN, 'STYLEN')
 -- Function File: [MAG, PHA, W] = bode (SYS)
 -- Function File: [MAG, PHA, W] = bode (SYS, W)
     Bode diagram of frequency response.  If no output arguments are
     given, the response is printed on the screen.

     *Inputs*
     SYS
          LTI system.  Must be a single-input and single-output (SISO)
          system.
     W
          Optional vector of frequency values.  If W is not specified,
          it is calculated by the zeros and poles of the system.
          Alternatively, the cell '{wmin, wmax}' specifies a frequency
          range, where WMIN and WMAX denote minimum and maximum
          frequencies in rad/s.
     'STYLE'
          Line style and color, e.g.  'r' for a solid red line or '-.k'
          for a dash-dotted black line.  See 'help plot' for details.

     *Outputs*
     MAG
          Vector of magnitude.  Has length of frequency vector W.
     PHA
          Vector of phase.  Has length of frequency vector W.
     W
          Vector of frequency values used.

     See also: nichols, nyquist, sigma.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Bode diagram of frequency response.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
bodemag


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1189
 -- Function File: bodemag (SYS)
 -- Function File: bodemag (SYS1, SYS2, ..., SYSN)
 -- Function File: bodemag (SYS1, SYS2, ..., SYSN, W)
 -- Function File: bodemag (SYS1, 'STYLE1', ..., SYSN, 'STYLEN')
 -- Function File: [MAG, W] = bodemag (SYS)
 -- Function File: [MAG, W] = bodemag (SYS, W)
     Bode magnitude diagram of frequency response.  If no output
     arguments are given, the response is printed on the screen.

     *Inputs*
     SYS
          LTI system.  Must be a single-input and single-output (SISO)
          system.
     W
          Optional vector of frequency values.  If W is not specified,
          it is calculated by the zeros and poles of the system.
          Alternatively, the cell '{wmin, wmax}' specifies a frequency
          range, where WMIN and WMAX denote minimum and maximum
          frequencies in rad/s.
     'STYLE'
          Line style and color, e.g.  'r' for a solid red line or '-.k'
          for a dash-dotted black line.  See 'help plot' for details.

     *Outputs*
     MAG
          Vector of magnitude.  Has length of frequency vector W.
     W
          Vector of frequency values used.

     See also: bode, nichols, nyquist, sigma.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Bode magnitude diagram of frequency response.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
bstmodred


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6085
 -- Function File: [GR, INFO] = bstmodred (G, ...)
 -- Function File: [GR, INFO] = bstmodred (G, NR, ...)
 -- Function File: [GR, INFO] = bstmodred (G, OPT, ...)
 -- Function File: [GR, INFO] = bstmodred (G, NR, OPT, ...)

     Model order reduction by Balanced Stochastic Truncation (BST)
     method.  The aim of model reduction is to find an LTI system GR of
     order NR (nr < n) such that the input-output behaviour of GR
     approximates the one from original system G.

     BST is a relative error method which tries to minimize
             -1
          ||G  (G-Gr)||    = min
                       inf

     *Inputs*
     G
          LTI model to be reduced.
     NR
          The desired order of the resulting reduced order system GR.
          If not specified, NR is chosen automatically according to the
          description of key 'ORDER'.
     ...
          Optional pairs of keys and values.  '"key1", value1, "key2",
          value2'.
     OPT
          Optional struct with keys as field names.  Struct OPT can be
          created directly or by function 'options'.  'opt.key1 =
          value1, opt.key2 = value2'.

     *Outputs*
     GR
          Reduced order state-space model.
     INFO
          Struct containing additional information.
          INFO.N
               The order of the original system G.
          INFO.NS
               The order of the ALPHA-stable subsystem of the original
               system G.
          INFO.HSV
               The Hankel singular values of the phase system
               corresponding to the ALPHA-stable part of the original
               system G.  The NS Hankel singular values are ordered
               decreasingly.
          INFO.NU
               The order of the ALPHA-unstable subsystem of both the
               original system G and the reduced-order system GR.
          INFO.NR
               The order of the obtained reduced order system GR.

     *Option Keys and Values*
     'ORDER', 'NR'
          The desired order of the resulting reduced order system GR.
          If not specified, NR is the sum of NU and the number of Hankel
          singular values greater than 'MAX(TOL1,NS*EPS)'; NR can be
          further reduced to ensure that 'HSV(NR-NU) > HSV(NR+1-NU)'.

     'METHOD'
          Approximation method for the H-infinity norm.  Valid values
          corresponding to this key are:
          'SR-BTA', 'B'
               Use the square-root Balance & Truncate method.
          'BFSR-BTA', 'F'
               Use the balancing-free square-root Balance & Truncate
               method.  Default method.
          'SR-SPA', 'S'
               Use the square-root Singular Perturbation Approximation
               method.
          'BFSR-SPA', 'P'
               Use the balancing-free square-root Singular Perturbation
               Approximation method.

     'ALPHA'
          Specifies the ALPHA-stability boundary for the eigenvalues of
          the state dynamics matrix G.A.  For a continuous-time system,
          ALPHA <= 0 is the boundary value for the real parts of
          eigenvalues, while for a discrete-time system, 0 <= ALPHA <= 1
          represents the boundary value for the moduli of eigenvalues.
          The ALPHA-stability domain does not include the boundary.
          Default value is 0 for continuous-time systems and 1 for
          discrete-time systems.

     'BETA'
          Use '[G, beta*I]' as new system G to combine absolute and
          relative error methods.  BETA > 0 specifies the
          absolute/relative error weighting parameter.  A large positive
          value of BETA favours the minimization of the absolute
          approximation error, while a small value of BETA is
          appropriate for the minimization of the relative error.  BETA
          = 0 means a pure relative error method and can be used only if
          rank(G.D) = rows(G.D) which means that the feedthrough matrice
          must not be rank-deficient.  Default value is 0.

     'TOL1'
          If 'ORDER' is not specified, TOL1 contains the tolerance for
          determining the order of reduced system.  For model reduction,
          the recommended value of TOL1 lies in the interval [0.00001,
          0.001].  TOL1 < 1.  If TOL1 <= 0 on entry, the used default
          value is TOL1 = NS*EPS, where NS is the number of ALPHA-stable
          eigenvalues of A and EPS is the machine precision.  If 'ORDER'
          is specified, the value of TOL1 is ignored.

     'TOL2'
          The tolerance for determining the order of a minimal
          realization of the phase system (see METHOD) corresponding to
          the ALPHA-stable part of the given system.  The recommended
          value is TOL2 = NS*EPS. TOL2 <= TOL1 < 1.  This value is used
          by default if 'TOL2' is not specified or if TOL2 <= 0 on
          entry.

     'EQUIL', 'SCALE'
          Boolean indicating whether equilibration (scaling) should be
          performed on system G prior to order reduction.  Default value
          is true if 'G.scaled == false' and false if 'G.scaled ==
          true'.  Note that for MIMO models, proper scaling of both
          inputs and outputs is of utmost importance.  The input and
          output scaling can *not* be done by the equilibration option
          or the 'prescale' function because these functions perform
          state transformations only.  Furthermore, signals should not
          be scaled simply to a certain range.  For all inputs (or
          outputs), a certain change should be of the same importance
          for the model.

     BST is often suitable to perform model reduction in order to obtain
     low order design models for controller synthesis.

     Approximation Properties:
        * Guaranteed stability of reduced models
        * Approximates simultaneously gain and phase
        * Preserves non-minimum phase zeros
        * Guaranteed a priori error bound

     *Algorithm*
     Uses SLICOT AB09HD by courtesy of NICONET e.V.
     (http://www.slicot.org)


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
Model order reduction by Balanced Stochastic Truncation (BST) method.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
btaconred


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6194
 -- Function File: [KR, INFO] = btaconred (G, K, ...)
 -- Function File: [KR, INFO] = btaconred (G, K, NCR, ...)
 -- Function File: [KR, INFO] = btaconred (G, K, OPT, ...)
 -- Function File: [KR, INFO] = btaconred (G, K, NCR, OPT, ...)

     Controller reduction by frequency-weighted Balanced Truncation
     Approximation (BTA). Given a plant G and a stabilizing controller
     K, determine a reduced order controller KR such that the
     closed-loop system is stable and closed-loop performance is
     retained.

     The algorithm tries to minimize the frequency-weighted error
          ||V (K-Kr) W||    = min
                        inf
     where V and W denote output and input weightings.

     *Inputs*
     G
          LTI model of the plant.  It has m inputs, p outputs and n
          states.
     K
          LTI model of the controller.  It has p inputs, m outputs and
          nc states.
     NCR
          The desired order of the resulting reduced order controller
          KR.  If not specified, NCR is chosen automatically according
          to the description of key 'ORDER'.
     ...
          Optional pairs of keys and values.  '"key1", value1, "key2",
          value2'.
     OPT
          Optional struct with keys as field names.  Struct OPT can be
          created directly or by function 'options'.  'opt.key1 =
          value1, opt.key2 = value2'.

     *Outputs*
     KR
          State-space model of reduced order controller.
     INFO
          Struct containing additional information.
          INFO.NCR
               The order of the obtained reduced order controller KR.
          INFO.NCS
               The order of the alpha-stable part of original controller
               K.
          INFO.HSVC
               The Hankel singular values of the alpha-stable part of K.
               The NCS Hankel singular values are ordered decreasingly.

     *Option Keys and Values*
     'ORDER', 'NCR'
          The desired order of the resulting reduced order controller
          KR.  If not specified, NCR is chosen automatically such that
          states with Hankel singular values INFO.HSVC > TOL1 are
          retained.

     'METHOD'
          Order reduction approach to be used as follows:
          'SR', 'B'
               Use the square-root Balance & Truncate method.
          'BFSR', 'F'
               Use the balancing-free square-root Balance & Truncate
               method.  Default method.

     'WEIGHT'
          Specifies the type of frequency-weighting as follows:
          'NONE'
               No weightings are used (V = I, W = I).

          'LEFT', 'OUTPUT'
               Use stability enforcing left (output) weighting
                              -1
                    V = (I-G*K) *G ,  W = I

          'RIGHT', 'INPUT'
               Use stability enforcing right (input) weighting
                                       -1
                    V = I ,  W = (I-G*K) *G

          'BOTH', 'PERFORMANCE'
               Use stability and performance enforcing weightings
                              -1                -1
                    V = (I-G*K) *G ,  W = (I-G*K)
               Default value.

     'FEEDBACK'
          Specifies whether K is a positive or negative feedback
          controller:
          '+'
               Use positive feedback controller.  Default value.
          '-'
               Use negative feedback controller.

     'ALPHA'
          Specifies the ALPHA-stability boundary for the eigenvalues of
          the state dynamics matrix K.A.  For a continuous-time
          controller, ALPHA <= 0 is the boundary value for the real
          parts of eigenvalues, while for a discrete-time controller, 0
          <= ALPHA <= 1 represents the boundary value for the moduli of
          eigenvalues.  The ALPHA-stability domain does not include the
          boundary.  Default value is 0 for continuous-time controllers
          and 1 for discrete-time controllers.

     'TOL1'
          If 'ORDER' is not specified, TOL1 contains the tolerance for
          determining the order of the reduced controller.  For model
          reduction, the recommended value of TOL1 is c*info.hsvc(1),
          where c lies in the interval [0.00001, 0.001].  Default value
          is info.ncs*eps*info.hsvc(1).  If 'ORDER' is specified, the
          value of TOL1 is ignored.

     'TOL2'
          The tolerance for determining the order of a minimal
          realization of the ALPHA-stable part of the given controller.
          TOL2 <= TOL1.  If not specified, ncs*eps*info.hsvc(1) is
          chosen.

     'GRAM-CTRB'
          Specifies the choice of frequency-weighted controllability
          Grammian as follows:
          'STANDARD'
               Choice corresponding to standard Enns' method [1].
               Default method.
          'ENHANCED'
               Choice corresponding to the stability enhanced modified
               Enns' method of [2].

     'GRAM-OBSV'
          Specifies the choice of frequency-weighted observability
          Grammian as follows:
          'STANDARD'
               Choice corresponding to standard Enns' method [1].
               Default method.
          'ENHANCED'
               Choice corresponding to the stability enhanced modified
               Enns' method of [2].

     'EQUIL', 'SCALE'
          Boolean indicating whether equilibration (scaling) should be
          performed on G and K prior to order reduction.  Default value
          is false if both 'G.scaled == true, K.scaled == true' and true
          otherwise.  Note that for MIMO models, proper scaling of both
          inputs and outputs is of utmost importance.  The input and
          output scaling can *not* be done by the equilibration option
          or the 'prescale' function because these functions perform
          state transformations only.  Furthermore, signals should not
          be scaled simply to a certain range.  For all inputs (or
          outputs), a certain change should be of the same importance
          for the model.

     *Algorithm*
     Uses SLICOT SB16AD by courtesy of NICONET e.V.
     (http://www.slicot.org)


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Controller reduction by frequency-weighted Balanced Truncation
Approximation ...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
btamodred


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7354
 -- Function File: [GR, INFO] = btamodred (G, ...)
 -- Function File: [GR, INFO] = btamodred (G, NR, ...)
 -- Function File: [GR, INFO] = btamodred (G, OPT, ...)
 -- Function File: [GR, INFO] = btamodred (G, NR, OPT, ...)

     Model order reduction by frequency weighted Balanced Truncation
     Approximation (BTA) method.  The aim of model reduction is to find
     an LTI system GR of order NR (nr < n) such that the input-output
     behaviour of GR approximates the one from original system G.

     BTA is an absolute error method which tries to minimize
          ||G-Gr||    = min
                  inf

          ||V (G-Gr) W||    = min
                        inf
     where V and W denote output and input weightings.

     *Inputs*
     G
          LTI model to be reduced.
     NR
          The desired order of the resulting reduced order system GR.
          If not specified, NR is chosen automatically according to the
          description of key 'ORDER'.
     ...
          Optional pairs of keys and values.  '"key1", value1, "key2",
          value2'.
     OPT
          Optional struct with keys as field names.  Struct OPT can be
          created directly or by function 'options'.  'opt.key1 =
          value1, opt.key2 = value2'.

     *Outputs*
     GR
          Reduced order state-space model.
     INFO
          Struct containing additional information.
          INFO.N
               The order of the original system G.
          INFO.NS
               The order of the ALPHA-stable subsystem of the original
               system G.
          INFO.HSV
               The Hankel singular values of the ALPHA-stable part of
               the original system G, ordered decreasingly.
          INFO.NU
               The order of the ALPHA-unstable subsystem of both the
               original system G and the reduced-order system GR.
          INFO.NR
               The order of the obtained reduced order system GR.

     *Option Keys and Values*
     'ORDER', 'NR'
          The desired order of the resulting reduced order system GR.
          If not specified, NR is chosen automatically such that states
          with Hankel singular values INFO.HSV > TOL1 are retained.

     'LEFT', 'OUTPUT'
          LTI model of the left/output frequency weighting V.  Default
          value is an identity matrix.

     'RIGHT', 'INPUT'
          LTI model of the right/input frequency weighting W.  Default
          value is an identity matrix.

     'METHOD'
          Approximation method for the L-infinity norm to be used as
          follows:
          'SR', 'B'
               Use the square-root Balance & Truncate method.
          'BFSR', 'F'
               Use the balancing-free square-root Balance & Truncate
               method.  Default method.

     'ALPHA'
          Specifies the ALPHA-stability boundary for the eigenvalues of
          the state dynamics matrix G.A.  For a continuous-time system,
          ALPHA <= 0 is the boundary value for the real parts of
          eigenvalues, while for a discrete-time system, 0 <= ALPHA <= 1
          represents the boundary value for the moduli of eigenvalues.
          The ALPHA-stability domain does not include the boundary.
          Default value is 0 for continuous-time systems and 1 for
          discrete-time systems.

     'TOL1'
          If 'ORDER' is not specified, TOL1 contains the tolerance for
          determining the order of the reduced model.  For model
          reduction, the recommended value of TOL1 is c*info.hsv(1),
          where c lies in the interval [0.00001, 0.001].  Default value
          is info.ns*eps*info.hsv(1).  If 'ORDER' is specified, the
          value of TOL1 is ignored.

     'TOL2'
          The tolerance for determining the order of a minimal
          realization of the ALPHA-stable part of the given model.  TOL2
          <= TOL1.  If not specified, ns*eps*info.hsv(1) is chosen.

     'GRAM-CTRB'
          Specifies the choice of frequency-weighted controllability
          Grammian as follows:
          'STANDARD'
               Choice corresponding to a combination method [4] of the
               approaches of Enns [1] and Lin-Chiu [2,3].  Default
               method.
          'ENHANCED'
               Choice corresponding to the stability enhanced modified
               combination method of [4].

     'GRAM-OBSV'
          Specifies the choice of frequency-weighted observability
          Grammian as follows:
          'STANDARD'
               Choice corresponding to a combination method [4] of the
               approaches of Enns [1] and Lin-Chiu [2,3].  Default
               method.
          'ENHANCED'
               Choice corresponding to the stability enhanced modified
               combination method of [4].

     'ALPHA-CTRB'
          Combination method parameter for defining the
          frequency-weighted controllability Grammian.  abs(alphac) <=
          1.  If alphac = 0, the choice of Grammian corresponds to the
          method of Enns [1], while if alphac = 1, the choice of
          Grammian corresponds to the method of Lin and Chiu [2,3].
          Default value is 0.

     'ALPHA-OBSV'
          Combination method parameter for defining the
          frequency-weighted observability Grammian.  abs(alphao) <= 1.
          If alphao = 0, the choice of Grammian corresponds to the
          method of Enns [1], while if alphao = 1, the choice of
          Grammian corresponds to the method of Lin and Chiu [2,3].
          Default value is 0.

     'EQUIL', 'SCALE'
          Boolean indicating whether equilibration (scaling) should be
          performed on system G prior to order reduction.  This is done
          by state transformations.  Default value is true if 'G.scaled
          == false' and false if 'G.scaled == true'.  Note that for MIMO
          models, proper scaling of both inputs and outputs is of utmost
          importance.  The input and output scaling can *not* be done by
          the equilibration option or the 'prescale' function because
          these functions perform state transformations only.
          Furthermore, signals should not be scaled simply to a certain
          range.  For all inputs (or outputs), a certain change should
          be of the same importance for the model.

     Approximation Properties:
        * Guaranteed stability of reduced models
        * Lower guaranteed error bound
        * Guaranteed a priori error bound

     *References*
     [1] Enns, D. 'Model reduction with balanced realizations: An error
     bound and a frequency weighted generalization'.  Proc.  23-th CDC,
     Las Vegas, pp.  127-132, 1984.

     [2] Lin, C.-A. and Chiu, T.-Y. 'Model reduction via
     frequency-weighted balanced realization'.  Control Theory and
     Advanced Technology, vol.  8, pp.  341-351, 1992.

     [3] Sreeram, V., Anderson, B.D.O and Madievski, A.G. 'New results
     on frequency weighted balanced reduction technique'.  Proc.  ACC,
     Seattle, Washington, pp.  4004-4009, 1995.

     [4] Varga, A. and Anderson, B.D.O. 'Square-root balancing-free
     methods for the frequency-weighted balancing related model
     reduction'.  (report in preparation)

     *Algorithm*
     Uses SLICOT AB09ID by courtesy of NICONET e.V.
     (http://www.slicot.org)


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Model order reduction by frequency weighted Balanced Truncation
Approximation...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
care


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1626
 -- Function File: [X, L, G] = care (A, B, Q, R)
 -- Function File: [X, L, G] = care (A, B, Q, R, S)
 -- Function File: [X, L, G] = care (A, B, Q, R, [], E)
 -- Function File: [X, L, G] = care (A, B, Q, R, S, E)
     Solve continuous-time algebraic Riccati equation (ARE).

     *Inputs*
     A
          Real matrix (n-by-n).
     B
          Real matrix (n-by-m).
     Q
          Real matrix (n-by-n).
     R
          Real matrix (m-by-m).
     S
          Optional real matrix (n-by-m).  If S is not specified, a zero
          matrix is assumed.
     E
          Optional descriptor matrix (n-by-n).  If E is not specified,
          an identity matrix is assumed.

     *Outputs*
     X
          Unique stabilizing solution of the continuous-time Riccati
          equation (n-by-n).
     L
          Closed-loop poles (n-by-1).
     G
          Corresponding gain matrix (m-by-n).

     *Equations*
                         -1
          A'X + XA - XB R  B'X + Q = 0

                               -1
          A'X + XA - (XB + S) R  (B'X + S') + Q = 0

               -1
          G = R  B'X

               -1
          G = R  (B'X + S')

          L = eig (A - B*G)
                              -1
          A'XE + E'XA - E'XB R   B'XE + Q = 0

                                    -1
          A'XE + E'XA - (E'XB + S) R   (B'XE + S') + Q = 0

               -1
          G = R  B'XE

               -1
          G = R  (B'XE + S)

          L = eig (A - B*G, E)

     *Algorithm*
     Uses SLICOT SB02OD and SG02AD by courtesy of NICONET e.V.
     (http://www.slicot.org)

     See also: dare, lqr, dlqr, kalman.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Solve continuous-time algebraic Riccati equation (ARE).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
cfconred


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4360
 -- Function File: [KR, INFO] = cfconred (G, F, L, ...)
 -- Function File: [KR, INFO] = cfconred (G, F, L, NCR, ...)
 -- Function File: [KR, INFO] = cfconred (G, F, L, OPT, ...)
 -- Function File: [KR, INFO] = cfconred (G, F, L, NCR, OPT, ...)

     Reduction of state-feedback-observer based controller by coprime
     factorization (CF). Given a plant G, state feedback gain F and full
     observer gain L, determine a reduced order controller KR.

     *Inputs*
     G
          LTI model of the open-loop plant (A,B,C,D). It has m inputs, p
          outputs and n states.
     F
          Stabilizing state feedback matrix (m-by-n).
     L
          Stabilizing observer gain matrix (n-by-p).
     NCR
          The desired order of the resulting reduced order controller
          KR.  If not specified, NCR is chosen automatically according
          to the description of key 'ORDER'.
     ...
          Optional pairs of keys and values.  '"key1", value1, "key2",
          value2'.
     OPT
          Optional struct with keys as field names.  Struct OPT can be
          created directly or by function 'options'.  'opt.key1 =
          value1, opt.key2 = value2'.

     *Outputs*
     KR
          State-space model of reduced order controller.
     INFO
          Struct containing additional information.
          INFO.HSV
               The Hankel singular values of the extended system?!?.
               The N Hankel singular values are ordered decreasingly.
          INFO.NCR
               The order of the obtained reduced order controller KR.

     *Option Keys and Values*
     'ORDER', 'NCR'
          The desired order of the resulting reduced order controller
          KR.  If not specified, NCR is chosen automatically such that
          states with Hankel singular values INFO.HSV > TOL1 are
          retained.

     'METHOD'
          Order reduction approach to be used as follows:
          'SR-BTA', 'B'
               Use the square-root Balance & Truncate method.
          'BFSR-BTA', 'F'
               Use the balancing-free square-root Balance & Truncate
               method.  Default method.
          'SR-SPA', 'S'
               Use the square-root Singular Perturbation Approximation
               method.
          'BFSR-SPA', 'P'
               Use the balancing-free square-root Singular Perturbation
               Approximation method.

     'CF'
          Specifies whether left or right coprime factorization is to be
          used as follows:
          'LEFT', 'L'
               Use left coprime factorization.  Default method.
          'RIGHT', 'R'
               Use right coprime factorization.

     'FEEDBACK'
          Specifies whether F and L are fed back positively or
          negatively:
          '+'
               A+BK and A+LC are both Hurwitz matrices.
          '-'
               A-BK and A-LC are both Hurwitz matrices.  Default value.

     'TOL1'
          If 'ORDER' is not specified, TOL1 contains the tolerance for
          determining the order of the reduced system.  For model
          reduction, the recommended value of TOL1 is c*info.hsv(1),
          where c lies in the interval [0.00001, 0.001].  Default value
          is n*eps*info.hsv(1).  If 'ORDER' is specified, the value of
          TOL1 is ignored.

     'TOL2'
          The tolerance for determining the order of a minimal
          realization of the coprime factorization controller.  TOL2 <=
          TOL1.  If not specified, n*eps*info.hsv(1) is chosen.

     'EQUIL', 'SCALE'
          Boolean indicating whether equilibration (scaling) should be
          performed on system G prior to order reduction.  Default value
          is true if 'G.scaled == false' and false if 'G.scaled ==
          true'.  Note that for MIMO models, proper scaling of both
          inputs and outputs is of utmost importance.  The input and
          output scaling can *not* be done by the equilibration option
          or the 'prescale' function because these functions perform
          state transformations only.  Furthermore, signals should not
          be scaled simply to a certain range.  For all inputs (or
          outputs), a certain change should be of the same importance
          for the model.

     *Algorithm*
     Uses SLICOT SB16BD by courtesy of NICONET e.V.
     (http://www.slicot.org)


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Reduction of state-feedback-observer based controller by coprime
factorizatio...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
covar


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 319
 -- Function File: [P, Q] = covar (SYS, W)
     Return the steady-state covariance.

     *Inputs*
     SYS
          LTI model.
     W
          Intensity of Gaussian white noise inputs which drive SYS.

     *Outputs*
     P
          Output covariance.
     Q
          State covariance.

     See also: lyap, dlyap.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Return the steady-state covariance.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
ctrb


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 379
 -- Function File: CO = ctrb (SYS)
 -- Function File: CO = ctrb (A, B)
     Return controllability matrix.

     *Inputs*
     SYS
          LTI model.
     A
          State matrix (n-by-n).
     B
          Input matrix (n-by-m).

     *Outputs*
     CO
          Controllability matrix.

     *Equation*
                       2       n-1
          Co = [ B AB A B ... A   B ]


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Return controllability matrix.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
ctrbf


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 958
 -- Function File: [SYSBAR, T, K] = ctrbf (SYS)
 -- Function File: [SYSBAR, T, K] = ctrbf (SYS, TOL)
 -- Function File: [ABAR, BBAR, CBAR, T, K] = ctrbf (A, B, C)
 -- Function File: [ABAR, BBAR, CBAR, T, K] = ctrbf (A, B, C, TOL)
     If Co=ctrb(A,B) has rank r <= n = SIZE(A,1), then there is a
     similarity transformation Tc such that Tc = [t1 t2] where t1 is the
     controllable subspace and t2 is orthogonal to t1

          Abar = Tc \\ A * Tc ,  Bbar = Tc \\ B ,  Cbar = C * Tc

     and the transformed system has the form

                 | Ac    A12|           | Bc |
          Abar = |----------|,   Bbar = | ---|,  Cbar = [Cc | Cnc].
                 | 0     Anc|           |  0 |

     where (Ac,Bc) is controllable, and Cc(sI-Ac)^(-1)Bc =
     C(sI-A)^(-1)B. and the system is stabilizable if Anc has no
     eigenvalues in the right half plane.  The last output K is a vector
     of length n containing the number of controllable states.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
If Co=ctrb(A,B) has rank r <= n = SIZE(A,1), then there is a similarity
trans...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
damp


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1809
 -- Function File: damp(SYS)
 -- Function File: [WN, ZETA] = damp(SYS)
 -- Function File: [WN, ZETA, P] = damp(SYS)
     Calculate natural frequencies, damping ratios and poles.

     If no output is specified, display overview table containing poles,
     magnitude (if SYS is a discrete-time model), damping ratios,
     natural frequencies and time constants.

     *Inputs*
     SYS
          LTI model.

     *Outputs*
     WN
          Natural frequencies of each pole of SYS (in increasing order).
          The frequency unit is rad/s (radians per second).  If SYS is a
          discrete-time model with specified sample time, WN contains
          the natural frequencies of the equivalent continuous-time
          poles (see Algorithms).  If SYS has an unspecified sample time
          (TSAM = -1), TSAM = 1 is used to calculate WN.
     ZETA
          Damping ratios of each pole of SYS (in the same order as WN).
          If SYS is a discrete-time model with specified sample time,
          ZETA contains the damping ratios of the equivalent
          continuous-time poles (see Algorithms).  If SYS has an
          unspecified sample time (TSAM = -1), TSAM = 1 is used to
          calculate ZETA.
     P
          Poles of SYS (in the same order as WN).

     *Algorithm*
     POLE
          Poles s (or z for discrete-time models) are calculated via
          'pole' and resorted in order of increasing natural frequency.
     EQUIVALENT CONTINUOUS-TIME POLE
          s = log (z) / sys.tsam (discrete-time models only)
     MAGNITUDE
          mag = abs (z) (discrete-time models only)
     NATURAL FREQUENCY
          Wn = abs (s)
     DAMPING RATIO
          zeta = -cos (arg (s))
     TIME CONSTANT
          tau = 1 / (Wn * zeta)

     See also: dsort, eig, esort, pole, pzmap, zero.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
Calculate natural frequencies, damping ratios and poles.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
dare


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1785
 -- Function File: [X, L, G] = dare (A, B, Q, R)
 -- Function File: [X, L, G] = dare (A, B, Q, R, S)
 -- Function File: [X, L, G] = dare (A, B, Q, R, [], E)
 -- Function File: [X, L, G] = dare (A, B, Q, R, S, E)
     Solve discrete-time algebraic Riccati equation (ARE).

     *Inputs*
     A
          Real matrix (n-by-n).
     B
          Real matrix (n-by-m).
     Q
          Real matrix (n-by-n).
     R
          Real matrix (m-by-m).
     S
          Optional real matrix (n-by-m).  If S is not specified, a zero
          matrix is assumed.
     E
          Optional descriptor matrix (n-by-n).  If E is not specified,
          an identity matrix is assumed.

     *Outputs*
     X
          Unique stabilizing solution of the discrete-time Riccati
          equation (n-by-n).
     L
          Closed-loop poles (n-by-1).
     G
          Corresponding gain matrix (m-by-n).

     *Equations*
                                    -1
          A'XA - X - A'XB (B'XB + R)   B'XA + Q = 0

                                          -1
          A'XA - X - (A'XB + S) (B'XB + R)   (B'XA + S') + Q = 0

                        -1
          G = (B'XB + R)   B'XA

                        -1
          G = (B'XB + R)   (B'XA + S')

          L = eig (A - B*G)
                                       -1
          A'XA - E'XE - A'XB (B'XB + R)   B'XA + Q = 0

                                             -1
          A'XA - E'XE - (A'XB + S) (B'XB + R)   (B'XA + S') + Q = 0

                        -1
          G = (B'XB + R)   B'XA

                        -1
          G = (B'XB + R)   (B'XA + S')

          L = eig (A - B*G, E)

     *Algorithm*
     Uses SLICOT SB02OD and SG02AD by courtesy of NICONET e.V.
     (http://www.slicot.org)

     See also: care, lqr, dlqr, kalman.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Solve discrete-time algebraic Riccati equation (ARE).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
db2mag


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 275
 -- Function File: MAG = db2mag (DB)
     Convert Decibels (dB) to Magnitude.

     *Inputs*
     DB
          Decibel (dB) value(s).  Both real-valued scalars and matrices
          are accepted.

     *Outputs*
     MAG
          Magnitude value(s).

     See also: mag2db.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Convert Decibels (dB) to Magnitude.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
dlqe


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1696
 -- Function File: [M, P, Z, E] = dlqe (A, G, C, Q, R)
 -- Function File: [M, P, Z, E] = dlqe (A, G, C, Q, R, S)
 -- Function File: [M, P, Z, E] = dlqe (A, [], C, Q, R)
 -- Function File: [M, P, Z, E] = dlqe (A, [], C, Q, R, S)
     Kalman filter for discrete-time systems.

          x[k] = Ax[k] + Bu[k] + Gw[k]   (State equation)
          y[k] = Cx[k] + Du[k] + v[k]    (Measurement Equation)
          E(w) = 0, E(v) = 0, cov(w) = Q, cov(v) = R, cov(w,v) = S

     *Inputs*
     A
          State transition matrix of discrete-time system (n-by-n).
     G
          Process noise matrix of discrete-time system (n-by-g).  If G
          is empty '[]', an identity matrix is assumed.
     C
          Measurement matrix of discrete-time system (p-by-n).
     Q
          Process noise covariance matrix (g-by-g).
     R
          Measurement noise covariance matrix (p-by-p).
     S
          Optional cross term covariance matrix (g-by-p), s = cov(w,v).
          If S is empty '[]' or not specified, a zero matrix is assumed.

     *Outputs*
     M
          Kalman filter gain matrix (n-by-p).
     P
          Unique stabilizing solution of the discrete-time Riccati
          equation (n-by-n).  Symmetric matrix.
     Z
          Error covariance (n-by-n), cov(x(k|k)-x)
     E
          Closed-loop poles (n-by-1).

     *Equations*
          x[k|k] = x[k|k-1] + M(y[k] - Cx[k|k-1] - Du[k])

          x[k+1|k] = Ax[k|k] + Bu[k] for S=0

          x[k+1|k] = Ax[k|k] + Bu[k] + G*S*(C*P*C' + R)^-1*(y[k] - C*x[k|k-1]) for non-zero S


          E = eig(A - A*M*C) for S=0

          E = eig(A - A*M*C - G*S*(C*P*C' + Rv)^-1*C) for non-zero S


     See also: dare, care, dlqr, lqr, lqe.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Kalman filter for discrete-time systems.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
dlqr


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1374
 -- Function File: [G, X, L] = dlqr (SYS, Q, R)
 -- Function File: [G, X, L] = dlqr (SYS, Q, R, S)
 -- Function File: [G, X, L] = dlqr (A, B, Q, R)
 -- Function File: [G, X, L] = dlqr (A, B, Q, R, S)
 -- Function File: [G, X, L] = dlqr (A, B, Q, R, [], E)
 -- Function File: [G, X, L] = dlqr (A, B, Q, R, S, E)
     Linear-quadratic regulator for discrete-time systems.

     *Inputs*
     SYS
          Continuous or discrete-time LTI model (p-by-m, n states).
     A
          State transition matrix of discrete-time system (n-by-n).
     B
          Input matrix of discrete-time system (n-by-m).
     Q
          State weighting matrix (n-by-n).
     R
          Input weighting matrix (m-by-m).
     S
          Optional cross term matrix (n-by-m).  If S is not specified, a
          zero matrix is assumed.
     E
          Optional descriptor matrix (n-by-n).  If E is not specified,
          an identity matrix is assumed.

     *Outputs*
     G
          State feedback matrix (m-by-n).
     X
          Unique stabilizing solution of the discrete-time Riccati
          equation (n-by-n).
     L
          Closed-loop poles (n-by-1).

     *Equations*
          x[k+1] = A x[k] + B u[k],   x[0] = x0

                  inf
          J(x0) = SUM (x' Q x  +  u' R u  +  2 x' S u)
                  k=0

          L = eig (A - B*G)

     See also: dare, care, lqr.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Linear-quadratic regulator for discrete-time systems.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
dlyap


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 525
 -- Function File: X = dlyap (A, B)
 -- Function File: X = dlyap (A, B, C)
 -- Function File: X = dlyap (A, B, [], E)
     Solve discrete-time Lyapunov or Sylvester equations.

     *Equations*
          AXA' - X + B = 0      (Lyapunov Equation)

          AXB' - X + C = 0      (Sylvester Equation)

          AXA' - EXE' + B = 0   (Generalized Lyapunov Equation)

     *Algorithm*
     Uses SLICOT SB03MD, SB04QD and SG03AD by courtesy of NICONET e.V.
     (http://www.slicot.org)

     See also: dlyapchol, lyap, lyapchol.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Solve discrete-time Lyapunov or Sylvester equations.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
dlyapchol


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 476
 -- Function File: U = dlyapchol (A, B)
 -- Function File: U = dlyapchol (A, B, E)
     Compute Cholesky factor of discrete-time Lyapunov equations.

     *Equations*
          A U' U A'  -  U' U  +  B B'  =  0           (Lyapunov Equation)

          A U' U A'  -  E U' U E'  +  B B'  =  0      (Generalized Lyapunov Equation)

     *Algorithm*
     Uses SLICOT SB03OD and SG03BD by courtesy of NICONET e.V.
     (http://www.slicot.org)

     See also: dlyap, lyap, lyapchol.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
Compute Cholesky factor of discrete-time Lyapunov equations.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
dsort


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 392
 -- Function File: S = dsort(P)
 -- Function File: [S, NDX] = dsort(P)
     Sort discrete-time poles by magnitude (in decreasing order).

     *Inputs*
     P
          Input vector containing discrete-time poles.

     *Outputs*
     S
          Vector with sorted poles.
     NDX
          Vector containing the indices used in the sort.

     See also: eig, esort, pole, pzmap, sort, zero.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
Sort discrete-time poles by magnitude (in decreasing order).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3
dss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2196
 -- Function File: SYS = dss (SYS)
 -- Function File: SYS = dss (D, ...)
 -- Function File: SYS = dss (A, B, C, D, E, ...)
 -- Function File: SYS = dss (A, B, C, D, E, TSAM, ...)
     Create or convert to descriptor state-space model.

     *Inputs*
     SYS
          LTI model to be converted to state-space.
     A
          State matrix (n-by-n).
     B
          Input matrix (n-by-m).
     C
          Output matrix (p-by-n).
     D
          Feedthrough matrix (p-by-m).
     E
          Descriptor matrix (n-by-n).
     TSAM
          Sampling time in seconds.  If TSAM is not specified, a
          continuous-time model is assumed.
     ...
          Optional pairs of properties and values.  Type 'set (dss)' for
          more information.

     *Outputs*
     SYS
          Descriptor state-space model.

     *Option Keys and Values*
     'A', 'B', 'C', 'D', 'E'
          State-space matrices.  See 'Inputs' for details.

     'STNAME'
          The name of the states in SYS.  Cell vector containing strings
          for each state.  Default names are '{'x1', 'x2', ...}'

     'SCALED'
          Logical.  If set to true, no automatic scaling is used, e.g.
          for frequency response plots.

     'TSAM'
          Sampling time.  See 'Inputs' for details.

     'INNAME'
          The name of the input channels in SYS.  Cell vector of length
          m containing strings.  Default names are '{'u1', 'u2', ...}'

     'OUTNAME'
          The name of the output channels in SYS.  Cell vector of length
          p containing strings.  Default names are '{'y1', 'y2', ...}'

     'INGROUP'
          Struct with input group names as field names and vectors of
          input indices as field values.  Default is an empty struct.

     'OUTGROUP'
          Struct with output group names as field names and vectors of
          output indices as field values.  Default is an empty struct.

     'NAME'
          String containing the name of the model.

     'NOTES'
          String or cell of string containing comments.

     'USERDATA'
          Any data type.

     *Equations*
            .
          E x = A x + B u
            y = C x + D u

     See also: ss, tf.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Create or convert to descriptor state-space model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
esort


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 402
 -- Function File: S = esort(P)
 -- Function File: [S, NDX] = esort(P)
     Sort continuous-time poles by real part (in decreasing order).

     *Inputs*
     P
          Input vector containing continuous-time poles.

     *Outputs*
     S
          Vector with sorted eigenvalues.
     NDX
          Vector containing the indices used in the sort.

     See also: dsort, eig, pole, pzmap, sort, zero.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
Sort continuous-time poles by real part (in decreasing order).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
estim


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1085
 -- Function File: EST = estim (SYS, L)
 -- Function File: EST = estim (SYS, L, SENSORS, KNOWN)
     Return state estimator for a given estimator gain.

     *Inputs*
     SYS
          LTI model.
     L
          State feedback matrix.
     SENSORS
          Indices of measured output signals y from SYS.  If omitted,
          all outputs are measured.
     KNOWN
          Indices of known input signals u (deterministic) to SYS.  All
          other inputs to SYS are assumed stochastic (w).  If argument
          KNOWN is omitted, no inputs u are known.

     *Outputs*
     EST
          State-space model of estimator.

     *Block Diagram*
                                           u  +-------+         ^
                +---------------------------->|       |-------> y
                |    +-------+     +       y  |  est  |         ^
          u ----+--->|       |----->(+)------>|       |-------> x
                     |  sys  |       ^ +      +-------+
          w -------->|       |       |
                     +-------+       | v

     See also: kalman, lqe, place.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Return state estimator for a given estimator gain.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
filt


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2804
 -- Function File: SYS = filt (NUM, DEN, ...)
 -- Function File: SYS = filt (NUM, DEN, TSAM, ...)
     Create discrete-time transfer function model from data in DSP
     format.

     *Inputs*
     NUM
          Numerator or cell of numerators.  Each numerator must be a row
          vector containing the coefficients of the polynomial in
          ascending powers of z^-1.  num{i,j} contains the numerator
          polynomial from input j to output i.  In the SISO case, a
          single vector is accepted as well.
     DEN
          Denominator or cell of denominators.  Each denominator must be
          a row vector containing the coefficients of the polynomial in
          ascending powers of z^-1.  den{i,j} contains the denominator
          polynomial from input j to output i.  In the SISO case, a
          single vector is accepted as well.
     TSAM
          Sampling time in seconds.  If TSAM is not specified, default
          value -1 (unspecified) is taken.
     ...
          Optional pairs of properties and values.  Type 'set (filt)'
          for more information.

     *Outputs*
     SYS
          Discrete-time transfer function model.

     *Option Keys and Values*
     'NUM'
          Numerator.  See 'Inputs' for details.

     'DEN'
          Denominator.  See 'Inputs' for details.

     'TFVAR'
          String containing the transfer function variable.

     'INV'
          Logical.  True for negative powers of the transfer function
          variable.

     'TSAM'
          Sampling time.  See 'Inputs' for details.

     'INNAME'
          The name of the input channels in SYS.  Cell vector of length
          m containing strings.  Default names are '{'u1', 'u2', ...}'

     'OUTNAME'
          The name of the output channels in SYS.  Cell vector of length
          p containing strings.  Default names are '{'y1', 'y2', ...}'

     'INGROUP'
          Struct with input group names as field names and vectors of
          input indices as field values.  Default is an empty struct.

     'OUTGROUP'
          Struct with output group names as field names and vectors of
          output indices as field values.  Default is an empty struct.

     'NAME'
          String containing the name of the model.

     'NOTES'
          String or cell of string containing comments.

     'USERDATA'
          Any data type.

     *Example*
                          3 z^-1
          H(z^-1) = -------------------
                    1 + 4 z^-1 + 2 z^-2

          octave:1> H = filt ([0, 3], [1, 4, 2])

          Transfer function 'H' from input 'u1' to output ...

                      3 z^-1
           y1:  -------------------
                1 + 4 z^-1 + 2 z^-2

          Sampling time: unspecified
          Discrete-time model.

     See also: tf.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
Create discrete-time transfer function model from data in DSP format.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
fitfrd


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1169
 -- Function File: [SYS, N] = fitfrd (DAT, N)
 -- Function File: [SYS, N] = fitfrd (DAT, N, FLAG)
     Fit frequency response data with a state-space system.  If
     requested, the returned system is stable and minimum-phase.

     *Inputs*
     DAT
          LTI model containing frequency response data of a SISO system.
     N
          The desired order of the system to be fitted.  'n <=
          length(dat.w)'.
     FLAG
          The flag controls whether the returned system is stable and
          minimum-phase.
          0
               The system zeros and poles are not constrained.  Default
               value.
          1
               The system zeros and poles will have negative real parts
               in the continuous-time case, or moduli less than 1 in the
               discrete-time case.

     *Outputs*
     SYS
          State-space model of order N, fitted to frequency response
          data DAT.
     N
          The order of the obtained system.  The value of N could only
          be modified if inputs 'n > 0' and 'flag = 1'.

     *Algorithm*
     Uses SLICOT SB10YD by courtesy of NICONET e.V.
     (http://www.slicot.org)


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Fit frequency response data with a state-space system.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
fwcfconred


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3225
 -- Function File: [KR, INFO] = fwcfconred (G, F, L, ...)
 -- Function File: [KR, INFO] = fwcfconred (G, F, L, NCR, ...)
 -- Function File: [KR, INFO] = fwcfconred (G, F, L, OPT, ...)
 -- Function File: [KR, INFO] = fwcfconred (G, F, L, NCR, OPT, ...)

     Reduction of state-feedback-observer based controller by
     frequency-weighted coprime factorization (FW CF). Given a plant G,
     state feedback gain F and full observer gain L, determine a reduced
     order controller KR by using stability enforcing frequency weights.

     *Inputs*
     G
          LTI model of the open-loop plant (A,B,C,D). It has m inputs, p
          outputs and n states.
     F
          Stabilizing state feedback matrix (m-by-n).
     L
          Stabilizing observer gain matrix (n-by-p).
     NCR
          The desired order of the resulting reduced order controller
          KR.  If not specified, NCR is chosen automatically according
          to the description of key 'ORDER'.
     ...
          Optional pairs of keys and values.  '"key1", value1, "key2",
          value2'.
     OPT
          Optional struct with keys as field names.  Struct OPT can be
          created directly or by function 'options'.  'opt.key1 =
          value1, opt.key2 = value2'.

     *Outputs*
     KR
          State-space model of reduced order controller.
     INFO
          Struct containing additional information.
          INFO.HSV
               The Hankel singular values of the extended system?!?.
               The N Hankel singular values are ordered decreasingly.
          INFO.NCR
               The order of the obtained reduced order controller KR.

     *Option Keys and Values*
     'ORDER', 'NCR'
          The desired order of the resulting reduced order controller
          KR.  If not specified, NCR is chosen automatically such that
          states with Hankel singular values INFO.HSV > TOL1 are
          retained.

     'METHOD'
          Order reduction approach to be used as follows:
          'SR', 'B'
               Use the square-root Balance & Truncate method.
          'BFSR', 'F'
               Use the balancing-free square-root Balance & Truncate
               method.  Default method.

     'CF'
          Specifies whether left or right coprime factorization is to be
          used as follows:
          'LEFT', 'L'
               Use left coprime factorization.
          'RIGHT', 'R'
               Use right coprime factorization.  Default method.

     'FEEDBACK'
          Specifies whether F and L are fed back positively or
          negatively:
          '+'
               A+BK and A+LC are both Hurwitz matrices.
          '-'
               A-BK and A-LC are both Hurwitz matrices.  Default value.

     'TOL1'
          If 'ORDER' is not specified, TOL1 contains the tolerance for
          determining the order of the reduced system.  For model
          reduction, the recommended value of TOL1 is c*info.hsv(1),
          where c lies in the interval [0.00001, 0.001].  Default value
          is n*eps*info.hsv(1).  If 'ORDER' is specified, the value of
          TOL1 is ignored.

     *Algorithm*
     Uses SLICOT SB16CD by courtesy of NICONET e.V.
     (http://www.slicot.org)


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Reduction of state-feedback-observer based controller by
frequency-weighted c...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
gensig


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 802
 -- Function File: [U, T] = gensig (SIGTYPE, TAU)
 -- Function File: [U, T] = gensig (SIGTYPE, TAU, TFINAL)
 -- Function File: [U, T] = gensig (SIGTYPE, TAU, TFINAL, TSAM)
     Generate periodic signal.  Useful in combination with lsim.

     *Inputs*
     SIGTYPE = "SIN"
          Sine wave.
     SIGTYPE = "COS"
          Cosine wave.
     SIGTYPE = "SQUARE"
          Square wave.
     SIGTYPE = "PULSE"
          Periodic pulse.
     TAU
          Duration of one period in seconds.
     TFINAL
          Optional duration of the signal in seconds.  Default duration
          is 5 periods.
     TSAM
          Optional sampling time in seconds.  Default spacing is tau/64.

     *Outputs*
     U
          Vector of signal values.
     T
          Time vector of the signal.

     See also: lsim.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Generate periodic signal.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
gram


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 459
 -- Function File: W = gram (SYS, MODE)
 -- Function File: WC = gram (A, B)
     'gram (SYS, "c")' returns the controllability gramian of the
     (continuous- or discrete-time) system SYS.  'gram (SYS, "o")'
     returns the observability gramian of the (continuous- or
     discrete-time) system SYS.  'gram (A, B)' returns the
     controllability gramian WC of the continuous-time system dx/dt = a
     x + b u; i.e., WC satisfies a Wc + m Wc' + b b' = 0.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
'gram (SYS, "c")' returns the controllability gramian of the
(continuous- or ...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
h2syn


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2227
 -- Function File: [K, N, GAMMA, INFO] = h2syn (P, NMEAS, NCON)
 -- Function File: [K, N, GAMMA, INFO] = h2syn (P)
     H-2 control synthesis for LTI plant.

     *Inputs*
     P
          Generalized plant.  Must be a proper/realizable LTI model.  If
          P is constructed with 'mktito' or 'augw', arguments NMEAS and
          NCON can be omitted.
     NMEAS
          Number of measured outputs v.  The last NMEAS outputs of P are
          connected to the inputs of controller K.  The remaining
          outputs z (indices 1 to p-nmeas) are used to calculate the H-2
          norm.
     NCON
          Number of controlled inputs u.  The last NCON inputs of P are
          connected to the outputs of controller K.  The remaining
          inputs w (indices 1 to m-ncon) are excited by a harmonic test
          signal.

     *Outputs*
     K
          State-space model of the H-2 optimal controller.
     N
          State-space model of the lower LFT of P and K.
     INFO
          Structure containing additional information.
     INFO.GAMMA
          H-2 norm of N.
     INFO.RCOND
          Vector RCOND contains estimates of the reciprocal condition
          numbers of the matrices which are to be inverted and estimates
          of the reciprocal condition numbers of the Riccati equations
          which have to be solved during the computation of the
          controller K.  For details, see the description of the
          corresponding SLICOT routine.

     *Block Diagram*

          gamma = min||N(K)||             N = lft (P, K)
                   K         2

                         +--------+
                 w ----->|        |-----> z
                         |  P(s)  |
                 u +---->|        |-----+ v
                   |     +--------+     |
                   |                    |
                   |     +--------+     |
                   +-----|  K(s)  |<----+
                         +--------+

                         +--------+
                 w ----->|  N(s)  |-----> z
                         +--------+

     *Algorithm*
     Uses SLICOT SB10HD and SB10ED by courtesy of NICONET e.V.
     (http://www.slicot.org)

     See also: augw, lqr, dlqr, kalman.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
H-2 control synthesis for LTI plant.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
hinfsyn


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4179
 -- Function File: [K, N, GAMMA, INFO] = hinfsyn (P, NMEAS, NCON)
 -- Function File: [K, N, GAMMA, INFO] = hinfsyn (P, NMEAS, NCON, ...)
 -- Function File: [K, N, GAMMA, INFO] = hinfsyn (P, NMEAS, NCON, OPT,
          ...)
 -- Function File: [K, N, GAMMA, INFO] = hinfsyn (P, ...)
 -- Function File: [K, N, GAMMA, INFO] = hinfsyn (P, OPT, ...)
     H-infinity control synthesis for LTI plant.

     *Inputs*
     P
          Generalized plant.  Must be a proper/realizable LTI model.  If
          P is constructed with 'mktito' or 'augw', arguments NMEAS and
          NCON can be omitted.
     NMEAS
          Number of measured outputs v.  The last NMEAS outputs of P are
          connected to the inputs of controller K.  The remaining
          outputs z (indices 1 to p-nmeas) are used to calculate the
          H-infinity norm.
     NCON
          Number of controlled inputs u.  The last NCON inputs of P are
          connected to the outputs of controller K.  The remaining
          inputs w (indices 1 to m-ncon) are excited by a harmonic test
          signal.
     ...
          Optional pairs of keys and values.  ''key1', value1, 'key2',
          value2'.
     OPT
          Optional struct with keys as field names.  Struct OPT can be
          created directly or by function 'options'.  'opt.key1 =
          value1, opt.key2 = value2'.

     *Outputs*
     K
          State-space model of the H-infinity (sub-)optimal controller.
     N
          State-space model of the lower LFT of P and K.
     INFO
          Structure containing additional information.
     INFO.GAMMA
          L-infinity norm of N.
     INFO.RCOND
          Vector RCOND contains estimates of the reciprocal condition
          numbers of the matrices which are to be inverted and estimates
          of the reciprocal condition numbers of the Riccati equations
          which have to be solved during the computation of the
          controller K.  For details, see the description of the
          corresponding SLICOT routine.

     *Option Keys and Values*
     'METHOD'
          String specifying the desired kind of controller:
          'OPTIMAL', 'OPT', 'O'
               Compute optimal controller using gamma iteration.
               Default selection for compatibility reasons.
          'SUBOPTIMAL', 'SUB', 'S'
               Compute (sub-)optimal controller.  For stability reasons,
               suboptimal controllers are to be preferred over optimal
               ones.
     'GMAX'
          The maximum value of the H-infinity norm of N.  It is assumed
          that GMAX is sufficiently large so that the controller is
          admissible.  Default value is 1e15.
     'GMIN'
          Initial lower bound for gamma iteration.  Default value is 0.
          GMIN is only meaningful for optimal discrete-time controllers.
     'TOLGAM'
          Tolerance used for controlling the accuracy of GAMMA and its
          distance to the estimated minimal possible value of GAMMA.
          Default value is 0.01.  If TOLGAM = 0, then a default value
          equal to 'sqrt(eps)' is used, where EPS is the relative
          machine precision.  For suboptimal controllers, TOLGAM is
          ignored.
     'ACTOL'
          Upper bound for the poles of the closed-loop system N used for
          determining if it is stable.  ACTOL >= 0 for stable systems.
          For suboptimal controllers, ACTOL is ignored.

     *Block Diagram*

          gamma = min||N(K)||             N = lft (P, K)
                   K         inf

                         +--------+
                 w ----->|        |-----> z
                         |  P(s)  |
                 u +---->|        |-----+ v
                   |     +--------+     |
                   |                    |
                   |     +--------+     |
                   +-----|  K(s)  |<----+
                         +--------+

                         +--------+
                 w ----->|  N(s)  |-----> z
                         +--------+

     *Algorithm*
     Uses SLICOT SB10FD, SB10DD and SB10AD by courtesy of NICONET e.V.
     (http://www.slicot.org)

     See also: augw, mixsyn.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
H-infinity control synthesis for LTI plant.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
hnamodred


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6628
 -- Function File: [GR, INFO] = hnamodred (G, ...)
 -- Function File: [GR, INFO] = hnamodred (G, NR, ...)
 -- Function File: [GR, INFO] = hnamodred (G, OPT, ...)
 -- Function File: [GR, INFO] = hnamodred (G, NR, OPT, ...)

     Model order reduction by frequency weighted optimal Hankel-norm
     (HNA) method.  The aim of model reduction is to find an LTI system
     GR of order NR (nr < n) such that the input-output behaviour of GR
     approximates the one from original system G.

     HNA is an absolute error method which tries to minimize
          ||G-Gr||  = min
                  H

          ||V (G-Gr) W||  = min
                        H
     where V and W denote output and input weightings.

     *Inputs*
     G
          LTI model to be reduced.
     NR
          The desired order of the resulting reduced order system GR.
          If not specified, NR is chosen automatically according to the
          description of key "ORDER".
     ...
          Optional pairs of keys and values.  '"key1", value1, "key2",
          value2'.
     OPT
          Optional struct with keys as field names.  Struct OPT can be
          created directly or by function 'options'.  'opt.key1 =
          value1, opt.key2 = value2'.

     *Outputs*
     GR
          Reduced order state-space model.
     INFO
          Struct containing additional information.
          INFO.N
               The order of the original system G.
          INFO.NS
               The order of the ALPHA-stable subsystem of the original
               system G.
          INFO.HSV
               The Hankel singular values corresponding to the
               projection 'op(V)*G1*op(W)', where G1 denotes the
               ALPHA-stable part of the original system G.  The NS
               Hankel singular values are ordered decreasingly.
          INFO.NU
               The order of the ALPHA-unstable subsystem of both the
               original system G and the reduced-order system GR.
          INFO.NR
               The order of the obtained reduced order system GR.

     *Option Keys and Values*
     'ORDER', 'NR'
          The desired order of the resulting reduced order system GR.
          If not specified, NR is the sum of INFO.NU and the number of
          Hankel singular values greater than 'max(tol1,
          ns*eps*info.hsv(1)';

     'METHOD'
          Specifies the computational approach to be used.  Valid values
          corresponding to this key are:
          'DESCRIPTOR'
               Use the inverse free descriptor system approach.
          'STANDARD'
               Use the inversion based standard approach.
          'AUTO'
               Switch automatically to the inverse free descriptor
               approach in case of badly conditioned feedthrough
               matrices in V or W. Default method.

     'LEFT', 'V'
          LTI model of the left/output frequency weighting.  The
          weighting must be antistable.
               || V (G-Gr) . ||  = min
                               H

     'RIGHT', 'W'
          LTI model of the right/input frequency weighting.  The
          weighting must be antistable.
               || . (G-Gr) W ||  = min
                               H

     'LEFT-INV', 'INV-V'
          LTI model of the left/output frequency weighting.  The
          weighting must have only antistable zeros.
               || inv(V) (G-Gr) . ||  = min
                                    H

     'RIGHT-INV', 'INV-W'
          LTI model of the right/input frequency weighting.  The
          weighting must have only antistable zeros.
               || . (G-Gr) inv(W) ||  = min
                                    H

     'LEFT-CONJ', 'CONJ-V'
          LTI model of the left/output frequency weighting.  The
          weighting must be stable.
               || V (G-Gr) . ||  = min
                               H

     'RIGHT-CONJ', 'CONJ-W'
          LTI model of the right/input frequency weighting.  The
          weighting must be stable.
               || . (G-Gr) W ||  = min
                               H

     'LEFT-CONJ-INV', 'CONJ-INV-V'
          LTI model of the left/output frequency weighting.  The
          weighting must be minimum-phase.
               || V (G-Gr) . ||  = min
                               H

     'RIGHT-CONJ-INV', 'CONJ-INV-W'
          LTI model of the right/input frequency weighting.  The
          weighting must be minimum-phase.
               || . (G-Gr) W ||  = min
                               H

     'ALPHA'
          Specifies the ALPHA-stability boundary for the eigenvalues of
          the state dynamics matrix G.A.  For a continuous-time system,
          ALPHA <= 0 is the boundary value for the real parts of
          eigenvalues, while for a discrete-time system, 0 <= ALPHA <= 1
          represents the boundary value for the moduli of eigenvalues.
          The ALPHA-stability domain does not include the boundary.
          Default value is 0 for continuous-time systems and 1 for
          discrete-time systems.

     'TOL1'
          If 'ORDER' is not specified, TOL1 contains the tolerance for
          determining the order of the reduced model.  For model
          reduction, the recommended value of TOL1 is c*info.hsv(1),
          where c lies in the interval [0.00001, 0.001].  TOL1 < 1.  If
          'ORDER' is specified, the value of TOL1 is ignored.

     'TOL2'
          The tolerance for determining the order of a minimal
          realization of the ALPHA-stable part of the given model.  TOL2
          <= TOL1 < 1.  If not specified, ns*eps*info.hsv(1) is chosen.

     'EQUIL', 'SCALE'
          Boolean indicating whether equilibration (scaling) should be
          performed on system G prior to order reduction.  Default value
          is true if 'G.scaled == false' and false if 'G.scaled ==
          true'.  Note that for MIMO models, proper scaling of both
          inputs and outputs is of utmost importance.  The input and
          output scaling can *not* be done by the equilibration option
          or the 'prescale' function because these functions perform
          state transformations only.  Furthermore, signals should not
          be scaled simply to a certain range.  For all inputs (or
          outputs), a certain change should be of the same importance
          for the model.

     Approximation Properties:
        * Guaranteed stability of reduced models
        * Lower guaranteed error bound
        * Guaranteed a priori error bound

     *Algorithm*
     Uses SLICOT AB09JD by courtesy of NICONET e.V.
     (http://www.slicot.org)


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 77
Model order reduction by frequency weighted optimal Hankel-norm (HNA)
method.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
hsvd


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 401
 -- Function File: HSV = hsvd (SYS)
 -- Function File: HSV = hsvd (SYS, "OFFSET", OFFSET)
 -- Function File: HSV = hsvd (SYS, "ALPHA", ALPHA)
     Hankel singular values of the stable part of an LTI model.  If no
     output arguments are given, the Hankel singular values are
     displayed in a plot.

     *Algorithm*
     Uses SLICOT AB13AD by courtesy of NICONET e.V.
     (http://www.slicot.org)


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Hankel singular values of the stable part of an LTI model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
imp_invar


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1010
 -- Function File: [B_OUT, A_OUT] = imp_invar (B, A, FS, TOL)
 -- Function File: [B_OUT, A_OUT] = imp_invar (B, A, FS)
 -- Function File: [B_OUT, A_OUT] = imp_invar (B, A)
 -- Function File: [SYS_OUT] = imp_invar (B, A, FS. TOL)
 -- Function File: [SYS_OUT] = imp_invar (SYS_IN, FS, TOL)
     Converts analog filter with coefficients B and A and/or SYS_IN to
     digital, conserving impulse response.

     If FS is not specified, or is an empty vector, it defaults to 1Hz.

     If TOL is not specified, it defaults to 0.0001 (0.1%) This function
     does the inverse of invimpinvar so that the following example
     should restore the original values of A and B.

     'invimpinvar' implements the reverse of this function.
          [b, a] = impinvar (b, a);
          [b, a] = invimpinvar (b, a);

     Reference: Thomas J. Cavicchi (1996) "Impulse invariance and
     multiple-order poles".  IEEE transactions on signal processing, Vol
     44 (9): 2344-2347

     See also: zoh, bilinear, invimpinvar.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Converts analog filter with coefficients B and A and/or SYS_IN to
digital, co...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
impulse


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1691
 -- Function File: impulse (SYS)
 -- Function File: impulse (SYS1, SYS2, ..., SYSN)
 -- Function File: impulse (SYS1, 'STYLE1', ..., SYSN, 'STYLEN')
 -- Function File: impulse (SYS1, ..., T)
 -- Function File: impulse (SYS1, ..., TFINAL)
 -- Function File: impulse (SYS1, ..., TFINAL, DT)
 -- Function File: [Y, T, X] = impulse (SYS)
 -- Function File: [Y, T, X] = impulse (SYS, T)
 -- Function File: [Y, T, X] = impulse (SYS, TFINAL)
 -- Function File: [Y, T, X] = impulse (SYS, TFINAL, DT)
     Impulse response of LTI system.  If no output arguments are given,
     the response is printed on the screen.

     *Inputs*
     SYS
          LTI model.
     T
          Time vector.  Should be evenly spaced.  If not specified, it
          is calculated by the poles of the system to reflect adequately
          the response transients.
     TFINAL
          Optional simulation horizon.  If not specified, it is
          calculated by the poles of the system to reflect adequately
          the response transients.
     DT
          Optional sampling time.  Be sure to choose it small enough to
          capture transient phenomena.  If not specified, it is
          calculated by the poles of the system.
     'STYLE'
          Line style and color, e.g.  'r' for a solid red line or '-.k'
          for a dash-dotted black line.  See 'help plot' for details.

     *Outputs*
     Y
          Output response array.  Has as many rows as time samples
          (length of t) and as many columns as outputs.
     T
          Time row vector.
     X
          State trajectories array.  Has 'length (t)' rows and as many
          columns as states.

     See also: initial, lsim, step.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Impulse response of LTI system.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
initial


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2014
 -- Function File: initial (SYS, X0)
 -- Function File: initial (SYS1, SYS2, ..., SYSN, X0)
 -- Function File: initial (SYS1, 'STYLE1', ..., SYSN, 'STYLEN', X0)
 -- Function File: initial (SYS1, ..., X0, T)
 -- Function File: initial (SYS1, ..., X0, TFINAL)
 -- Function File: initial (SYS1, ..., X0, TFINAL, DT)
 -- Function File: [Y, T, X] = initial (SYS, X0)
 -- Function File: [Y, T, X] = initial (SYS, X0, T)
 -- Function File: [Y, T, X] = initial (SYS, X0, TFINAL)
 -- Function File: [Y, T, X] = initial (SYS, X0, TFINAL, DT)
     Initial condition response of state-space model.  If no output
     arguments are given, the response is printed on the screen.

     *Inputs*
     SYS
          State-space model.
     X0
          Vector of initial conditions for each state.
     T
          Optional time vector.  Should be evenly spaced.  If not
          specified, it is calculated by the poles of the system to
          reflect adequately the response transients.
     TFINAL
          Optional simulation horizon.  If not specified, it is
          calculated by the poles of the system to reflect adequately
          the response transients.
     DT
          Optional sampling time.  Be sure to choose it small enough to
          capture transient phenomena.  If not specified, it is
          calculated by the poles of the system.
     'STYLE'
          Line style and color, e.g.  'r' for a solid red line or '-.k'
          for a dash-dotted black line.  See 'help plot' for details.

     *Outputs*
     Y
          Output response array.  Has as many rows as time samples
          (length of t) and as many columns as outputs.
     T
          Time row vector.
     X
          State trajectories array.  Has 'length (t)' rows and as many
          columns as states.

     *Example*
                             .
          Continuous Time:   x = A x ,   y = C x ,   x(0) = x0

          Discrete Time:   x[k+1] = A x[k] ,   y[k] = C x[k] ,   x[0] = x0

     See also: impulse, lsim, step.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Initial condition response of state-space model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
isctrb


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1302
 -- Function File: [BOOL, NCON] = isctrb (SYS)
 -- Function File: [BOOL, NCON] = isctrb (SYS, TOL)
 -- Function File: [BOOL, NCON] = isctrb (A, B)
 -- Function File: [BOOL, NCON] = isctrb (A, B, E)
 -- Function File: [BOOL, NCON] = isctrb (A, B, [], TOL)
 -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     