## SB10FD

### H-infinity (sub)optimal state controller for a continuous-time system

[Specification] [Arguments] [Method] [References] [Comments] [Example]

Purpose

      To compute the matrices of an H-infinity (sub)optimal n-state
      controller

               | AK | BK |
           K = |----|----|,
               | CK | DK |

      using modified Glover's and Doyle's 1988 formulas, for the system

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

      and for a given value of gamma, where B2 has as column size the
      number of control inputs (NCON) and C2 has as row size the number
      of measurements (NMEAS) being provided to the controller.

      It is assumed that

      (A1) (A,B2) is stabilizable and (C2,A) is detectable,

      (A2) D12 is full column rank and D21 is full row rank,

      (A3) | A-j*omega*I  B2  | has full column rank for all omega,
           |    C1        D12 |

      (A4) | A-j*omega*I  B1  |  has full row rank for all omega.
           |    C2        D21 |

Specification

          SUBROUTINE SB10FD( N, M, NP, NCON, NMEAS, GAMMA, A, LDA, B, LDB,
         $                   C, LDC, D, LDD, AK, LDAK, BK, LDBK, CK, LDCK,
         $                   DK, LDDK, RCOND, TOL, IWORK, DWORK, LDWORK,
         $                   BWORK, INFO )
    C     .. Scalar Arguments ..
          INTEGER            INFO, LDA, LDAK, LDB, LDBK, LDC, LDCK, LDD,
         $                   LDDK, LDWORK, M, N, NCON, NMEAS, NP
          DOUBLE PRECISION   GAMMA, TOL
    C     .. Array Arguments ..
          LOGICAL            BWORK( * )
          INTEGER            IWORK( * )
          DOUBLE PRECISION   A( LDA, * ), AK( LDAK, * ), B( LDB, * ),
         $                   BK( LDBK, * ), C( LDC, * ), CK( LDCK, * ),
         $                   D( LDD, * ), DK( LDDK, * ), DWORK( * ),
         $                   RCOND( 4 )

Arguments

Input/Output Parameters

      N       (input) INTEGER
              The order of the system.  N >= 0.

      M       (input) INTEGER
              The column size of the matrix B.  M >= 0.

      NP      (input) INTEGER
              The row size of the matrix C.  NP >= 0.

      NCON    (input) INTEGER
              The number of control inputs (M2).  M >= NCON >= 0,
              NP-NMEAS >= NCON.

      NMEAS   (input) INTEGER
              The number of measurements (NP2).  NP >= NMEAS >= 0,
              M-NCON >= NMEAS.

      GAMMA   (input) DOUBLE PRECISION
              The value of gamma. It is assumed that gamma is
              sufficiently large so that the controller is admissible.
              GAMMA >= 0.

      A       (input) DOUBLE PRECISION array, dimension (LDA,N)
              The leading N-by-N part of this array must contain the
              system state matrix A.

      LDA     INTEGER
              The leading dimension of the array A.  LDA >= max(1,N).

      B       (input) DOUBLE PRECISION array, dimension (LDB,M)
              The leading N-by-M part of this array must contain the
              system input matrix B.

      LDB     INTEGER
              The leading dimension of the array B.  LDB >= max(1,N).

      C       (input) DOUBLE PRECISION array, dimension (LDC,N)
              The leading NP-by-N part of this array must contain the
              system output matrix C.

      LDC     INTEGER
              The leading dimension of the array C.  LDC >= max(1,NP).

      D       (input) DOUBLE PRECISION array, dimension (LDD,M)
              The leading NP-by-M part of this array must contain the
              system input/output matrix D.

      LDD     INTEGER
              The leading dimension of the array D.  LDD >= max(1,NP).

      AK      (output) DOUBLE PRECISION array, dimension (LDAK,N)
              The leading N-by-N part of this array contains the
              controller state matrix AK.

      LDAK    INTEGER
              The leading dimension of the array AK.  LDAK >= max(1,N).

      BK      (output) DOUBLE PRECISION array, dimension (LDBK,NMEAS)
              The leading N-by-NMEAS part of this array contains the
              controller input matrix BK.

      LDBK    INTEGER
              The leading dimension of the array BK.  LDBK >= max(1,N).

      CK      (output) DOUBLE PRECISION array, dimension (LDCK,N)
              The leading NCON-by-N part of this array contains the
              controller output matrix CK.

      LDCK    INTEGER
              The leading dimension of the array CK.
              LDCK >= max(1,NCON).

      DK      (output) DOUBLE PRECISION array, dimension (LDDK,NMEAS)
              The leading NCON-by-NMEAS part of this array contains the
              controller input/output matrix DK.

      LDDK    INTEGER
              The leading dimension of the array DK.
              LDDK >= max(1,NCON).

      RCOND   (output) DOUBLE PRECISION array, dimension (4)
              RCOND(1) contains the reciprocal condition number of the
                       control transformation matrix;
              RCOND(2) contains the reciprocal condition number of the
                       measurement transformation matrix;
              RCOND(3) contains an estimate of the reciprocal condition
                       number of the X-Riccati equation;
              RCOND(4) contains an estimate of the reciprocal condition
                       number of the Y-Riccati equation.

Tolerances

      TOL     DOUBLE PRECISION
              Tolerance used for controlling the accuracy of the applied
              transformations for computing the normalized form in
              SLICOT Library routine SB10PD. Transformation matrices
              whose reciprocal condition numbers are less than TOL are
              not allowed. If TOL <= 0, then a default value equal to
              sqrt(EPS) is used, where EPS is the relative machine
              precision.

Workspace

      IWORK   INTEGER array, dimension (LIWORK), where
              LIWORK = max(2*max(N,M-NCON,NP-NMEAS,NCON),N*N)

      DWORK   DOUBLE PRECISION array, dimension (LDWORK)
              On exit, if INFO = 0, DWORK(1) contains the optimal
              LDWORK.

      LDWORK  INTEGER
              The dimension of the array DWORK.
              LDWORK >= N*M + NP*(N+M) + M2*M2 + NP2*NP2 +
                        max(1,LW1,LW2,LW3,LW4,LW5,LW6), where
              LW1 = (N+NP1+1)*(N+M2) + max(3*(N+M2)+N+NP1,5*(N+M2)),
              LW2 = (N+NP2)*(N+M1+1) + max(3*(N+NP2)+N+M1,5*(N+NP2)),
              LW3 = M2 + NP1*NP1 + max(NP1*max(N,M1),3*M2+NP1,5*M2),
              LW4 = NP2 + M1*M1 + max(max(N,NP1)*M1,3*NP2+M1,5*NP2),
              LW5 = 2*N*N + N*(M+NP) +
                    max(1,M*M + max(2*M1,3*N*N+max(N*M,10*N*N+12*N+5)),
                        NP*NP + max(2*NP1,3*N*N +
                                    max(N*NP,10*N*N+12*N+5))),
              LW6 = 2*N*N + N*(M+NP) +
                    max(1, M2*NP2 + NP2*NP2 + M2*M2 +
                        max(D1*D1 + max(2*D1, (D1+D2)*NP2),
                            D2*D2 + max(2*D2, D2*M2), 3*N,
                            N*(2*NP2 + M2) +
                            max(2*N*M2, M2*NP2 +
                                        max(M2*M2+3*M2, NP2*(2*NP2+
                                               M2+max(NP2,N)))))),
              with D1 = NP1 - M2, D2 = M1 - NP2,
                  NP1 = NP - NP2, M1 = M - M2.
              For good performance, LDWORK must generally be larger.
              Denoting Q = max(M1,M2,NP1,NP2), an upper bound is
              2*Q*(3*Q+2*N)+max(1,(N+Q)*(N+Q+6),Q*(Q+max(N,Q,5)+1),
                2*N*(N+2*Q)+max(1,4*Q*Q+
                                max(2*Q,3*N*N+max(2*N*Q,10*N*N+12*N+5)),
                                  Q*(3*N+3*Q+max(2*N,4*Q+max(N,Q))))).

      BWORK   LOGICAL array, dimension (2*N)

Error Indicator

      INFO    INTEGER
              = 0:  successful exit;
              < 0:  if INFO = -i, the i-th argument had an illegal
                    value;
              = 1:  if the matrix | A-j*omega*I  B2  | had not full
                                  |    C1        D12 |
                    column rank in respect to the tolerance EPS;
              = 2:  if the matrix | A-j*omega*I  B1  |  had not full row
                                  |    C2        D21 |
                    rank in respect to the tolerance EPS;
              = 3:  if the matrix D12 had not full column rank in
                    respect to the tolerance TOL;
              = 4:  if the matrix D21 had not full row rank in respect
                    to the tolerance TOL;
              = 5:  if the singular value decomposition (SVD) algorithm
                    did not converge (when computing the SVD of one of
                    the matrices |A   B2 |, |A   B1 |, D12 or D21).
                                 |C1  D12|  |C2  D21|
              = 6:  if the controller is not admissible (too small value
                    of gamma);
              = 7:  if the X-Riccati equation was not solved
                    successfully (the controller is not admissible or
                    there are numerical difficulties);
              = 8:  if the Y-Riccati equation was not solved
                    successfully (the controller is not admissible or
                    there are numerical difficulties);
              = 9:  if the determinant of Im2 + Tu*D11HAT*Ty*D22 is
                    zero [3].

Method

      The routine implements the Glover's and Doyle's 1988 formulas [1],
      [2] modified to improve the efficiency as described in [3].

References

      [1] Glover, K. and Doyle, J.C.
          State-space formulae for all stabilizing controllers that
          satisfy an Hinf norm bound and relations to risk sensitivity.
          Systems and Control Letters, vol. 11, pp. 167-172, 1988.

      [2] Balas, G.J., Doyle, J.C., Glover, K., Packard, A., and
          Smith, R.
          mu-Analysis and Synthesis Toolbox.
          The MathWorks Inc., Natick, Mass., 1995.

      [3] Petkov, P.Hr., Gu, D.W., and Konstantinov, M.M.
          Fortran 77 routines for Hinf and H2 design of continuous-time
          linear control systems.
          Rep. 98-14, Department of Engineering, Leicester University,
          Leicester, U.K., 1998.

Numerical Aspects

      The accuracy of the result depends on the condition numbers of the
      input and output transformations and on the condition numbers of
      the two Riccati equations, as given by the values of RCOND(1),
      RCOND(2), RCOND(3) and RCOND(4), respectively.

Further Comments

      None

Example

Program Text

    *     SB10FD EXAMPLE PROGRAM TEXT
    *
    *     .. Parameters ..
          INTEGER          NIN, NOUT
          PARAMETER        ( NIN = 5, NOUT = 6 )
          INTEGER          NMAX, MMAX, PMAX, N2MAX
          PARAMETER        ( NMAX = 10, MMAX = 10, PMAX = 10, N2MAX = 20 )
          INTEGER          LDA, LDB, LDC, LDD, LDAK, LDBK, LDCK, LDDK,
         $                 LDAC, LDBC, LDCC, LDDC
          PARAMETER        ( LDA = NMAX, LDB = NMAX, LDC = PMAX, LDD = PMAX,
         $                   LDAK = NMAX, LDBK = NMAX, LDCK = MMAX,
         $                   LDDK = MMAX, LDAC = 2*NMAX, LDBC = 2*NMAX,
         $                   LDCC = PMAX, LDDC = PMAX )
          INTEGER          LIWORK
          PARAMETER        ( LIWORK = MAX( 2*MAX( NMAX, MMAX, PMAX ),
         $                            NMAX*NMAX ) )
          INTEGER          MPMX
          PARAMETER        ( MPMX = MAX( MMAX, PMAX ) )
          INTEGER          LDWORK
          PARAMETER        ( LDWORK = 2*MPMX*( 3*MPMX + 2*NMAX ) +
         $                   MAX( ( NMAX + MPMX )*( NMAX + MPMX + 6 ),
         $                   MPMX*( MPMX + MAX( NMAX, MPMX, 5 ) + 1 ),
         $                   2*NMAX*( NMAX + 2*MPMX ) +
         $                   MAX( 4*MPMX*MPMX + MAX( 2*MPMX, 3*NMAX*NMAX +
         $                   MAX( 2*NMAX*MPMX, 10*NMAX*NMAX+12*NMAX+5 ) ),
         $                   MPMX*( 3*NMAX + 3*MPMX +
         $                          MAX( 2*NMAX, 4*MPMX +
         $                               MAX( NMAX, MPMX ) ) ) ) ) )
    *     .. Local Scalars ..
          INTEGER SDIM
          LOGICAL SELECT
          DOUBLE PRECISION GAMMA, TOL
          INTEGER          I, INFO1, INFO2, INFO3, J, M, N, NCON, NMEAS, NP
    *     .. Local Arrays ..
          LOGICAL          BWORK(N2MAX)
          INTEGER          IWORK(LIWORK)
          DOUBLE PRECISION A(LDA,NMAX), AK(LDAK,NMAX), AC(LDAC,N2MAX),
         $                 B(LDB,MMAX), BK(LDBK,PMAX), BC(LDBC,MMAX),
         $                 C(LDC,NMAX), CK(LDCK,NMAX), CC(LDCC,N2MAX),
         $                 D(LDD,MMAX), DK(LDDK,PMAX), DC(LDDC,MMAX),
         $                 DWORK(LDWORK), RCOND( 4 )
    *     .. External Subroutines ..
          EXTERNAL         SB10FD, SB10LD
    *     .. Intrinsic Functions ..
          INTRINSIC        MAX
    *     .. Executable Statements ..
    *
          WRITE ( NOUT, FMT = 99999 )
    *     Skip the heading in the data file and read the data.
          READ ( NIN, FMT = '()' )
          READ ( NIN, FMT = * ) N, M, NP, NCON, NMEAS
          IF ( N.LT.0 .OR. N.GT.NMAX ) THEN
             WRITE ( NOUT, FMT = 99987 ) N
          ELSE IF ( M.LT.0 .OR. M.GT.MMAX ) THEN
             WRITE ( NOUT, FMT = 99986 ) M
          ELSE IF ( NP.LT.0 .OR. NP.GT.PMAX ) THEN
             WRITE ( NOUT, FMT = 99985 ) NP
          ELSE IF ( NCON.LT.0 .OR. NCON.GT.MMAX ) THEN
             WRITE ( NOUT, FMT = 99984 ) NCON
          ELSE IF ( NMEAS.LT.0 .OR. NMEAS.GT.PMAX ) THEN
             WRITE ( NOUT, FMT = 99983 ) NMEAS
          ELSE
             READ ( NIN, FMT = * ) ( ( A(I,J), J = 1,N ), I = 1,N )
             READ ( NIN, FMT = * ) ( ( B(I,J), J = 1,M ), I = 1,N )
             READ ( NIN, FMT = * ) ( ( C(I,J), J = 1,N ), I = 1,NP )
             READ ( NIN, FMT = * ) ( ( D(I,J), J = 1,M ), I = 1,NP )
             READ ( NIN, FMT = * ) GAMMA, TOL
    *        Compute the suboptimal controller
             CALL SB10FD( N, M, NP, NCON, NMEAS, GAMMA, A, LDA, B, LDB,
         $                C, LDC, D, LDD, AK, LDAK, BK, LDBK, CK, LDCK,
         $                DK, LDDK, RCOND, TOL, IWORK, DWORK, LDWORK,
         $                BWORK, INFO1 )
    *
             IF ( INFO1.EQ.0 ) THEN
                WRITE ( NOUT, FMT = 99996 )
                DO 10 I = 1, N
                   WRITE ( NOUT, FMT = 99989 ) ( AK(I,J), J = 1,N )
       10       CONTINUE
                WRITE ( NOUT, FMT = 99995 )
                DO 20 I = 1, N
                   WRITE ( NOUT, FMT = 99989 ) ( BK(I,J), J = 1,NMEAS )
       20       CONTINUE
                WRITE ( NOUT, FMT = 99994 )
                DO 30 I = 1, NCON
                   WRITE ( NOUT, FMT = 99989 ) ( CK(I,J), J = 1,N )
       30       CONTINUE
                WRITE ( NOUT, FMT = 99993 )
                DO 40 I = 1, NCON
                   WRITE ( NOUT, FMT = 99989 ) ( DK(I,J), J = 1,NMEAS )
       40       CONTINUE
                WRITE( NOUT, FMT = 99992 )
                WRITE( NOUT, FMT = 99988 ) ( RCOND(I), I = 1, 4 )
    *           Compute the closed-loop matrices
                CALL SB10LD(N, M, NP, NCON, NMEAS, A, LDA, B, LDB, C, LDC,
         $                  D, LDD, AK, LDAK, BK, LDBK, CK, LDCK, DK, LDDK,
         $                  AC, LDAC, BC, LDBC, CC, LDCC, DC, LDDC, IWORK,
         $                  DWORK, LDWORK, INFO2 )
    *
                IF ( INFO2.EQ.0 ) THEN
    *              Compute the closed-loop poles
                   CALL DGEES( 'N','N', SELECT, 2*N, AC, LDAC, SDIM,
         $                     DWORK(1), DWORK(2*N+1), DWORK, 2*N,
         $                     DWORK(4*N+1), LDWORK-4*N, BWORK, INFO3)
    *
                   IF( INFO3.EQ.0 ) THEN
                      WRITE( NOUT, FMT = 99991 )
                      WRITE( NOUT, FMT = 99988 ) (DWORK(I), I =1, 2*N)
                      WRITE( NOUT, FMT = 99990 )
                      WRITE( NOUT, FMT = 99988 ) (DWORK(2*N+I), I =1, 2*N)
                   ELSE
                      WRITE( NOUT, FMT = 99996 ) INFO3
                   END IF
                ELSE
                   WRITE( NOUT, FMT = 99997 ) INFO2
                END IF
             ELSE
                WRITE( NOUT, FMT = 99998 ) INFO1
             END IF
          END IF
          STOP
    *
    99999 FORMAT (' SB10FD EXAMPLE PROGRAM RESULTS',/1X)
    99998 FORMAT (/' INFO on exit from SB10FD =',I2)
    99997 FORMAT (/' INFO on exit from SB10LD =',I2)
    99996 FORMAT (' The controller state matrix AK is'/)
    99995 FORMAT (/' The controller input matrix BK is'/)
    99994 FORMAT (/' The controller output matrix CK is'/)
    99993 FORMAT (/' The controller matrix DK is'/)
    99992 FORMAT (/' The estimated condition numbers are'/)
    99991 FORMAT (/' The real parts of the closed-loop system poles are'/)
    99990 FORMAT (/' The imaginary parts of the closed-loop system',
         $           ' poles are'/)
    99989 FORMAT (10(1X,F8.4))
    99988 FORMAT ( 5(1X,D12.5))
    99987 FORMAT (/' N is out of range.',/' N = ',I5)
    99986 FORMAT (/' M is out of range.',/' M = ',I5)
    99985 FORMAT (/' N is out of range.',/' N = ',I5)
    99984 FORMAT (/' NCON is out of range.',/' NCON = ',I5)
    99983 FORMAT (/' NMEAS is out of range.',/' NMEAS = ',I5)
          END

Program Data

     SB10FD EXAMPLE PROGRAM DATA
       6     5     5     2     2
      -1.0  0.0  4.0  5.0 -3.0 -2.0
      -2.0  4.0 -7.0 -2.0  0.0  3.0
      -6.0  9.0 -5.0  0.0  2.0 -1.0
      -8.0  4.0  7.0 -1.0 -3.0  0.0
       2.0  5.0  8.0 -9.0  1.0 -4.0
       3.0 -5.0  8.0  0.0  2.0 -6.0
      -3.0 -4.0 -2.0  1.0  0.0
       2.0  0.0  1.0 -5.0  2.0
      -5.0 -7.0  0.0  7.0 -2.0
       4.0 -6.0  1.0  1.0 -2.0
      -3.0  9.0 -8.0  0.0  5.0
       1.0 -2.0  3.0 -6.0 -2.0
       1.0 -1.0  2.0 -4.0  0.0 -3.0
      -3.0  0.0  5.0 -1.0  1.0  1.0
      -7.0  5.0  0.0 -8.0  2.0 -2.0
       9.0 -3.0  4.0  0.0  3.0  7.0
       0.0  1.0 -2.0  1.0 -6.0 -2.0
       1.0 -2.0 -3.0  0.0  0.0
       0.0  4.0  0.0  1.0  0.0
       5.0 -3.0 -4.0  0.0  1.0
       0.0  1.0  0.0  1.0 -3.0
       0.0  0.0  1.0  7.0  1.0
      15.0  0.00000001

Program Results

     SB10FD EXAMPLE PROGRAM RESULTS

     The controller state matrix AK is

      -2.8043  14.7367   4.6658   8.1596   0.0848   2.5290
       4.6609   3.2756  -3.5754  -2.8941   0.2393   8.2920
     -15.3127  23.5592  -7.1229   2.7599   5.9775  -2.0285
     -22.0691  16.4758  12.5523 -16.3602   4.4300  -3.3168
      30.6789  -3.9026  -1.3868  26.2357  -8.8267  10.4860
      -5.7429   0.0577  10.8216 -11.2275   1.5074 -10.7244

     The controller input matrix BK is

      -0.1581  -0.0793
      -0.9237  -0.5718
       0.7984   0.6627
       0.1145   0.1496
      -0.6743  -0.2376
       0.0196  -0.7598

     The controller output matrix CK is

      -0.2480  -0.1713  -0.0880   0.1534   0.5016  -0.0730
       2.8810  -0.3658   1.3007   0.3945   1.2244   2.5690

     The controller matrix DK is

       0.0554   0.1334
      -0.3195   0.0333

     The estimated condition numbers are

      0.10000D+01  0.10000D+01  0.11241D-01  0.80492D-03

     The real parts of the closed-loop system poles are

     -0.10731D+03 -0.66556D+02 -0.38269D+02 -0.38269D+02 -0.20089D+02
     -0.62557D+01 -0.62557D+01 -0.32405D+01 -0.32405D+01 -0.17178D+01
     -0.41466D+01 -0.76437D+01

     The imaginary parts of the closed-loop system poles are

      0.00000D+00  0.00000D+00  0.13114D+02 -0.13114D+02  0.00000D+00
      0.12961D+02 -0.12961D+02  0.67998D+01 -0.67998D+01  0.00000D+00
      0.00000D+00  0.00000D+00

Return to index