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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 284
 -- Function File: Anderson  

     Frequency-weighted coprime factorization controller reduction [1].


     *References*
       1. Anderson, B.D.O.: ‘Controller Reduction: Concepts and Approaches’,
          IEEE Transactions of Automatic Control, Vol.  34, No.  8, August 1989.


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



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1276
 -- 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: 396
 -- 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
       2. Elevator angle
     System outputs:
       1. Airspeed
       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: 158
 -- Function File: MDSSystem  

     Run the example for robust control of a mass-damper-spring system.

   Run ‘edit MDSSystem’ to open the example file.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
Run the example for 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: 2667
 -- Function File: Madievski  
     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: 1006
 -- 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: 1307
 -- Function File: SYS = WestlandLynx  

     Model of the Westland Lynx Helicopter about hover.

     *System variables*

     System inputs
          main rotor collective
          longitudinal cyclic
          lateral cyclic
          tail rotor collective
     System 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]
     System 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: 529
 -- 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 eigenvalues of the closed loop in the vector P, the state
     feedback vector k is calculated in the form

                K = (k1 k2 ... kn)

     such that the closed loop system matrix

                A - BK

     has the eigenvalues given in P.

     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: 2100
 -- 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'.  Uses SLICOT IB01CD
     (https://github.com/SLICOT/SLICOT-Reference) for initial conditions,
     Copyright (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License
     and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).

     *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: 2999
 -- 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: 7
bdschur


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 700
 -- Function File: [T, S, BLKSZ] = bdschur (A)
 -- Function File: [T, S, BLKSZ] = bdschur (A, CONDMAX)

     Compute a block-diagonal Schur decomposition.

     *Inputs*
     A
          Matrix to be decomposed.
     CONDMAX
          Maximum condition number (real scalar value greater or equal 1) of the
          resulting transformation matrix T.  This parameter is optional.  If
          not provided, a value of 1e4 is used.

     *Outputs*
     T
          Transformation matrix.
     S
          Block diagonalized matrix.
     BLKSZ
          Array with sizes of the blocks in S.

     The resulting matrix S in block diagonal form is given by
                   -1
              S = T  A T


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Compute a block-diagonal Schur decomposition.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1453
 -- 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.  In the latter case, the chidlren of the
     figure handle are the handles for (1) the phase plot, (2) the legend, and
     (3) the magnitude plot.  The magnitude plot is the active handle after the
     bode plot is finished.

     *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: 1178
 -- 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: 6190
 -- 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 (https://github.com/SLICOT/SLICOT-Reference), Copyright
     (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License and
     Disclaimer (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).


# 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: 6281
 -- 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 (https://github.com/SLICOT/SLICOT-Reference), Copyright
     (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License and
     Disclaimer (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).


# 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: 7485
 -- 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 (https://github.com/SLICOT/SLICOT-Reference), Copyright
     (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License and
     Disclaimer (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).


# 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: 1785
 -- 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 (https://github.com/SLICOT/SLICOT-Reference),
     Copyright (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License
     and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).

     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: 4473
 -- 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 (https://github.com/SLICOT/SLICOT-Reference), Copyright
     (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License and
     Disclaimer (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).


# 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: 8
compreal


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1185
 -- Function File: [CSYS, T] = compreal (SYS)
 -- Function File: [CSYS, T] = compreal (SYS, REALIZATION)

     Returns the state-space companion controllable ors observable form of the
     input system as well as the transformation matrix.

     *Inputs*
     SYS
          LTI model.
     REALIZATION
          The REALIZATION argument selects the companion form:
          ‘'c'’
               Controllable companion form, the default if REALIZATION is
               omitted.
          ‘'o'’
               Observable companion form.

     *Outputs*
     CSYS
          State-space model in companian form.
     T
          Transformation matix.

     Given the state vector
                x(t)

     We look for a transformation matrix such that

                x(t)=Tz(t)

     Where T is our transformation matrix and $z(t)$ is our new state vector.
     Our new state-space is given by the following relationships:

          A_z = inv(T) A T
          B_z = inv(T) B
          C_z = C T
          D_z = D

     Alorithm based on
       1. T. Kailath, Linear systems.  Prentice-Hall Englewood Cliffs, NJ, 1980.
          ISBM 0-13-536961-4.  Eequation (15a) and (15b)


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Returns the state-space companion controllable ors observable form of the inp...



# 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: 956
 -- 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: 1812
 -- 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, esort, @@lti/pole, pzmap, @@lti/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: 1944
 -- 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 (https://github.com/SLICOT/SLICOT-Reference),
     Copyright (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License
     and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).

     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: 1704
 -- 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: 619
 -- 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 SB04QD and SG03AD, Copyright (c) 1996-2025, SLICOT, available under
     the BSD 3-Clause (License and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).

     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: 635
 -- 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 (https://github.com/SLICOT/SLICOT-Reference),
     Copyright (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License
     and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).

     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: 11
doc_control


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1116
 -- doc_control FCN1 FCN2 ...
 -- ST = doc_control (FCN1, FCN2, ...)

     Open online documentation of the Control package in the system's standard
     browser.

     *Note:* Since Octave 11 and Control Package 4.2.0 the package documentation
     is automatically shown in the documentation browser of the Octave GUI as
     soon as the Control Package is loaded.  Help to all package functions can
     then also be accessed by the comamnd ‘doc ...’.  However, this function is
     still useful when using Octave in the command line.

     *Inputs*
     FCN1, FCN2, ...
          Function names for which the documentation should be displayed.  If no
          function name is given, the index of the documentation is shown.  If
          one of the function names is 'license', copyright and license
          information are displayed.

     *Outputs*
     ST
          The return value ST has one of the values:
             • ‘0’ Found and opened system browser successfully.
             • ‘1’ System browser not found.
             • ‘2’ System browser found, but an error occurred.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Open online documentation of the Control package in the system's standard
bro...



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 393
 -- 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: esort, @@lti/pole, pzmap, @@lti/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: 2223
 -- 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/ss, @@tf/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: 7
dssdata


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1147
 -- Function File: [A, B, C, D, E, TSAM] = dssdata (SYS)
 -- Function File: [A, B, C, D, E, TSAM] = dssdata (SYS, [])
     Access descriptor state-space model data.

     Argument SYS is not limited to descriptor state-space models.  If SYS is
     not a descriptor state-space model, it is converted automatically.  SYS can
     also be a real-valued gain matrix which is then interpreted as static gain
     system.

     *Inputs*
     SYS
          Any type of LTI model or a real-valued matrix which is interpreted as
          continous-time static gain.
     []
          In case SYS is not a dss model (descriptor matrix E empty), ‘dssdata
          (sys, [])’ returns the empty element ‘e = []’ whereas ‘dssdata (sys)’
          returns the identity matrix ‘e = eye (size (a))’.

     *Outputs*
     A
          State matrix (n-by-n).
     B
          Input matrix (n-by-m).
     C
          Measurement matrix (p-by-n).
     D
          Feedthrough matrix (p-by-m).
     E
          Descriptor matrix (n-by-n).
     TSAM
          Sampling time in seconds.  If SYS is a continuous-time model, a zero
          is returned.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Access descriptor state-space model data.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 414
 -- 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, @@lti/pole, pzmap, sort, @@lti/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: 2314
 -- Function File: EST = estim (SYS, L)
 -- Function File: EST = estim (SYS, L, SENSORS, KNOWN)
 -- Function File: EST = estim (SYS, L, SENSORS, KNOWN, TYPE)
     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 or empty,
          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 or empty, no inputs u are known.
     TYPE
          Type of the estimator for discrete-time systems.  If set to 'delayed'
          the current estimation is based on y(k-1), if set to 'current' the
          current estimation is based on the lates mesaruement y(k).  If
          omitted, the 'delayed' version is created.

     *Outputs*
     EST
          State-space model of estimator.

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

     *Remarks*

     The argument TYPE is for discrete-time systems only.  If set to 'current',
     the follwong prediction-correction scheme is used:
          ^           ^
          x*(k+1) = A x(k) + B u(k)
             ^      ^        -1
             x(k) = x*(k) + A   L (y(k) - C x*(k) - D u(k))
     The inverse fo the system matrix in the above equations is required for
     maintaining the desired observer error dynamics given by (A - LC).

     The advantage of this structure is that the current measurement y(k) is
     used for the current estiamted state and not for the next allowing the
     estimator to react to system disturbances faster.  L is the observer
     feedback matrix for the common observer structure with the matrix (A - LC)
     being asymptotically stable, i.e.  has eigenvalues strictly within the unit
     circle.

     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: 2832
 -- 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])   # or filt ([0, 3, 0], [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/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: 8
filtdata


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1523
 -- Function File: [NUM, DEN, TSAM] = filtdata (SYS)
 -- Function File: [NUM, DEN, TSAM] = filtdata (SYS, "VECTOR")

     Access discrete-time transfer function data in DSP format.  Argument SYS is
     not limited to transfer function models.  If SYS is not a transfer
     function, it is converted automatically.  SYS can also be a real-valued
     gain matrix which is then interpreted as static gain system with
     unspecified sampling time (-1).

     *Inputs*
     SYS
          Any type of discrete-time LTI model or a real-valued matrix which is
          interpreted as discrete-time static gain with unspecified sampling
          time -1.
     "V", "VECTOR"
          For SISO models, return NUM and DEN directly as column vectors instead
          of cells containing a single column vector.

     *Outputs*
     NUM
          Cell of numerator(s).  Each numerator is 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 possible as well.
     DEN
          Cell of denominator(s).  Each denominator is 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 possible as well.
     TSAM
          Sampling time in seconds.  If TSAM is not specified, -1 is returned.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Access discrete-time transfer function data in DSP format.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1300
 -- 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 (https://github.com/SLICOT/SLICOT-Reference), Copyright
     (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License and
     Disclaimer (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).


# 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: 6
frdata


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1082
 -- Function File: [H, W, TSAM] = frdata (SYS)
 -- Function File: [H, W, TSAM] = frdata (SYS, "VECTOR")
     Access frequency response data.

     Argument SYS is not limited to frequency response data objects.  If SYS is
     not a frd object, it is converted automatically.

     *Inputs*
     SYS
          Any type of LTI model or a real-valued matrix which is interpreted as
          continous-time static gain.
     "V", "VECTOR"
          In case SYS is a SISO model, this option returns the frequency
          response as a column vector (lw-by-1) instead of an array
          (p-by-m-by-lw).

     *Outputs*
     H
          Frequency response array (p-by-m-by-lw).  H(i,j,k) contains the
          response from input j to output i at frequency k.  In the SISO case, a
          vector (lw-by-1) is possible as well, see input "VECTOR".
     W
          Frequency vector (lw-by-1) in radian per second [rad/s].  Frequencies
          are in ascending order.
     TSAM
          Sampling time in seconds.  If SYS is a continuous-time model, a zero
          is returned.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Access frequency response data.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3351
 -- 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 (https://github.com/SLICOT/SLICOT-Reference), Copyright
     (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License and
     Disclaimer (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).


# 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: 467
 -- 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: 84
‘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: 2364
 -- 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 (https://github.com/SLICOT/SLICOT-Reference),
     Copyright (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License
     and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).

     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: 5946
 -- 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 resulting closed loop system with inputs w
          and outputs z.  It is the lower linear transformation (LFT) of P and K
          (see function ‘lft’).
     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
                         +--------+

     The signals have the following meanings:

     w(t): exogenous input (reference, disturbance, ...)
     u(t): control input
     z(t): performance outputs (control error, control input, ...)
     v(t): measured output (input of the controller)

     The transfer matrix P(s) can be partitioned corresponding to the input and
     output signals:

            Z(s) = P11(s) W(s) + P12(s) U(s)
            V(s) = P21(s) W(s) + P22(s) U(s)

                   | P11(s) : P12(s) |
            P(s) = |------- :--------|
                   | P21(s) : P22(s) |
                                                      -1
            N(S) = P11(s) + P12(s)K(s)(I - P22(s)K(s))  P21(s)

     The state-space representation of P is given by

              .
              x(t) =  A x(t) +  B1 w(t) +  B2 u(t)
              z(t) = C1 x(t) + D11 w(t) + D12 u(t)
              v(t) = C2 x(t) + D21 w(t) + D22 u(t)

                                  | C1 |      | D11 : D12 |
          A, B = | B1 : B2 |, C = |----|, D = |-----:-----|
                                  | C2 |      | D21 : D22 |

     The used method (see *Algorithm* below) requires the following assumptions:
     (A1) (A,B2) is stabilizable and (C2,A) is detectable
     (A2) D12 is full column rank and D21 is full row rank,
     (A3) The matrix below has full column rank for all w
                          | A-j*w*I  B2  |
                          |   C1     D12 |
     (A4) The matrix below has full row rank for all w.
                          | A-j*w*I  B1  |
                          |   C2     D21 |

     *Algorithm*
     Uses SB10DD and SB10AD, Copyright (c) 1996-2025, SLICOT, available under
     the BSD 3-Clause (License and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).

     See also: augw, mixsyn, @@lti/lft.


# 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: 6845
 -- 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.
               || conj(inv(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) conj(inv(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 (https://github.com/SLICOT/SLICOT-Reference), Copyright
     (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License and
     Disclaimer (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).


# 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: 550
 -- 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 (https://github.com/SLICOT/SLICOT-Reference), Copyright
     (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License and
     Disclaimer (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).


# 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: 2127
 -- 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.

     MIMO systems are only supported with SYS_IN as input argument.

     *Inputs*
     B
          Numerator coefficients of continuous-time LTI system.
     A
          Denominator coefficients of continuous-time LTI system.
     FS
          Sampling frequency.  If FS is not specified, or is an empty vector, it
          defaults to 1Hz.  tol Tolerance of the internally used function
          minreal for canceling identical poles and zeros.  If TOL is not
          specified, it defaults to 0.0001 (0.1%).
     SYS_IN
          System definition of the continuous-time LTI system.  This can also be
          a MIMO system.

     *Outputs*
     B_OUT
          Numerator coefficients of the discrete-time impulse invariant LTI
          system.
     A_OUT
          Denominator coefficients of the discrete-time impulse invariant LTI
          system.
     SYS_OUT
          Discrete-time impulse invaraiant LTI system.  If SYS_IN is given as
          state space representation, SYS_OUT is also returned in state space,
          otherwise as transfer function.

     *Algorithm*

     The step equivalent discretization of G(s) (zoh) results in G_zoh(z) =
     (z-1)/z * Z{G(s)/s} where Z{} is the z-transformation.  The transfer
     function of the impulse equivalent discretization is given by T*Z{G(s)}.
     Therefore, the zoh discretizaiton method for s*G(s) multipled by T*z/(z-1)
     leads to the desired result.

     *Remark*

     For the impulse response of a discrete-time system, the input sequence
     {1/T,0,0,0,...} and not the unit impulse is considered.  For this reason,
     the factor T is required for the impulse invaraint discretizaiton (see
     Algorithm).

     See also: @@lti/c2d.


# 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: 1842
 -- 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.

     *Remark*

     For the impulse response of a discrete-time system, the input sequence
     {1/T,0,0,0,...} and not the unit impulse is considered.

     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: 2826
 -- 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 a state-space model.  If no output arguments
     are given, the response is printed on the screen.

     *Inputs*
     SYS
          LTI system in state-space representation.
     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*

     Consider a continuous- or a discrete-time system of the form

     Continuous Time:
          .
          x(t) = A x(t) + B u(t) ,   y(t) = C x(t) + D u(t) ,   x(0) = x0

     Discrete Time:
          x(k+1) = A x(k) + B u(k) ,   y(k) = C x(k) + D u(k) ,   x(0) = x0

     The dynamic behavior of the system for u=0 and only driven by the initial
     system state x(0) is given by
          sys = ss (A, B, C, D);
          initial (sys, x0);

     *Remark*

     For a SISO input-output model G and initial values for the output y and its
     derivatives up to order n-1 the corresponding state space represetaiton is
     computed by:

          [A,b,c,d] = ssdata (G);
          T = obsv (A, c);
          G_ss = ss2ss (ss (G), T);
          initial (G_ss, x0);

     Note that, in general, the states of G_ss are only equal to the output y
     and its first n-1 time derivaties if u=0, which is the case for the initial
     condition response.

     See also: impulse, lsim, step.


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



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1473
 -- 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)
 -- Function File: [BOOL, NCON] = isctrb (A, B, E, TOL)
     Logical check for system controllability.  For numerical reasons, ‘isctrb
     (sys)’ should be used instead of ‘rank (ctrb (sys))’.

     *Inputs*
     SYS
          LTI model.  Descriptor state-space models are possible.  If SYS is not
          a state-space model, it is converted to a minimal state-space
          realization, so beware of pole-zero cancellations which may lead to
          wrong results!
     A
          State matrix (n-by-n).
     B
          Input matrix (n-by-m).
     E
          Descriptor matrix (n-by-n).  If E is empty ‘[]’ or not specified, an
          identity matrix is assumed.
     TOL
          Optional roundoff parameter.  Default value is 0.

     *Outputs*
     BOOL = 0
          System is not controllable.
     BOOL = 1
          System is controllable.
     NCON
          Number of controllable states.

     *Algorithm*
     Uses SLICOT AB01OD and TG01HD (https://github.com/SLICOT/SLICOT-Reference),
     Copyright (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License
     and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).

     See also: isobsv.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Logical check for system controllability.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1674
 -- Function File: BOOL = isdetectable (SYS)
 -- Function File: BOOL = isdetectable (SYS, TOL)
 -- Function File: BOOL = isdetectable (A, C)
 -- Function File: BOOL = isdetectable (A, C, E)
 -- Function File: BOOL = isdetectable (A, C, [], TOL)
 -- Function File: BOOL = isdetectable (A, C, E, TOL)
 -- Function File: BOOL = isdetectable (A, C, [], [], DFLG)
 -- Function File: BOOL = isdetectable (A, C, E, [], DFLG)
 -- Function File: BOOL = isdetectable (A, C, [], TOL, DFLG)
 -- Function File: BOOL = isdetectable (A, C, E, TOL, DFLG)
     Logical test for system detectability.  All unstable modes must be
     observable or all unobservable states must be stable.

     *Inputs*
     SYS
          LTI system.
     A
          State transition matrix.
     C
          Measurement matrix.
     E
          Descriptor matrix.  If E is empty ‘[]’ or not specified, an identity
          matrix is assumed.
     TOL
          Optional tolerance for stability.  Default value is 0.
     DFLG = 0
          Matrices (A, C) are part of a continuous-time system.  Default Value.
     DFLG = 1
          Matrices (A, C) are part of a discrete-time system.

     *Outputs*
     BOOL = 0
          System is not detectable.
     BOOL = 1
          System is detectable.

     *Algorithm*
     Uses SLICOT AB01OD and TG01HD (https://github.com/SLICOT/SLICOT-Reference),
     Copyright (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License
     and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).

     See ‘isstabilizable’ for description of computational method.

     See also: isstabilizable, @@lti/isstable, isctrb, isobsv.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Logical test for system detectability.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1281
 -- Function File: [BOOL, NOBS] = isobsv (SYS)
 -- Function File: [BOOL, NOBS] = isobsv (SYS, TOL)
 -- Function File: [BOOL, NOBS] = isobsv (A, C)
 -- Function File: [BOOL, NOBS] = isobsv (A, C, E)
 -- Function File: [BOOL, NOBS] = isobsv (A, C, [], TOL)
 -- Function File: [BOOL, NOBS] = isobsv (A, C, E, TOL)
     Logical check for system observability.  For numerical reasons, ‘isobsv
     (sys)’ should be used instead of ‘rank (obsv (sys))’.

     *Inputs*
     SYS
          LTI model.  Descriptor state-space models are possible.
     A
          State matrix (n-by-n).
     C
          Measurement matrix (p-by-n).
     E
          Descriptor matrix (n-by-n).  If E is empty ‘[]’ or not specified, an
          identity matrix is assumed.
     TOL
          Optional roundoff parameter.  Default value is 0.

     *Outputs*
     BOOL = 0
          System is not observable.
     BOOL = 1
          System is observable.
     NOBS
          Number of observable states.

     *Algorithm*
     Uses SLICOT AB01OD and TG01HD (https://github.com/SLICOT/SLICOT-Reference),
     Copyright (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License
     and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).

     See also: isctrb.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Logical check for system observability.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 537
 -- Function File: BOOL = issample (TS)
 -- Function File: BOOL = issample (TS, FLG)
     Return true if TS is a valid sampling time.

     *Inputs*
     TS
          Alleged sampling time to be tested.
     FLG = 1
          Accept real scalars TS > 0.  Default Value.
     FLG = 0
          Accept real scalars TS >= 0.
     FLG = -1
          Accept real scalars TS > 0 and TS == -1.
     FLG = -10
          Accept real scalars TS >= 0 and TS == -1.

     *Outputs*
     BOOL
          True if conditions are met and false otherwise.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Return true if TS is a valid sampling time.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
isstabilizable


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2127
 -- Function File: BOOL = isstabilizable (SYS)
 -- Function File: BOOL = isstabilizable (SYS, TOL)
 -- Function File: BOOL = isstabilizable (A, B)
 -- Function File: BOOL = isstabilizable (A, B, E)
 -- Function File: BOOL = isstabilizable (A, B, [], TOL)
 -- Function File: BOOL = isstabilizable (A, B, E, TOL)
 -- Function File: BOOL = isstabilizable (A, B, [], [], DFLG)
 -- Function File: BOOL = isstabilizable (A, B, E, [], DFLG)
 -- Function File: BOOL = isstabilizable (A, B, [], TOL, DFLG)
 -- Function File: BOOL = isstabilizable (A, B, E, TOL, DFLG)
     Logical check for system stabilizability.  All unstable modes must be
     controllable or all uncontrollable states must be stable.

     *Inputs*
     SYS
          LTI system.  If SYS is not a state-space system, it is converted to a
          minimal state-space realization, so beware of pole-zero cancellations
          which may lead to wrong results!
     A
          State transition matrix.
     B
          Input matrix.
     E
          Descriptor matrix.  If E is empty ‘[]’ or not specified, an identity
          matrix is assumed.
     TOL
          Optional tolerance for stability.  Default value is 0.
     DFLG = 0
          Matrices (A, B) are part of a continuous-time system.  Default Value.
     DFLG = 1
          Matrices (A, B) are part of a discrete-time system.

     *Outputs*
     BOOL = 0
          System is not stabilizable.
     BOOL = 1
          System is stabilizable.

     *Algorithm*
     Uses SLICOT AB01OD and TG01HD (https://github.com/SLICOT/SLICOT-Reference),
     Copyright (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License
     and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).
          * Calculate staircase form (SLICOT AB01OD)
          * Extract unobservable part of state transition matrix
          * Calculate eigenvalues of unobservable part
          * Check whether
            real (ev) < -tol*(1 + abs (ev))   continuous-time
            abs (ev) < 1 - tol                discrete-time

     See also: isdetectable, @@lti/isstable, isctrb, isobsv.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Logical check for system stabilizability.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2121
 -- Function File: [EST, G, X] = kalman (SYS, Q, R)
 -- Function File: [EST, G, X] = kalman (SYS, Q, R, S)
 -- Function File: [EST, G, X] = kalman (SYS, Q, R, [], SENSORS, KNOWN)
 -- Function File: [EST, G, X] = kalman (SYS, Q, R, S, SENSORS, KNOWN)
 -- Function File: [EST, G, X] = kalman (SYS, Q, R, [], SENSORS, KNOWN, TYPE)
 -- Function File: [EST, G, X] = kalman (SYS, Q, R, S, SENSORS, KNOWN, TYPE)
     Design Kalman estimator for LTI systems.

     *Inputs*
     SYS
          Nominal plant model.
     Q
          Covariance of white process noise.
     R
          Covariance of white measurement noise.
     S
          Optional cross term covariance.  Default value is 0.
     SENSORS
          Indices of measured output signals y from SYS.  If omitted or empty,
          all outputs are measured.
     KNOWN
          Indices of known input signals u (deterministic) to SYS.  All other
          inputs to SYS are assumed stochastic.  If argument KNOWN is omitted or
          empty, the first m-l inputs to SYS are known, where m is the total
          number of inputs to SYS and l is the size of the quadratic matrix Q.
     TYPE
          Type of the estimator for discrete-time systems.  If set to 'delayed'
          the current estimation is based on y(k-1), if set to 'current' the
          current estimation is based on the lates mesaruement y(k).  If
          omitted, the 'delayed' version is created.

     *Outputs*
     EST
          State-space model of the Kalman estimator.
     G
          Estimator gain.
     X
          Solution of the Riccati equation.

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

          Q = cov (w, w')     R = cov (v, v')     S = cov (w, v')

     See also: care, dare, estim, lqr.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Design Kalman estimator for LTI systems.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1694
 -- Function File: [L, P, E] = lqe (SYS, Q, R)
 -- Function File: [L, P, E] = lqe (SYS, Q, R, S)
 -- Function File: [L, P, E] = lqe (A, G, C, Q, R)
 -- Function File: [L, P, E] = lqe (A, G, C, Q, R, S)
 -- Function File: [L, P, E] = lqe (A, [], C, Q, R)
 -- Function File: [L, P, E] = lqe (A, [], C, Q, R, S)
     Kalman filter for continuous-time systems.

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

     *Inputs*
     SYS
          Continuous or discrete-time LTI model (p-by-m, n states).
     A
          State matrix of continuous-time system (n-by-n).
     G
          Process noise matrix of continuous-time system (n-by-g).  If G is
          empty ‘[]’, an identity matrix is assumed.
     C
          Measurement matrix of continuous-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*
     L
          Kalman filter gain matrix (n-by-p).
     P
          Unique stabilizing solution of the continuous-time Riccati equation
          (n-by-n).  Symmetric matrix.  If SYS is a discrete-time model, the
          solution of the corresponding discrete-time Riccati equation is
          returned.
     E
          Closed-loop poles (n-by-1).

     *Equations*
          .
          x = Ax + Bu + L(y - Cx -Du)

          E = eig(A - L*C)

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


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



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 941
 -- Function File: REG = lqg (SYS, QXU, QWV)
 -- Function File: REG = lqg (SYS, QXU, QWV, QI)
     Linear-quadratic gaussian (LQG) design

     *Inputs*
     SYS
          Continuous or discrete-time LTI model (m inputs, n states, p outputs).
     QXU
          State and input weighting matrix (n+m-by-n+m).
     QWV
          Process and measurement noise covariance matrix (n+p-by-n+p).
     QI
          Optional output weighting matrix for LQG servo control with integral
          action (p-by-p).  If QI is not specified, the LQG regulator is
          computed

     *Outputs*
     REG
          LQG regulator or controller as dynamic compensator.  Connect with
          positive feedback.

     *Equations*
          .
          x = A x + B u,   x(0) = x0

                            1   T
          J(x0) = E{ lim   --- INT ([x', u'] Qxu [x u]' + xi' Qi xi) dt}
                    T->inf  T   0

     See also: lqr, kalman, lqi.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Linear-quadratic gaussian (LQG) design



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 312
 -- Function File: REG = lqgreg (KEST, K)
     Form LQG regulator

     *Inputs*
     KEST
          Kalman estimator
     K
          State-feedback gain

     *Outputs*
     REG
          LQG regulator as dynamic compensator.  Connect with positive feedback.

     *Equations*

     See also: lqr, kalman, lqg.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
Form LQG regulator



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 352
 -- Function File: REG = lqgtrack (KEST, K)
     Form LQG servo controller

     *Inputs*
     KEST
          Kalman estimator
     K
          State-feedback gain, including integrator states (m x n+p)

     *Outputs*
     REG
          LQG servo controller.  Connect with positive feedback.

     *Equations*

     See also: lqr, kalman, lqg, lqgreg.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Form LQG servo controller



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1014
 -- Function File: [G, X, L] = lqi (SYS, Q, R)
 -- Function File: [G, X, L] = lqr (SYS, Q, R, S)
     Linear-quadratic integral control.

     *Inputs*
     SYS
          Continuous or discrete-time LTI model (m inputs, n states, p outputs).
     Q
          State weighting matrix (n+p-by-n+p).
     R
          Input weighting matrix (m-by-m).
     S
          Optional cross term matrix (n+p-by-m).  If S is not specified, a zero
          matrix is assumed.

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

     *Equations*
          .
          x = A x + B u,   x(0) = x0

                  inf
          J(x0) = INT (z' Q z  +  u' R u  +  2 z' S u)  dt
                   0

          z = [x; xi]
           z is the augmented state and xi the integral of the error e = r - y
          L = eig (A - B*G)

     See also: care, dare, dlqr.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Linear-quadratic integral control.



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


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

     *Inputs*
     SYS
          Continuous or discrete-time LTI model (p-by-m, n states).
     A
          State matrix of continuous-time system (n-by-n).
     B
          Input matrix of continuous-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 continuous-time Riccati equation
          (n-by-n).
     L
          Closed-loop poles (n-by-1).

     *Equations*
          .
          x = A x + B u,   x(0) = x0

                  inf
          J(x0) = INT (x' Q x  +  u' R u  +  2 x' S u)  dt
                   0

          L = eig (A - B*G)

     See also: care, dare, dlqr,lqry,lqi,lqg.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Linear-quadratic regulator.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 884
 -- Function File: [G, X, L] = lqry (SYS, Q, R, S)
     Linear-quadratic regulator with output weighting.

     *Inputs*
     SYS
          Continuous or discrete-time LTI model (p-by-m, n states).
     Q
          Outputs weighting matrix (p-by-p).
     R
          Input weighting matrix (m-by-m).
     S
          Optional cross term matrix (p-by-m).  If S is not specified, a zero
          matrix is assumed.

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

     *Equations*
          .
          x = A x + B u,   x(0) = x0
          y = C x + D u

                  inf
          J(x0) = INT (y' Q y  +  u' R u  +  2 y' S u)  dt
                   0

          L = eig (A - B*G)

     See also: lqr, dare, dlqr.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Linear-quadratic regulator with output weighting.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3327
 -- Function File: lsim (SYS, U)
 -- Function File: lsim (SYS1, SYS2, ..., SYSN, U)
 -- Function File: lsim (SYS1, STYLE1, ..., SYSN, STYLEN, U)
 -- Function File: lsim (SYS1, ..., U, T)
 -- Function File: lsim (SYS1, ..., U, T, X0)
 -- Function File: [Y, T, X] = lsim (SYS, U)
 -- Function File: [Y, T, X] = lsim (SYS, U, T)
 -- Function File: [Y, T, X] = lsim (SYS, U, T, X0)
 -- Function File: [...] = lsim (..., METHOD)

     Simulate LTI model response to arbitrary inputs.  If no output arguments
     are given, the system response is plotted on the screen.

     *Inputs*
     SYS
          LTI model.  System must be proper, i.e.  it must not have more zeros
          than poles.
     U
          Vector or array of input signal.  Needs ‘length(t)’ rows and as many
          columns as there are inputs.  If SYS is a single-input system, row
          vectors U of length ‘length(t)’ are accepted as well.
     T
          Time vector.  Should be evenly spaced.  If SYS is a continuous-time
          system and T is a real scalar, SYS is discretized with sampling time
          ‘tsam = t/(rows(u)-1)’.  If SYS is a discrete-time system and T is not
          specified, vector T is assumed to be ‘0 : tsam : tsam*(rows(u)-1)’.
     X0
          Vector of initial conditions for each state of a system in state
          space.  If not specified, a zero vector is assumed.  Note: A vector X0
          provided for an input-output system representation is ignored and a
          zero vector of initial conditions is used instead because the
          internally used state space representaton does generally not match the
          one assumed for X0.  For a simulation of an input-output model with
          initial conditions for the output y and its time-derivatives, see
          remarks below.
     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.
     METHOD
          Method that is used to discretize a continuous-time system for the
          simulation.  See @lti/c2d for possible methods.  If METHOD is not
          provided, the default is 'foh'.

     *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.  It is always evenly spaced.
     X
          State trajectories array.  Has ‘length (t)’ rows and as many columns
          as states.

     *Remarks*

        • For the simulation, continuous-time systems are discretized using the
          selected method METHOD or the default first-order-hold method (foh),
          see @lti/c2d for details.

        • For a SISO input-output model G and initial values for the output y
          and its derivatives up to order n-1 the corresponding state space
          represetaiton is computed by:

               [A,b,c,d] = ssdata (G);
               T = obsv (A, c);
               G_ss = ss2ss (ss (G), T);
               initial (G_ss, x0);

          Note that, in general, the states of G_ss are only equal to the output
          y and its first n-1 time derivaties if u=0, which is the case for the
          initial conditions immediately before t=0.

     See also: impulse, initial, step.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Simulate LTI model response to arbitrary inputs.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 406
 -- Function File: test ltimodels
 -- Function File: ltimodels
 -- Function File: ltimodels (SYSTYPE)
     Test suite and help for LTI models.

     Some test are based on the SLICOT library
     (https://github.com/SLICOT/SLICOT-Reference), Copyright (c) 1996-2025,
     SLICOT, available under the BSD 3-Clause (License and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Test suite and help for LTI models.



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


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

     *Equations*
          AX + XA' + B = 0      (Lyapunov Equation)

          AX + XB + C = 0       (Sylvester Equation)

          AXE' + EXA' + B = 0   (Generalized Lyapunov Equation)

     *Algorithm*
     Uses SLICOT SB03MD SB04MD and SG03AD
     (https://github.com/SLICOT/SLICOT-Reference), Copyright (c) 1996-2025,
     SLICOT, available under the BSD 3-Clause (License and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).

     See also: lyapchol, dlyap, dlyapchol.


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



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


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

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

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

     *Algorithm*
     Uses SLICOT SB03OD and SG03BD (https://github.com/SLICOT/SLICOT-Reference),
     Copyright (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License
     and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).

     See also: lyap, dlyap, dlyapchol.


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



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


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

     *Inputs*
     MAG
          Magnitude value(s).  Both real-valued scalars and matrices are
          accepted.

     *Outputs*
     DB
          Decibel (dB) value(s).

     See also: db2mag.


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



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3104
 -- Function File: [GAMMA, PHI, W_GAMMA, W_PHI] = margin (SYS)
 -- Function File: [GAMMA, PHI, W_GAMMA, W_PHI] = margin (SYS, TOL)
     Gain and phase margin of a system.  If no output arguments are given, both
     gain and phase margin are plotted on a bode diagram.  Otherwise, the
     margins and their corresponding frequencies are computed and returned.  A
     more robust criterion to assess the stability of a feedback system is the
     sensitivity Ms computed by function ‘sensitivity’.

     *Inputs*
     SYS
          LTI model.  Must be a single-input and single-output (SISO) system.
     TOL
          Imaginary parts below TOL are assumed to be zero.  If not specified,
          default value ‘sqrt (eps)’ is taken.

     *Outputs*
     GAMMA
          Gain margin (as gain, not dBs).
     PHI
          Phase margin (in degrees).
     W_GAMMA
          Frequency for the gain margin (in rad/s).
     W_PHI
          Frequency for the phase margin (in rad/s).

     *Algorithm*
     Uses function ‘roots’ to calculate the frequencies W_GAMMA, W_PHI from
     special polynomials created from the transfer function of SYS as listed
     below in section «Equations».

     *Equations*
          CONTINUOUS-TIME SYSTEMS
          Gain Margin
                  _               _
          L(jw) = L(jw)      BTW: L(jw) = L(-jw) = conj (L(jw))

          num(jw)   num(-jw)
          ------- = --------
          den(jw)   den(-jw)

          num(jw) den(-jw) = num(-jw) den(jw)

          imag (num(jw) den(-jw)) = 0
          imag (num(-jw) den(jw)) = 0
          Phase Margin
                    |num(jw)|
          |L(jw)| = |-------| = 1
                    |den(jw)|
            _     2      2
          z z = Re z + Im z

          num(jw)   num(-jw)
          ------- * -------- = 1
          den(jw)   den(-jw)

          num(jw) num(-jw) - den(jw) den(-jw) = 0

          real (num(jw) num(-jw) - den(jw) den(-jw)) = 0
          DISCRETE-TIME SYSTEMS
          Gain Margin
                                       jwT         log z
          L(z) = L(1/z)      BTW: z = e    --> w = -----
                                                    j T
          num(z)   num(1/z)
          ------ = --------
          den(z)   den(1/z)

          num(z) den(1/z) - num(1/z) den(z) = 0
          Phase Margin
                   |num(z)|
          |L(z)| = |------| = 1
                   |den(z)|
          L(z) L(1/z) = 1

          num(z)   num(1/z)
          ------ * -------- = 1
          den(z)   den(1/z)

          num(z) num(1/z) - den(z) den(1/z) = 0
          PS: How to get L(1/z)
                    4       3       2
          p(z) = a z  +  b z  +  c z  +  d z  +  e

                      -4      -3      -2      -1
          p(1/z) = a z  +  b z  +  c z  +  d z  +  e

                    -4                    2       3       4
                 = z   ( a  +  b z  +  c z  +  d z  +  e z  )

                        4       3       2                     4
                 = ( e z  +  d z  +  c z  +  b z  +  a ) / ( z  )

     See also: sensitivity, roots.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Gain and phase margin of a system.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7368
 -- Function File: [K, N, GAMMA, INFO] = mixsyn (G, W1, W2, W3, ...)
     Solve stacked S/KS/T H-infinity problem.  Mixed-sensitivity is the name
     given to transfer function shaping problems in which the sensitivity
     function
                       -1
          S = (I + G K)
     is shaped along with one or more other closed-loop transfer functions such
     as K S or the complementary sensitivity function
                               -1
          T = I - S = (I + G K)
     in a typical one degree-of-freedom configuration, where G denotes the plant
     and K the (sub-)optimal controller to be found.  The shaping of
     multivariable transfer functions is based on the idea that a satisfactory
     definition of gain (range of gain) for a matrix transfer function is given
     by the singular values sigma of the transfer function.  Hence the classical
     loop-shaping ideas of feedback design can be generalized to multivariable
     systems.  In addition to the requirement that K stabilizes G, the
     closed-loop objectives are as follows [1]:

       1. For _disturbance rejection_ make
               sigma_h (S)
          small.
       2. For _noise attenuation_ make
               sigma_h (T)
          small.
       3. For _reference tracking_ make
               sigma_h(T) approx sigma_l(T) approx 1
       4. For _input usage (control energy) reduction_ make
               sigma_h (K S)
          small.
       5. For _robust stability_ in the presence of an additive perturbation
               Gp = G + Delta
          make
               sigma_h (K S)
          small.
       6. For _robust stability_ in the presence of a multiplicative output
          perturbation Gp = (I+ Delta) G make
               sigma_h (T)
          small.
     In order to find a robust controller for the so-called stacked S/KS/T
     H-infinity problem, the user function ‘mixsyn’ minimizes the following
     criterion
                                       | W1 S   |
          min || N(K) ||           N = | W2 K S |
           K            oo             | W3 T   |
     ‘[K, N] = mixsyn (G, W1, W2, W3)’.  The user-defined weighting functions
     W1, W2 and W3 bound the largest singular values of the closed-loop transfer
     functions S (for performance), K S (to penalize large inputs) and T (for
     robustness and to avoid sensitivity to noise), respectively [1].  A few
     points are to be considered when choosing the weights.  The weigths WI must
     all be proper and stable.  Therefore if one wishes, for example, to
     minimize S at low frequencies by a weighting W1 including integral action,
          1
          -
          s
     needs to be approximated by
            1
          -----    where   e << 1.
          s + e
     Similarly one might be interested in weighting K S with a non-proper weight
     W2 to ensure that K is small outside the system bandwidth.  The trick here
     is to replace a non-proper term such as
                          1 + T1 s
          1 + T1 s   by   --------,   where   T2 << T1.
                          1 + T2 s
     For more details, see [1], [2].

     *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.
     ...
          Optional arguments of ‘hinfsyn’.  Type ‘help hinfsyn’ for more
          information.

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

     *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.

     *Block Diagram*

                                              | W1 S   |
          gamma = min||N(K)||             N = | W2 K S | = lft (P, K)
                   K         inf              | W3 T   |

                                                        +------+ 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)  |<----+
                         +--------+

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

          Extended Plant:  P = augw (G, W1, W2, W3)
          Controller:      K = mixsyn (G, W1, W2, W3)
          Entire System:   N = lft (P, K)
          Open Loop:       L = G * K
          Closed Loop:     T = feedback (L)

     *Algorithm*
     Relies on functions augw and hinfsyn, which use SLICOT SB10FD, SB10DD and
     SB10AD (https://github.com/SLICOT/SLICOT-Reference), Copyright (c)
     1996-2025, SLICOT, available under the BSD 3-Clause (License and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).

     *References*
       1. Skogestad, S. and Postlethwaite I. (2005) ‘Multivariable Feedback
          Control: Analysis and Design: Second Edition’.  Wiley, Chichester,
          England.
       2. Meinsma, G. (1995) ‘Unstable and nonproper weights in H-infinity
          control’ Automatica, Vol.  31, No.  11, pp.  1655-1658

     See also: hinfsyn, augw.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Solve stacked S/KS/T H-infinity problem.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1709
 -- Function File: P = mktito (P, NMEAS, NCON)
     Partition LTI plant P for robust controller synthesis.  If a plant is
     partitioned this way, one can omit the inputs NMEAS and NCON when calling
     the functions ‘hinfsyn’ and ‘h2syn’.

     *Inputs*
     P
          Generalized plant.
     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/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.

     *Outputs*
     P
          Partitioned plant.  The input/output groups and names are overwritten
          with designations according to [1].

     *Block Diagram*

          min||N(K)||             N = lft (P, K)
           K         norm

                         +--------+
            w = u1 ----->|        |-----> z = y1
                         |  P(s)  |
            u = u2 +---->|        |-----+ y = y2
                   |     +--------+     |
                   |                    |
                   |     +--------+     |
                   +-----|  K(s)  |<----+
                         +--------+

                         +--------+
            w = u1 ----->|  N(s)  |-----> z = y1
                         +--------+

     *Reference*
       1. Skogestad, S. and Postlethwaite, I. (2005) ‘Multivariable Feedback
          Control: Analysis and Design: Second Edition’.  Wiley, Chichester,
          England.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Partition LTI plant P for robust controller synthesis.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5484
 -- Function File: [SYS, X0, INFO] = moen4 (DAT, ...)
 -- Function File: [SYS, X0, INFO] = moen4 (DAT, N, ...)
 -- Function File: [SYS, X0, INFO] = moen4 (DAT, OPT, ...)
 -- Function File: [SYS, X0, INFO] = moen4 (DAT, N, OPT, ...)
     Estimate state-space model using combined subspace method: MOESP algorithm
     for finding the matrices A and C, and N4SID algorithm for finding the
     matrices B and D. If no output arguments are given, the singular values are
     plotted on the screen in order to estimate the system order.

     *Inputs*
     DAT
          iddata set containing the measurements, i.e.  time-domain signals.
     N
          The desired order of the resulting state-space system SYS.  If not
          specified, N is chosen automatically according to the singular values
          and tolerances.
     ...
          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 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.
     INFO
          Struct containing additional information.
          INFO.K
               Kalman gain matrix.
          INFO.Q
               State covariance matrix.
          INFO.RY
               Output covariance matrix.
          INFO.S
               State-output cross-covariance matrix.
          INFO.L
               Noise variance matrix factor.  LL'=Ry.

     *Option Keys and Values*
     'N'
          The desired order of the resulting state-space system SYS.  S > N > 0.

     'S'
          The number of block rows S in the input and output block Hankel
          matrices to be processed.  S > 0.  In the MOESP theory, S should be
          larger than N, the estimated dimension of state vector.

     'ALG', 'ALGORITHM'
          Specifies the algorithm for computing the triangular factor R, as
          follows:
          'C'
               Cholesky algorithm applied to the correlation matrix of the
               input-output data.  Default method.
          'F'
               Fast QR algorithm.
          'Q'
               QR algorithm applied to the concatenated block Hankel matrices.

     'TOL'
          Absolute tolerance used for determining an estimate of the system
          order.  If TOL >= 0, the estimate is indicated by the index of the
          last singular value greater than or equal to TOL.  (Singular values
          less than TOL are considered as zero.)  When TOL = 0, an internally
          computed default value, TOL = S*EPS*SV(1), is used, where SV(1) is the
          maximal singular value, and EPS is the relative machine precision.
          When TOL < 0, the estimate is indicated by the index of the singular
          value that has the largest logarithmic gap to its successor.  Default
          value is 0.

     'RCOND'
          The tolerance to be used for estimating the rank of matrices.  If the
          user sets RCOND > 0, the given value of RCOND is used as a lower bound
          for the reciprocal condition number; an m-by-n matrix whose estimated
          condition number is less than 1/RCOND is considered to be of full
          rank.  If the user sets RCOND <= 0, then an implicitly computed,
          default tolerance, defined by RCOND = m*n*EPS, is used instead, where
          EPS is the relative machine precision.  Default value is 0.

     'CONFIRM'
          Specifies whether or not the user's confirmation of the system order
          estimate is desired, as follows:
          TRUE
               User's confirmation.
          FALSE
               No confirmation.  Default value.

     'NOISEINPUT'
          The desired type of noise input channels.
          'N'
               No error inputs.  Default value.
                    x[k+1] = A x[k] + B u[k]
                    y[k]   = C x[k] + D u[k]

          'E'
               Return SYS as a (p-by-m+p) state-space model with both measured
               input channels u and noise channels e with covariance matrix RY.
                    x[k+1] = A x[k] + B u[k] + K e[k]
                    y[k]   = C x[k] + D u[k] +   e[k]

          'V'
               Return SYS as a (p-by-m+p) state-space model with both measured
               input channels u and white noise channels v with identity
               covariance matrix.
                    x[k+1] = A x[k] + B u[k] + K L v[k]
                    y[k]   = C x[k] + D u[k] +   L v[k]
                    e = L v,  L L' = Ry

          'K'
               Return SYS as a Kalman predictor for simulation.
                    ^          ^                        ^
                    x[k+1] = A x[k] + B u[k] + K(y[k] - y[k])
                    ^          ^
                    y[k]   = C x[k] + D u[k]

                    ^               ^
                    x[k+1] = (A-KC) x[k] + (B-KD) u[k] + K y[k]
                    ^          ^
                    y[k]   = C x[k] + D u[k] + 0 y[k]

     *Algorithm*
     Uses IB01BD and IB01CD, Copyright (c) 1996-2025, SLICOT, available under
     the BSD 3-Clause (License and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Estimate state-space model using combined subspace method: MOESP algorithm fo...



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5415
 -- Function File: [SYS, X0, INFO] = moesp (DAT, ...)
 -- Function File: [SYS, X0, INFO] = moesp (DAT, N, ...)
 -- Function File: [SYS, X0, INFO] = moesp (DAT, OPT, ...)
 -- Function File: [SYS, X0, INFO] = moesp (DAT, N, OPT, ...)
     Estimate state-space model using MOESP algorithm.  MOESP: Multivariable
     Output Error State sPace.  If no output arguments are given, the singular
     values are plotted on the screen in order to estimate the system order.

     *Inputs*
     DAT
          iddata set containing the measurements, i.e.  time-domain signals.
     N
          The desired order of the resulting state-space system SYS.  If not
          specified, N is chosen automatically according to the singular values
          and tolerances.
     ...
          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 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.
     INFO
          Struct containing additional information.
          INFO.K
               Kalman gain matrix.
          INFO.Q
               State covariance matrix.
          INFO.RY
               Output covariance matrix.
          INFO.S
               State-output cross-covariance matrix.
          INFO.L
               Noise variance matrix factor.  LL'=Ry.

     *Option Keys and Values*
     'N'
          The desired order of the resulting state-space system SYS.  S > N > 0.

     'S'
          The number of block rows S in the input and output block Hankel
          matrices to be processed.  S > 0.  In the MOESP theory, S should be
          larger than N, the estimated dimension of state vector.

     'ALG', 'ALGORITHM'
          Specifies the algorithm for computing the triangular factor R, as
          follows:
          'C'
               Cholesky algorithm applied to the correlation matrix of the
               input-output data.  Default method.
          'F'
               Fast QR algorithm.
          'Q'
               QR algorithm applied to the concatenated block Hankel matrices.

     'TOL'
          Absolute tolerance used for determining an estimate of the system
          order.  If TOL >= 0, the estimate is indicated by the index of the
          last singular value greater than or equal to TOL.  (Singular values
          less than TOL are considered as zero.)  When TOL = 0, an internally
          computed default value, TOL = S*EPS*SV(1), is used, where SV(1) is the
          maximal singular value, and EPS is the relative machine precision.
          When TOL < 0, the estimate is indicated by the index of the singular
          value that has the largest logarithmic gap to its successor.  Default
          value is 0.

     'RCOND'
          The tolerance to be used for estimating the rank of matrices.  If the
          user sets RCOND > 0, the given value of RCOND is used as a lower bound
          for the reciprocal condition number; an m-by-n matrix whose estimated
          condition number is less than 1/RCOND is considered to be of full
          rank.  If the user sets RCOND <= 0, then an implicitly computed,
          default tolerance, defined by RCOND = m*n*EPS, is used instead, where
          EPS is the relative machine precision.  Default value is 0.

     'CONFIRM'
          Specifies whether or not the user's confirmation of the system order
          estimate is desired, as follows:
          TRUE
               User's confirmation.
          FALSE
               No confirmation.  Default value.

     'NOISEINPUT'
          The desired type of noise input channels.
          'N'
               No error inputs.  Default value.
                    x[k+1] = A x[k] + B u[k]
                    y[k]   = C x[k] + D u[k]

          'E'
               Return SYS as a (p-by-m+p) state-space model with both measured
               input channels u and noise channels e with covariance matrix RY.
                    x[k+1] = A x[k] + B u[k] + K e[k]
                    y[k]   = C x[k] + D u[k] +   e[k]

          'V'
               Return SYS as a (p-by-m+p) state-space model with both measured
               input channels u and white noise channels v with identity
               covariance matrix.
                    x[k+1] = A x[k] + B u[k] + K L v[k]
                    y[k]   = C x[k] + D u[k] +   L v[k]
                    e = L v,  L L' = Ry

          'K'
               Return SYS as a Kalman predictor for simulation.
                    ^          ^                        ^
                    x[k+1] = A x[k] + B u[k] + K(y[k] - y[k])
                    ^          ^
                    y[k]   = C x[k] + D u[k]

                    ^               ^
                    x[k+1] = (A-KC) x[k] + (B-KD) u[k] + K y[k]
                    ^          ^
                    y[k]   = C x[k] + D u[k] + 0 y[k]

     *Algorithm*
     Uses IB01BD and IB01CD, Copyright (c) 1996-2025, SLICOT, available under
     the BSD 3-Clause (License and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Estimate state-space model using MOESP algorithm.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5448
 -- Function File: [SYS, X0, INFO] = n4sid (DAT, ...)
 -- Function File: [SYS, X0, INFO] = n4sid (DAT, N, ...)
 -- Function File: [SYS, X0, INFO] = n4sid (DAT, OPT, ...)
 -- Function File: [SYS, X0, INFO] = n4sid (DAT, N, OPT, ...)
     Estimate state-space model using N4SID algorithm.  N4SID: Numerical
     algorithm for Subspace State Space System IDentification.  If no output
     arguments are given, the singular values are plotted on the screen in order
     to estimate the system order.

     *Inputs*
     DAT
          iddata set containing the measurements, i.e.  time-domain signals.
     N
          The desired order of the resulting state-space system SYS.  If not
          specified, N is chosen automatically according to the singular values
          and tolerances.
     ...
          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 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.
     INFO
          Struct containing additional information.
          INFO.K
               Kalman gain matrix.
          INFO.Q
               State covariance matrix.
          INFO.RY
               Output covariance matrix.
          INFO.S
               State-output cross-covariance matrix.
          INFO.L
               Noise variance matrix factor.  LL'=Ry.

     *Option Keys and Values*
     'N'
          The desired order of the resulting state-space system SYS.  S > N > 0.

     'S'
          The number of block rows S in the input and output block Hankel
          matrices to be processed.  S > 0.  In the MOESP theory, S should be
          larger than N, the estimated dimension of state vector.

     'ALG', 'ALGORITHM'
          Specifies the algorithm for computing the triangular factor R, as
          follows:
          'C'
               Cholesky algorithm applied to the correlation matrix of the
               input-output data.  Default method.
          'F'
               Fast QR algorithm.
          'Q'
               QR algorithm applied to the concatenated block Hankel matrices.

     'TOL'
          Absolute tolerance used for determining an estimate of the system
          order.  If TOL >= 0, the estimate is indicated by the index of the
          last singular value greater than or equal to TOL.  (Singular values
          less than TOL are considered as zero.)  When TOL = 0, an internally
          computed default value, TOL = S*EPS*SV(1), is used, where SV(1) is the
          maximal singular value, and EPS is the relative machine precision.
          When TOL < 0, the estimate is indicated by the index of the singular
          value that has the largest logarithmic gap to its successor.  Default
          value is 0.

     'RCOND'
          The tolerance to be used for estimating the rank of matrices.  If the
          user sets RCOND > 0, the given value of RCOND is used as a lower bound
          for the reciprocal condition number; an m-by-n matrix whose estimated
          condition number is less than 1/RCOND is considered to be of full
          rank.  If the user sets RCOND <= 0, then an implicitly computed,
          default tolerance, defined by RCOND = m*n*EPS, is used instead, where
          EPS is the relative machine precision.  Default value is 0.

     'CONFIRM'
          Specifies whether or not the user's confirmation of the system order
          estimate is desired, as follows:
          TRUE
               User's confirmation.
          FALSE
               No confirmation.  Default value.

     'NOISEINPUT'
          The desired type of noise input channels.
          'N'
               No error inputs.  Default value.
                    x[k+1] = A x[k] + B u[k]
                    y[k]   = C x[k] + D u[k]

          'E'
               Return SYS as a (p-by-m+p) state-space model with both measured
               input channels u and noise channels e with covariance matrix RY.
                    x[k+1] = A x[k] + B u[k] + K e[k]
                    y[k]   = C x[k] + D u[k] +   e[k]

          'V'
               Return SYS as a (p-by-m+p) state-space model with both measured
               input channels u and white noise channels v with identity
               covariance matrix.
                    x[k+1] = A x[k] + B u[k] + K L v[k]
                    y[k]   = C x[k] + D u[k] +   L v[k]
                    e = L v,  L L' = Ry

          'K'
               Return SYS as a Kalman predictor for simulation.
                    ^          ^                        ^
                    x[k+1] = A x[k] + B u[k] + K(y[k] - y[k])
                    ^          ^
                    y[k]   = C x[k] + D u[k]

                    ^               ^
                    x[k+1] = (A-KC) x[k] + (B-KD) u[k] + K y[k]
                    ^          ^
                    y[k]   = C x[k] + D u[k] + 0 y[k]

     *Algorithm*
     Uses IB01BD and IB01CD, Copyright (c) 1996-2025, SLICOT, available under
     the BSD 3-Clause (License and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Estimate state-space model using N4SID algorithm.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5258
 -- Function File: [K, N, GAMMA, INFO] = ncfsyn (G, W1, W2, FACTOR)
     Loop shaping H-infinity synthesis.  Compute positive feedback controller
     using the McFarlane/Glover loop shaping design procedure [1].  Using a
     precompensator W1 and/or a postcompensator W2, the singular values of the
     nominal plant G are shaped to give a desired open-loop shape.  The nominal
     plant G and shaping functions W1, W2 are combined to form the shaped plant,
     GS where ‘Gs = W2 G W1’.  We assume that W1 and W2 are such that GS
     contains no hidden modes.  It is relatively easy to approximate the
     closed-loop requirements by the following open-loop objectives [2]:

       1. For _disturbance rejection_ make
               sigma_l (W2 G W1)
          large; valid for frequencies at which
               sigma_l (Gs) >> 1.
       2. For _noise attenuation_ make
               sigma_h (W2 G W1)
          small; valid for frequencies at which
               sigma_h (Gs) << 1
       3. For _reference tracking_ make
               sigma_l (W2 G W1)
          large; valid for frequencies at which
               sigma_l (Gs) >> 1
       4. For _robust stability_ to a multiplicative output perturbation
               Gp = (I + Delta) G
          make
               sigma_h (W2 G W1)
          small; valid for frequencies at which
               sigma_h (Gs) << 1
     Then a stabilizing controller KS is synthesized for shaped plant GS.  The
     final positive feedback controller K is then constructed by combining the
          H-infinity
     controller KS with the shaping functions W1 and W2 such that ‘K = W1 Ks
     W2’.  In [1] is stated further that the given robust stabilization
     objective can be interpreted as a
          H-infinity
     problem formulation of minimizing the
          H-infinity
     norm of the frequency weighted gain from disturbances on the plant input
     and output to the controller input and output as follows:
                                        -1            -1            -1
          min || N(K) ||   ,    N = | W1   | (I - K G)   | W1   G W2   |
           K            oo          | W2 G |

     ‘[K, N] = ncfsyn (G, W1, W2, f)’ The function ‘ncfsyn’ - the somewhat
     cryptic name stands for _normalized coprime factorization synthesis_ -
     allows the specification of an additional argument, factor F.  Default
     value ‘f = 1’ implies that an optimal controller is required, whereas ‘f >
     1’ implies that a suboptimal controller is required, achieving a
     performance that is F times less than optimal.

     *Inputs*
     G
          LTI model of plant.
     W1
          LTI model of precompensator.  Model must be SISO or of appropriate
          size.  An identity matrix is taken if W1 is not specified or if an
          empty model ‘[]’ is passed.
     W2
          LTI model of postcompensator.  Model must be SISO or of appropriate
          size.  An identity matrix is taken if W2 is not specified or if an
          empty model ‘[]’ is passed.
     FACTOR
          ‘factor = 1’ implies that an optimal controller is required.  ‘factor
          > 1’ implies that a suboptimal controller is required, achieving a
          performance that is FACTOR times less than optimal.  Default value is
          1.

     *Outputs*
     K
          State-space model of the H-infinity loop-shaping controller.  Note
          that K is a _positive_ feedback controller.
     N
          State-space model of the closed loop depicted below.
     INFO
          Structure containing additional information.
     INFO.GAMMA
          L-infinity norm of N.  ‘gamma = norm (N, inf)’.
     INFO.EMAX
          Nugap robustness.  ‘emax = inv (gamma)’.
     INFO.GS
          Shaped plant.  ‘Gs = W2 * G * W1’.
     INFO.KS
          Controller for shaped plant.  ‘Ks = ncfsyn (Gs)’.
     INFO.RCOND
          Estimates of the reciprocal condition numbers of the Riccati equations
          and a few other things.  For details, see the description of the
          corresponding SLICOT routine.

     *Block Diagram of N*
                      ^ z1              ^ z2
                      |                 |
           w1  +      |   +--------+    |            +--------+
          ----->(+)---+-->|   Ks   |----+--->(+)---->|   Gs   |----+
                 ^ +      +--------+          ^      +--------+    |
                 |                        w2  |                    |
                 |                                                 |
                 +-------------------------------------------------+

     *Algorithm*
     Uses SB10KD and SB10ZD, Copyright (c) 1996-2025, SLICOT, available under
     the BSD 3-Clause (License and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).

     *References*
       1. D. McFarlane and K. Glover, ‘A Loop Shaping Design Procedure Using
          H-infinity Synthesis’, IEEE Transactions on Automatic Control, Vol.
          37, No.  6, June 1992.
       2. S. Skogestad and I. Postlethwaite, ‘Multivariable Feedback Control:
          Analysis and Design: Second Edition’.  Wiley, Chichester, England,
          2005.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Loop shaping H-infinity synthesis.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1345
 -- Function File: nichols (SYS)
 -- Function File: nichols (SYS1, SYS2, ..., SYSN)
 -- Function File: nichols (SYS1, SYS2, ..., SYSN, W)
 -- Function File: nichols (SYS1, 'STYLE1', ..., SYSN, 'STYLEN')
 -- Function File: [MAG, PHA, W] = nichols (SYS)
 -- Function File: [MAG, PHA, W] = nichols (SYS, W)
     Nichols chart of frequency response, plots gain over phase.  If no output
     arguments are given, the response is printed on the screen together with a
     grid of contours of constant close-loop magnitude and phase.

     *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: bode, nyquist, sigma.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
Nichols chart of frequency response, plots gain over phase.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1248
 -- Function File: nyquist (SYS)
 -- Function File: nyquist (SYS1, SYS2, ..., SYSN)
 -- Function File: nyquist (SYS1, SYS2, ..., SYSN, W)
 -- Function File: nyquist (SYS1, 'STYLE1', ..., SYSN, 'STYLEN')
 -- Function File: [RE, IM, W] = nyquist (SYS)
 -- Function File: [RE, IM, W] = nyquist (SYS, W)
     Nyquist 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*
     RE
          Vector of real parts.  Has length of frequency vector W.
     IM
          Vector of imaginary parts.  Has length of frequency vector W.
     W
          Vector of frequency values used.

     See also: bode, nichols, sigma.


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



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 448
 -- Function File: OB = obsv (SYS)
 -- Function File: OB = obsv (A, C)
     Return observability matrix.

     *Inputs*
     SYS
          LTI model.
     A
          State matrix (n-by-n).
     C
          Measurement matrix (p-by-n).

     *Outputs*
     OB
          Observability matrix.

     *Equation*
               | C        |
               | CA       |
          Ob = | CA^2     |
               | ...      |
               | CA^(n-1) |


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



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 923
 -- Function File: [SYSBAR, T, K] = obsvf (SYS)
 -- Function File: [SYSBAR, T, K] = obsvf (SYS, TOL)
 -- Function File: [ABAR, BBAR, CBAR, T, K] = obsvf (A, B, C)
 -- Function File: [ABAR, BBAR, CBAR, T, K] = obsvf (A, B, C, TOL)
     If Ob=obsv(A,C) has rank r <= n = SIZE(A,1), then there is a similarity
     transformation Tc such that To = [t1;t2] where t1 is c and t2 is orthogonal
     to t1

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

     and the transformed system has the form

                 | Ao     0 |           | Bo  |
          Abar = |----------|,   Bbar = | --- |,  Cbar = [Co | 0 ].
                 | A21   Ano|           | Bno |

     where (Ao,Bo) is observable, and Co(sI-Ao)^(-1)Bo = C(sI-A)^(-1)B. And
     system is detectable if Ano has no eigenvalues in the right half plane.
     The last output K is a vector of length n containing the number of
     observable states.


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



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3363
 -- Function File: optiPID  

     Numerical optimization of a PID controller using an objective function.

     The objective function is located in the file ‘optiPIDfun’.  Type ‘which
     optiPID’ to locate, ‘edit optiPID’ to open and simply ‘optiPID’ to run the
     example file.  In this example called ‘optiPID’, loosely based on [1], it
     is assumed that the plant
                            1
          P(s) = -----------------------
                 (s^2 + s + 1) (s + 1)^4
     is controlled by a PID controller with second-order roll-off
                           1                1
          C(s) = Kp (1 + ---- + Td s) -------------
                         Ti s         (tau s + 1)^2
     in the usual negative feedback structure
                   L(s)       P(s) C(s)
          T(s) = -------- = -------------
                 1 + L(s)   1 + P(s) C(s)
     The plant P(s) is of higher order but benign.  The initial values for the
     controller parameters Kp, Ti and Td are obtained by applying the Astroem
     and Haegglund rules [2].  These values are to be improved using a numerical
     optimization as shown below.  As with all numerical methods, this approach
     can never guarantee that a proposed solution is a global minimum.
     Therefore, good initial guesses for the parameters to be optimized are very
     important.  The Octave function ‘fminsearch’ minimizes the objective
     function J, which is chosen to be
                              inf
          J(Kp, Ti, Td) = mu1 INT t |e(t)| dt  +  mu2 (||y(t)||    - 1)  +  mu3 ||S(jw)||
                               0                               inf                       inf
     This particular objective function penalizes the integral of time-weighted
     absolute error
                 inf
          ITAE = INT t |e(t)| dt
                  0
     and the maximum overshoot
          y    - 1 = ||y(t)||    - 1
           max               inf
     to a unity reference step in the time domain.  In the frequency domain, the
     sensitivity
          Ms = ||S(jw)||
                        inf
     is minimized for good robustness, where S(s) denotes the _sensitivity_
     transfer function
                     1            1
          S(s) = -------- = -------------
                 1 + L(s)   1 + P(s) C(s)
     The constants mu1, mu2 and mu3 are _relative weighting factors_ or «tuning
     knobs» which reflect the importance of the different design goals.  Varying
     these factors corresponds to changing the emphasis from, say, high
     performance to good robustness.  The main advantage of this approach is the
     possibility to explore the tradeoffs of the design problem in a systematic
     way.  In a first approach, all three design objectives are weigthed
     equally.  In subsequent iterations, the parameters mu1 = 1, mu2 = 10 and
     mu3 = 20 are found to yield satisfactory closed-loop performance.  This
     controller results in a system with virtually no overshoot and a phase
     margin of 64 degrees.


     *References*
       1. Guzzella, L. ‘Analysis and Design of SISO Control Systems’, VDF
          Hochschulverlag, ETH Zurich, 2007
       2. Astroem, K. and Haegglund, T. ‘PID Controllers: Theory, Design and
          Tuning’, Second Edition, Instrument Society of America, 1995


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 71
Numerical optimization of a PID controller using an objective function.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
optiPIDctrl


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 397
 ===============================================================================
 optiPIDctrl                      Lukas Reichlin                   February 2012
 ===============================================================================
 Return PID controller with roll-off for given parameters Kp, Ti and Td.
 ===============================================================================



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 ============================================================================...



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 464
 ===============================================================================
 optiPIDfun                       Lukas Reichlin                       July 2009
 ===============================================================================
 Objective Function
 Reference: Guzzella, L. (2007) Analysis and Synthesis of SISO Control Systems.
            vdf Hochschulverlag, Zurich
 ===============================================================================



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 ============================================================================...



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 915
 -- Function File: OPT = options ('KEY1', VALUE1, 'KEY2', VALUE2, ...)
     Create options struct OPT from a number of key and value pairs.  For use
     with order reduction and system identification functions.  Option structs
     are a way to avoid typing the same key and value pairs over and over again.

     *Inputs*
     KEY, PROPERTY
          The name of the property.
     VALUE
          The value of the property.

     *Outputs*
     OPT
          Struct with fields for each key.

     *Example*
          octave:1> opt = options ("method", "spa", "tol", 1e-6)
          opt =

            scalar structure containing the fields:

              method = spa
              tol =  1.0000e-06

          octave:2> save filename opt
          octave:3> # save the struct 'opt' to file 'filename' for later use
          octave:4> load filename
          octave:5> # load struct 'opt' from file 'filename'


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
Create options struct OPT from a number of key and value pairs.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2267
 -- Function File: pade (T, N)
 -- Function File: pade (T, N, M)
 -- Function File: pade (T, N1, M1, N2, M2, ..., NK, MK)
 -- Function File: SYS = pade (...)
 -- Function File: SYS = pade (...)
 -- Function File: [NUM, DEN] = pade (...)
 -- Function File: [NUM, DEN] = pade (...)

     Calculate Padé approximation of a dead-time by zeros and poles

     *Inputs*
     T
          Dead-time to be approximated.
     N
          Number of poles of the approximations.
     M
          Number of zeros of the approximation, If omitted, the number of zeros
          is the same as the number N of poles.

     More then one approximation can be requested by providing the pairs pairs
     N1, M1, N2, M2, ..., NK, MK.

     *Outputs*
     SYS
          LTI system with the poles and zeros of the Padé approximation.  SYS is
          given as transfer function.  If more than one approximation is
          requested, SYS is a cell array of LTI systems.
     NUM
          Numerator polynomial of the resulting transfer function.  If more than
          one approximation is requested, NUM is a cell array of numerator
          polynomials.
     DEN
          Denominator polynomial of the resulting transfer function.  If more
          than one approximation is requested, DEN is a cell array of
          denominator polynomials.

     If no output argument is requested, the step response and the bode diagram
     of the approximatons with orders N1, M1 to NK, NK are plotted togehter with
     step delayed by the given dead-time T.

     When using the same numbers of poles and zeros (M = N), the step response
     of the resulting approximation shows a step at t = 0 which is untypical for
     a pure time delay.  However, it has a magnitude of 1 (0 dB) over all
     frequencies.  In [1], an approximaton having less zeros than poles (M < N)
     is suggested as an alternative approach, resulting in a better step
     response but decresing magnitude for higher frequencies.

     Algorithm based on:
       1. Vajta, M. (2000).  Some remarks on Pade-approximations, pp53-58, Paper
          presented at 3rd TEMPUS-INTCOM Symposium on Intelligent Systems in
          Control and Measurements 2000, Veszprém, Hungary.

     See also: @@tf/tf, thiran.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
Calculate Padé approximation of a dead-time by zeros and poles




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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 471
 -- Function File: C = pid (KP)
 -- Function File: C = pid (KP, KI)
 -- Function File: C = pid (KP, KI, KD)
 -- Function File: C = pid (KP, KI, KD, TF)
 -- Function File: C = pid (KP, KI, KD, TF, TS)
     Return the transfer function C of the PID controller in parallel form with
     first-order roll-off.  With a valid TS a discrete-time system is created.

                       Ki      Kd s
          C(s) = Kp + ---- + --------
                       s     Tf s + 1


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Return the transfer function C of the PID controller in parallel form with
fi...



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 397
 -- Function File: C = pidstd (KP)
 -- Function File: C = pidstd (KP, TI)
 -- Function File: C = pidstd (KP, TI, TD)
 -- Function File: C = pidstd (KP, TI, TD, N)
     Return the transfer function C of the PID controller in standard form with
     first-order roll-off.

                          1        Td s
          C(s) = Kp (1 + ---- + ----------)
                         Ti s   Td/N s + 1


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Return the transfer function C of the PID controller in standard form with
fi...



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2163
 -- Function File: F = place (SYS, P)
 -- Function File: F = place (A, B, P)
 -- Function File: [F, INFO] = place (SYS, P, ALPHA)
 -- Function File: [F, INFO] = place (A, B, P, ALPHA)

     Pole assignment for a given matrix pair (A,B) such that ‘p = eig (A-B*F)’.
     If parameter ALPHA is specified, poles with real parts (continuous-time) or
     moduli (discrete-time) below ALPHA are left untouched.

     *Inputs*
     SYS
          Continuous- or discrete-time LTI system.
     A
          State matrix (n-by-n) of a continuous-time system.
     B
          Input matrix (n-by-m) of a continuous-time system.
     P
          Desired eigenvalues of the closed-loop system state-matrix A-B*F.
          ‘length (p) <= rows (A)’.
     ALPHA
          Specifies the maximum admissible value, either for real parts or for
          moduli, of the eigenvalues of A which will not be modified by the
          eigenvalue assignment algorithm.  ‘alpha >= 0’ for discrete-time
          systems.

     *Outputs*
     F
          State feedback gain matrix.
     INFO
          Structure containing additional information.
     INFO.NFP
          The number of fixed poles, i.e.  eigenvalues of A having real parts
          less than ALPHA, or moduli less than ALPHA.  These eigenvalues are not
          modified by ‘place’.
     INFO.NAP
          The number of assigned eigenvalues.  ‘nap = n-nfp-nup’.
     INFO.NUP
          The number of uncontrollable eigenvalues detected by the eigenvalue
          assignment algorithm.
     INFO.Z
          The orthogonal matrix Z reduces the closed-loop system state matrix ‘A
          + B*F’ to upper real Schur form.  Note the positive sign in ‘A + B*F’.

     *Note*
          Place is also suitable to design estimator gains:
          L = place (A.', C.', p).'
          L = place (sys.', p).'   # useful for discrete-time systems

     *Algorithm*
     Uses SLICOT SB01BD (https://github.com/SLICOT/SLICOT-Reference), Copyright
     (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License and
     Disclaimer (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 82
Pole assignment for a given matrix pair (A,B) such that ‘p = eig (A-B*F)’.  If



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 484
 -- Function File: P = pole (SYS)
     Compute poles of LTI system.

     *Inputs*
     SYS
          LTI model.

     *Outputs*
     P
          Poles of SYS.

     *Algorithm*
     For (descriptor) state-space models and system/state matrices, ‘pole’
     relies on Octave's ‘eig’.  For SISO transfer functions, ‘pole’ uses
     Octave's ‘roots’.  MIMO transfer functions are converted to a _minimal_
     state-space representation for the computation of the poles.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Compute poles of LTI system.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 828
 -- Function File: pzmap (SYS)
 -- Function File: pzmap (SYS1, SYS2, ..., SYSN)
 -- Function File: pzmap (SYS1, 'STYLE1', ..., SYSN, 'STYLEN')
 -- Function File: [P, Z] = pzmap (SYS)
     Plot the poles and zeros of an LTI system in the complex plane.  If no
     output arguments are given, the result is plotted on the screen.
     Otherwise, the poles and zeros are computed and returned.  Note that only
     one system is processed when output arguments are given.

     *Inputs*
     SYS, SYS1, ...
          LTI model(s).
     'STYLE'
          Color, e.g.  'r' for a red.  See ‘help plot’ for details.  Marker or
          line styles are ignored as poles and zeros have the fixed marker types
          'x' and 'o' repectively.

     *Outputs*
     P
          Poles of SYS.
     Z
          Invariant zeros of SYS.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
Plot the poles and zeros of an LTI system in the complex plane.



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


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

          r(t) = t * h(t)

     *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: impulse, initial, lsim, step.


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



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 364
 -- Function File: REG = reg (SYS, K, L)
     Form regulator from state-feedback and estimator gains

     *Inputs*
     SYS
          State-space model of the plant
     K
          State-feedback gain
     L
          Estimator gain

     *Outputs*
     REG
          Dynamic compensator.  Connect with positive feedback.

     *Equations*

     See also: place.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Form regulator from state-feedback and estimator gains



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 357
 -- Function File: RSYS = repsys (SYS, M, N)
 -- Function File: RSYS = repsys (SYS, [M, N])
 -- Function File: RSYS = repsys (SYS, M)
     Form a block transfer matrix of SYS with M copies vertically and N copies
     horizontally.  If N is not specified, it is set to M.  ‘repsys (sys, 2, 3)’
     is equivalent to ‘[sys, sys, sys; sys, sys, sys]’.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Form a block transfer matrix of SYS with M copies vertically and N copies
hor...



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 925
 -- Function File: rlocus (SYS)
 -- Function File: [RLDATA, K] = rlocus (SYS, INCREMENT, MIN_K, MAX_K)
     Display root locus plot of the specified SISO system.

     *Inputs*
     SYS
          LTI model.  Must be a single-input and single-output (SISO) system.
     INCREMENT
          The increment used in computing gain values.
     MIN_K
          Minimum value of K.
     MAX_K
          Maximum value of K.

     *Outputs*
     RLDATA
          Data points plotted: in column 1 real values, in column 2 the
          imaginary values.
     K
          Gains for real axis break points.

     *Block Diagram*
           u    +         +---+      +------+             y
          ------>(+)----->| k |----->| SISO |-------+------->
                  ^ -     +---+      +------+       |
                  |                                 |
                  +---------------------------------+

     See also: rlocusx.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Display root locus plot of the specified SISO system.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2134
 -- Function File: rlocusx (SYS)
 -- Function File: rlocusx (SYS, INCREMENT, MIN_K, MAX_K)
 -- Function File: rlocusx (SYS, K_VEC)

     Interactive root locus plot of the specified SISO system SYS.

     This functions directly calls rlocus() from the control package which must
     be installed and loaded.  In contrast to rlocus(), mouse clicks on the root
     locus display the related gain and all other poles resulting from this gain
     together with damping and frequency of conjugate complex pole pairs.
     All possible interaction by mouse clicks or keys are:

     Left click: Gain, damping and Frequency
          Displays related gain and all resulting closed loop poles together
          with damping and frequency
     ‘s’: Step response
          Simulates the step response for the gain of of the most recently
          selected pole locations
     ‘i’: Impulse response
          Simulates the impulse response for the most recently selected gain
     ‘b’: Bode plot
          Provides the open loop bode plot for the most recently selected gain
     ‘m’: Stability margins
          Provides the open loop bode plot with stability margins for the most
          recently selected gain
     ‘a’: All plots
          Provide sall four aforementioned plots
     ‘c’: Clear
          Removes all closed loop pole markers and annotations
     ‘d’: Delete
          Removes all open figures with simulation and bode plots
     ‘x’: Exit
          Exits the interactive mode and re-activates the octave prompt

     There are no output parameters.

     *Inputs*
     SYS
          LTI model.  Must be a single-input and single-output (SISO) system.
     INCREMENT
          The increment used in computing gain values.
     MIN_K
          Minimum value of K.
     MAX_K
          Maximum value of K.
     K_VEC
          Vector of values for gain values K.

     *Outputs*

     Plots the interactive root locus to the screen.
     Unlike rlocus(), this function does not have any output parameters.  For
     output parameters please directly use rlocus().

     See also: rlocus.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Interactive root locus plot of the specified SISO system SYS.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
sensitivity


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1966
 -- Function File: [MS, WS] = sensitivity (L)
 -- Function File: [MS, WS] = sensitivity (P, C)
 -- Function File: [MS, WS] = sensitivity (P, C1, C2, ...)
     Return sensitivity margin MS.  The quantity MS is simply the inverse of the
     shortest distance from the Nyquist curve to the critical point -1.
     Reasonable values of MS are in the range from 1.3 to 2.
          Ms = ||S(jw)||
                        inf
     If no output arguments are given, the critical distance 1/Ms is plotted on
     a Nyquist diagram.  In contrast to gain and phase margin as computed by
     function ‘margin’, the sensitivity MS is a more robust criterion to assess
     the stability of a feedback system.

     *Inputs*
     L
          Open loop transfer function.  L can be any type of LTI system, but it
          must be square.
     P
          Plant model.  Any type of LTI system.
     C
          Controller model.  Any type of LTI system.
     C1, C2, ...
          If several controllers are specified, function ‘sensitivity’ computes
          the sensitivity MS for each of them in combination with plant P.

     *Outputs*
     MS
          Sensitivity margin MS as defined in [1].  Scalar value.  If several
          controllers are specified, MS becomes a row vector with as many
          entries as controllers.
     WS
          The frequency [rad/s] corresponding to the sensitivity peak.  Scalar
          value.  If several controllers are specified, WS becomes a row vector
          with as many entries as controllers.

     *Algorithm*
     Uses SLICOT AB13DD (https://github.com/SLICOT/SLICOT-Reference), Copyright
     (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License and
     Disclaimer (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).

     *References*
       1. Aström, K. and Hägglund, T. (1995) PID Controllers: Theory, Design and
          Tuning, Second Edition.  Instrument Society of America.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Return sensitivity margin MS.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1477
 -- Function File: sgrid  
 -- Function File: sgrid on
 -- Function File: sgrid off
 -- Function File: sgrid (Z, W)
 -- Function File: sgrid (HAX, ...)

     Display an grid in the complex s-plane.

     Control the display of s-plane grid with :
        • zeta lines corresponding to damping ratios and
        • omega circles corresponding to undamped natural frequencies

     The function state input may be either "on" or "off" for creating or
     removing the grid.  If omitted, a new grid is created when it does not
     exist or the visibility of the current grid is toggled.

     The sgrid will automatically plot the grid lines at nice values or at
     constant values specified by two arguments :

          sgrid (Z, W)

     where Z and W are :
        • Z vector of constant zeta values to plot as lines
        • W vector of constant omega values to plot as circles

     Example of usage:
          sgrid on	create the s-plane grid
          sgrid off 	remove the s-plane grid
          sgrid		toggle the s-plane grid visibility
          sgrid ([0.3, 0.8, ...], [10, 75, ...])   create:
                        zeta lines for 0.3, 0.8, ...
                        omega circles for 10, 75, ... [rad/s]
          sgrid off; sgrid  remove current s-grid and
                            draw new with default values
          sgrid (HAX, "on")   create the s-plane grid for the axis
                              handle HAX

     See also: grid,zgrid.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Display an grid in the complex s-plane.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1389
 -- Function File: sigma (SYS)
 -- Function File: sigma (SYS1, SYS2, ..., SYSN)
 -- Function File: sigma (SYS1, SYS2, ..., SYSN, W)
 -- Function File: sigma (SYS1, 'STYLE1', ..., SYSN, 'STYLEN')
 -- Function File: [SV, W] = sigma (SYS)
 -- Function File: [SV, W] = sigma (SYS, W)
     Singular values of frequency response.  If no output arguments are given,
     the singular value plot is printed on the screen.

     *Inputs*
     SYS
          LTI system.  Multiple inputs and/or outputs (MIMO systems) make
          practical sense.
     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*
     SV
          Array of singular values.  For a system with m inputs and p outputs,
          the array sv has ‘min (m, p)’ rows and as many columns as frequency
          points ‘length (w)’.  The singular values at the frequency ‘w(k)’ are
          given by ‘sv(:,k)’.
     W
          Vector of frequency values used.

     See also: bodemag, svd.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Singular values of frequency response.



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


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

     Controller reduction by frequency-weighted Singular Perturbation
     Approximation (SPA). 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', 'S'
               Use the square-root Singular Perturbation Approximation method.
          'BFSR', 'P'
               Use the balancing-free square-root Singular Perturbation
               Approximation 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 (https://github.com/SLICOT/SLICOT-Reference), Copyright
     (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License and
     Disclaimer (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Controller reduction by frequency-weighted Singular Perturbation Approximatio...



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


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

     Model order reduction by frequency weighted Singular Perturbation
     Approximation (SPA). 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.

     SPA 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', 'S'
               Use the square-root Singular Perturbation Approximation method.
          'BFSR', 'P'
               Use the balancing-free square-root Singular Perturbation
               Approximation 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.  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.

     *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 (https://github.com/SLICOT/SLICOT-Reference), Copyright
     (c) 1996-2025, SLICOT, available under the BSD 3-Clause (License and
     Disclaimer (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Model order reduction by frequency weighted Singular Perturbation Approximati...



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1002
 -- Function File: [A, B, C, D, TSAM] = ssdata (SYS)

     Access state-space model data.  Argument SYS is not limited to state-space
     models.  If SYS is not a state-space model, it is converted automatically.
     SYS can also be a real-valued matrix which is then interpreted as
     continuous-time static gain system.

     *Inputs*
     SYS
          Any type of LTI model or a real-valued matrix which is interpreted as
          continous-time static gain.

     *Outputs*
     A
          State matrix (n-by-n).
     B
          Input matrix (n-by-m).
     C
          Measurement matrix (p-by-n).
     D
          Feedthrough matrix (p-by-m).
     TSAM
          Sampling time in seconds.  If SYS is a continuous-time model, a zero
          is returned.

     *Compatibility issue*

     If SYS is given by an input-output description, like, e.g., a transfer
     function, the resulting state-space model has a different form than the one
     provided by Matlab, see @ss/ss for details.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Access state-space model data.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1659
 -- Function File: step (SYS)
 -- Function File: step (SYS1, SYS2, ..., SYSN)
 -- Function File: step (SYS1, 'STYLE1', ..., SYSN, 'STYLEN')
 -- Function File: step (SYS1, ..., T)
 -- Function File: step (SYS1, ..., TFINAL)
 -- Function File: step (SYS1, ..., TFINAL, DT)
 -- Function File: [Y, T, X] = step (SYS)
 -- Function File: [Y, T, X] = step (SYS, T)
 -- Function File: [Y, T, X] = step (SYS, TFINAL)
 -- Function File: [Y, T, X] = step (SYS, TFINAL, DT)
     Step 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: impulse, initial, lsim.


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



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 248
 -- Function File: STRVEC = strseq (STR, IDX)
     Return a cell vector of indexed strings by appending the indices IDX to the
     string STR.

          strseq ("x", 1:3) = {"x1"; "x2"; "x3"}
          strseq ("u", [1, 2, 5]) = {"u1"; "u2"; "u5"}


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Return a cell vector of indexed strings by appending the indices IDX to the
s...



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 831
 -- Function File: S = sumblk (FORMULA)
 -- Function File: S = sumblk (FORMULA, N)
     Create summing junction S from string FORMULA for name-based
     interconnections.

     *Inputs*
     FORMULA
          String containing the formula of the summing junction, e.g.  ‘e = r -
          y + d’
     N
          Signal size.  Default value is 1.

     *Outputs*
     S
          State-space model of the summing junction.

     *Example*
          octave:1> S = sumblk ('e = r - y + d')

          S.d =
                 r   y   d
             e   1  -1   1

          Static gain.
          octave:2> S = sumblk ('e = r - y + d', 2)

          S.d =
                 r1  r2  y1  y2  d1  d2
             e1   1   0  -1   0   1   0
             e2   0   1   0  -1   0   1

          Static gain.

     See also: @@lti/connect.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 78
Create summing junction S from string FORMULA for name-based interconnections.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1208
 -- Script File: test_control
     Execute all available tests at once.

     The Octave control package uses the Uses SLICOT library
     (https://github.com/SLICOT/SLICOT-Reference), Copyright (c) 1996-2025,
     SLICOT, available under the BSD 3-Clause (License and Disclaimer
     (https://github.com/SLICOT/SLICOT-Reference/blob/main/LICENSE)).  SLICOT
     needs BLAS and LAPACK libraries which are also prerequisites for Octave
     itself.  In case of failing tests, it is highly recommended to use Netlib's
     reference BLAS (http://www.netlib.org/blas/) and LAPACK
     (http://www.netlib.org/lapack/) for building Octave.  Using ATLAS may lead
     to sign changes in some entries of the state-space matrices.  In general,
     these sign changes are not 'wrong' and can be regarded as the result of
     state transformations.  Such state transformations (but not input/output
     transformations) have no influence on the input-output behaviour of the
     system.  For better numerics, the control package uses such transformations
     by default when calculating the frequency responses and a few other things.
     However, arguments like the Hankel singular Values (HSV) must not change.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Execute all available tests at once.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1622
 -- Function File: [NUM, DEN, TSAM] = tfdata (SYS)
 -- Function File: [NUM, DEN, TSAM] = tfdata (SYS, "VECTOR")
 -- Function File: [NUM, DEN, TSAM] = tfdata (SYS, "TFPOLY")

     Access transfer function data.  Argument SYS is not limited to transfer
     function models.  If SYS is not a transfer function, it is converted
     automatically.  SYS can also be a real-valued gain matrix which is then
     interpreted as static gain system.

     *Inputs*
     SYS
          Any type of LTI model or a real-valued matrix which is interpreted as
          continous-time static gain.
     "V", "VECTOR"
          For SISO models, return NUM and DEN directly as column vectors instead
          of cells containing a single column vector.
     "T", "TFPOLY"
          Return the polynomials as tfpoly class.

     *Outputs*
     NUM
          Cell of numerator(s).  Each numerator is a row vector containing the
          coefficients of the polynomial in descending powers of the transfer
          function variable.  num{i,j} contains the numerator polynomial from
          input j to output i.  In the SISO case, a single vector is possible as
          well.
     DEN
          Cell of denominator(s).  Each denominator is a row vector containing
          the coefficients of the polynomial in descending powers of the
          transfer function variable.  den{i,j} contains the denominator
          polynomial from input j to output i.  In the SISO case, a single
          vector is possible as well.
     TSAM
          Sampling time in seconds.  If SYS is a continuous-time model, a zero
          is returned.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Access transfer function data.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 313
 -- Function File: STR = tfpoly2str (P)
 -- Function File: STR = tfpoly2str (P, TFVAR)
     Return the string of polynomial vector P with string TFVAR^-1 as variable.
     Note that there is an almost identical function for the ‘tfpoly’ class
     which returns a string with TFVAR (not TFVAR^-1) as variable.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 74
Return the string of polynomial vector P with string TFVAR^-1 as variable.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
Return (pxm) cell of tfpoly([1]).  For internal use only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Return (pxm) cell of tfpoly([1]).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
tfpolyzeros


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
Return (pxm) cell of tfpoly([0]).  For internal use only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Return (pxm) cell of tfpoly([0]).



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1430
 -- Function File: SYS = thiran (T, TS)

     Approximation of continuous-time delay using a discrete-time allpass Thiran
     filter.

     Thiran filters can approximate continuous-time delays that are non-integer
     multiples of the sampling time (fractional delays).  This approximation
     gives a better matching of the phase shift between the continuous- and the
     discrete-time system.  If there is no fractional part in the delay, then
     the standard discrete-time delay representation is used.

     *Inputs*
     T
          A continuous-time delay, given in time units (seconds).
     TS
          The sampling time of the resulting Thiran filter.

     *Outputs*
     SYS
          Transfer function model of the resulting filter.  The order of the
          filter is determined automatically.

     *Example*
          octave:1> sys = thiran (1.33, 0.5)

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

                0.003859 z^3 - 0.03947 z^2 + 0.2787 z + 1
           y1:  -----------------------------------------
                 z^3 + 0.2787 z^2 - 0.03947 z + 0.003859

          Sampling time: 0.5 s
          Discrete-time model.
          octave:2> sys = thiran (1, 0.5)

          Transfer function 'sys' from input 'u1' to output ...
                 1
           y1:  ---
                z^2

          Sampling time: 0.5 s
          Discrete-time model.

     See also: pade.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Approximation of continuous-time delay using a discrete-time allpass Thiran
f...



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1384
 -- Function File: zgrid  
 -- Function File: zgrid on
 -- Function File: zgrid off
 -- Function File: zgrid (Z, W)
 -- Function File: zgrid (HAX, ...)
     Display an grid in the complex z-plane.

     Control the display of z-plane grid with :
        • zeta lines corresponding to damping ratios and
        • omega lines corresponding to undamped natural frequencies

     The function state input may be either "on" or "off" for creating or
     removing the grid.  If omitted, a new grid is created when it does not
     exist or the visibility of the current grid is toggled.

     The zgrid will automatically plot the grid lines at nice values or at
     constant values specified by two arguments :

          zgrid (Z, W)

     where Z and W are :
        • Z vector of constant zeta values to plot as lines
        • W vector of constant omega values to plot as circles

     Example of usage:
          zgrid on	  create the z-plane grid
          zgrid off 	remove the z-plane grid
          zgrid		  toggle the z-plane grid visibility
          zgrid ([0.3, 0.8, ...], [0.25*pid, 0.5*pi, ...])   create:
                  • zeta lines for 0.3, 0.8, ...
                  • omega lines for 0.25*pi/T, 0.5*pi/T, ... [rad/s]
          zgrid (HAX, "on")   create the z-plane grid for the axis
                              handle HAX

     See also: grid,sgrid.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Display an grid in the complex z-plane.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1395
 -- Function File: S = zpk ('S')
 -- Function File: Z = zpk ('Z', TSAM)
 -- Function File: SYS = zpk (SYS)
 -- Function File: SYS = zpk (K, ...)
 -- Function File: SYS = zpk (Z, P, K, ...)
 -- Function File: SYS = zpk (Z, P, K, TSAM, ...)
 -- Function File: SYS = zpk (Z, P, K, TSAM, ...)
     Create transfer function model from zero-pole-gain data.  This is just a
     stop-gap compatibility wrapper since zpk models are not yet implemented.

     *Inputs*
     SYS
          LTI model to be converted to transfer function.
     Z
          Cell of vectors containing the zeros for each channel.  z{i,j}
          contains the zeros from input j to output i.  In the SISO case, a
          single vector is accepted as well.
     P
          Cell of vectors containing the poles for each channel.  p{i,j}
          contains the poles from input j to output i.  In the SISO case, a
          single vector is accepted as well.
     K
          Matrix containing the gains for each channel.  k(i,j) contains the
          gain from input j to output i.
     TSAM
          Sampling time in seconds.  If TSAM is not specified, a continuous-time
          model is assumed.
     ...
          Optional pairs of properties and values.  Type ‘set (tf)’ for more
          information.

     *Outputs*
     SYS
          Transfer function model.

     See also: @@tf/tf, @@ss/ss, dss, @@frd/frd.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
Create transfer function model from zero-pole-gain data.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1077
 -- Function File: [Z, P, K, TSAM] = zpkdata (SYS)
 -- Function File: [Z, P, K, TSAM] = zpkdata (SYS, "V")

     Access zero-pole-gain data.  SYS can also be a real-valued matrix which is
     then interpreted as continuous-time static gain system.

     *Inputs*
     SYS
          Any type of LTI model or a real-valued matrix which is interpreted as
          continous-time static gain.
     "V", "VECTOR"
          For SISO models, return Z and P directly as column vectors instead of
          cells containing a single column vector.

     *Outputs*
     Z
          Cell of column vectors containing the zeros for each channel.  z{i,j}
          contains the zeros from input j to output i.
     P
          Cell of column vectors containing the poles for each channel.  p{i,j}
          contains the poles from input j to output i.
     K
          Matrix containing the gains for each channel.  k(i,j) contains the
          gain from input j to output i.
     TSAM
          Sampling time in seconds.  If SYS is a continuous-time model, a zero
          is returned.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Access zero-pole-gain data.





