E04RPF (PDF version)
E04 Chapter Contents
E04 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

E04RPF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

 Contents

    1  Purpose
    7  Accuracy

1  Purpose

E04RPF is a part of the NAG optimization modelling suite and defines bilinear matrix terms either in a new matrix constraint or adds them to an existing linear matrix inequality.

2  Specification

SUBROUTINE E04RPF ( HANDLE, NQ, QI, QJ, DIMQ, NNZQ, NNZQSUM, IROWQ, ICOLQ, Q, IDBLK, IFAIL)
INTEGER  NQ, QI(NQ), QJ(NQ), DIMQ, NNZQ(NQ), NNZQSUM, IROWQ(NNZQSUM), ICOLQ(NNZQSUM), IDBLK, IFAIL
REAL (KIND=nag_wp)  Q(NNZQSUM)
TYPE (C_PTR)  HANDLE

3  Description

After the initialization routine E04RAF has been called, E04RPF may be used to define bilinear matrix terms. It may be used in two ways, either to add to the problem formulation a new bilinear matrix inequality (BMI) which does not have linear terms:
i,j=1 n xi xj Q ij 0 (1)
or to extend an existing linear matrix inequality constraint by bilinear terms:
i,j=1 n xi xj Q ij k . (2)
Here Q ij k  are d by d (sparse) symmetric matrices and k, if present, is the number of the existing constraint. This routine will typically be used on semidefinite programming problems with bilinear matrix constraints (BMI-SDP)
minimize xn 12 xTHx + cTx   (a) subject to   i,j=1 n xi xj Qijk + i=1 n xi Aik - A0k 0 ,  k=1,,mA   (b) lBBxuB   (c) lxxux .   (d) (3)
The routine can be called multiple times to define an additional matrix inequality or to extend an existing one, but it cannot be called twice to extend the same matrix inequality. The argument IDBLK is used to distinguish whether a new matrix constraint should be added (IDBLK=0) or if an existing linear matrix inequality should be extended (IDBLK>0). In the latter case, IDBLK should be set to k, the number of the existing inequality. See E04RNF for details about formulation of linear matrix constraints and their numbering and a further description of IDBLK. For a generic description of the problem see E04RAF. In the further text, the index k will be omitted.

3.1  Input data organization

It is expected that only some of the matrices Qij will be nonzero therefore only their index pairs i,j are listed in arrays QI and QJ. Note that a pair i,j should not repeat, i.e., a matrix Qij should not be defined more than once. No particular ordering of pairs i,j is expected but other input arrays IROWQ, ICOLQ, Q and NNZQ need to respect the chosen order.
Note:  the dimension of Qij must respect the size of the linear matrix inequality if they are supposed to expand it (case IDBLK>0).
Matrices Qij are symmetric and thus only their upper triangles are passed to the routine. They are stored in sparse coordinate storage format (see Section 2.1.1 in the F11 Chapter Introduction), i.e., every nonzero from the upper triangles is coded as a triplet of row index, column index and the numeric value. All these triplets from all Qij matrices are passed to the routine in three arrays: IROWQ for row indices, ICOLQ for column indices and Q for the values. No particular order of nonzeros within one matrix is enforced but all nonzeros belonging to one Qij matrix need to be stored next to each other. The first NNZQ1 nonzeros belong to Qi1j1 where i1=QI1, j1=QJ1, the following NNZQ2 nonzeros to the next one given by QI, QJ and so on. The array NNZQ thus splits arrays IROWQ, ICOLQ and Q into sections so that each section defines one Qij matrix. See Table 1 below. Routines E04RDF and E04RNF use the same data organization so further examples can be found there.
IROWQ upper triangle upper triangle   upper triangle
ICOLQ nonzeros nonzeros nonzeros
Q from ​ Qi1j1   from ​ Qi2j2     from ​ Q iNQ jNQ  
  NNZQ1  NNZQ2    NNZQNQ 
  i1 = QI1   i2 = QI2     iNQ = QINQ  
  j1 = QJ1   j2 = QJ2     jNQ = QJNQ  
Table 1
Coordinate storage format of Qij matrices in input arrays

4  References

Syrmos V L, Abdallah C T, Dorato P and Grigoriadis K (1997) Static output feedback – a survey Journal Automatica (Journal of IFAC) (Volume 33) 2 125–137

5  Arguments

1:     HANDLE – TYPE (C_PTR)Input
On entry: the handle to the problem. It needs to be initialized by E04RAF and must not be changed.
2:     NQ – INTEGERInput
On entry: the number of index pairs i,j of the nonzero matrices Qij.
Constraint: NQ>0.
3:     QINQ – INTEGER arrayInput
4:     QJNQ – INTEGER arrayInput
On entry: the index pairs i,j of the nonzero matrices Qij in any order.
Constraint: 1i,jn where n is the number of decision variables in the problem set during the initialization of the handle by E04RAF. The pairs do not repeat.
5:     DIMQ – INTEGERInput
On entry: d, the dimension of matrices Qij.
Constraints:
  • DIMQ>0;
  • if IDBLK>0, DIMQ needs to be identical to the dimension of matrices of the constraint k.
6:     NNZQNQ – INTEGER arrayInput
On entry: the numbers of nonzero elements in the upper triangles of Qij matrices.
Constraint: NNZQi>0.
7:     NNZQSUM – INTEGERInput
On entry: the dimension of the arrays IROWQ, ICOLQ and Q, at least the total number of all nonzeros in all Qij matrices.
Constraints:
  • NNZQSUM>0;
  • NNZQSUM k=1 NQ NNZQk.
8:     IROWQNNZQSUM – INTEGER arrayInput
9:     ICOLQNNZQSUM – INTEGER arrayInput
10:   QNNZQSUM – REAL (KIND=nag_wp) arrayInput
On entry: the nonzero elements of the upper triangles of matrices Qij stored in coordinate storage format. The first NNZQ1 elements belong to the first Qi1j1, the following NNZQ2 to Qi2j2, etc.
Constraint: 1IROWQiDIMQ, IROWQiICOLQiDIMQ.
11:   IDBLK – INTEGERInput/Output
On entry: if IDBLK=0, a new matrix constraint is created; otherwise IDBLK=k>0, the number of the existing linear matrix constraint to be expanded with the bilinear terms.
Constraint: IDBLK0.
On exit: if IDBLK=0 on entry, the number of the new matrix constraint is returned. By definition, it is the number of the matrix inequalities already defined plus one. Otherwise, IDBLK>0 stays unchanged.
12:   IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, the recommended value is -1. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
IFAIL=1
The supplied HANDLE does not define a valid handle to the data structure for the NAG optimization modelling suite. It has not been initialized by E04RAF or it has been corrupted.
IFAIL=2
The problem cannot be modified in this phase any more, the solver has already been called.
IFAIL=3
On entry, IDBLK=value.
Bilinear terms of the matrix inequality block with the given IDBLK have already been defined.
IFAIL=4
On entry, IDBLK=value.
The given IDBLK does not match with any existing matrix inequality block.
The maximum IDBLK is currently value.
On entry, IDBLK=value.
The given IDBLK refers to a nonexistent matrix inequality block.
No matrix inequalities have been added yet.
IFAIL=5
On entry, DIMQ=value, IDBLK=value.
The correct dimension of the given IDBLK is value.
Constraint: DIMQ must match the dimension of the block supplied earlier.
IFAIL=6
On entry, DIMQ=value.
Constraint: DIMQ>0.
On entry, i=value and NNZQi=value.
Constraint: NNZQi>0.
On entry, IDBLK=value.
Constraint: IDBLK0.
On entry, NNZQSUM=value and sumNNZQ=value.
Constraint: NNZQSUMsumNNZQ.
On entry, NQ=value.
Constraint: NQ>0.
IFAIL=8
On entry, an error occurred in matrix Qij of index k=value, QIk=value, QJk=value.
For j=value, ICOLQj=value and DIMQ=value.
Constraint: 1ICOLQjDIMQ.
On entry, an error occurred in matrix Qij of index k=value, QIk=value, QJk=value.
For j=value, IROWQj=value and DIMQ=value.
Constraint: 1IROWQjDIMQ.
On entry, an error occurred in matrix Qij of index k=value, QIk=value, QJk=value.
For j=value, IROWQj=value and ICOLQj=value.
Constraint: IROWQjICOLQj (elements within the upper triangle).
On entry, an error occurred in matrix Qij of index k=value, QIk=value, QJk=value.
More than one element of Qij has row index value and column index value.
Constraint: each element of Qij must have a unique row and column index.
IFAIL=9
On entry, index pair with QI=value and QJ=value repeats.
Constraint: each index pair QI, QJ must be unique.
On entry, k=value, QIk=value and n=value.
Constraint: 1QIkn.
On entry, k=value, QJk=value and n=value.
Constraint: 1QJkn.
IFAIL=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
IFAIL=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
IFAIL=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

7  Accuracy

Not applicable.

8  Parallelism and Performance

E04RPF is not threaded in any implementation.

9  Further Comments

None.

10  Example

This example demonstrates how semidefinite programming can be used in control theory. See also Section 10 in E04RAF for links to further examples in the suite.
The problem, from static output feedback (SOF) control Syrmos et al. (1997), solved here is the linear time-invariant (LTI) ‘test’ system
x.=Ax+Bu y=Cx (4)
subject to static output feedback
u=Ky . (5)
Here An×n, Bn×m and Cp×n are given matrices, xn is the vector of state variables, um is the vector of control inputs, yp is the vector of system outputs, and Km×p is the unknown feedback gain matrix.
The problem is to find K such that (4) is time-stable when subject to (5), i.e., all eigenvalues of the closed-loop system matrix A+BKC belong to the left half-plane. From the Lyapunov stability theory, this holds if and only if there exists a symmetric positive definite matrix P such that
A+BKCT P+ PA+BKC 0 .  
Hence, by introducing the new variable, the Lyapunov matrix P, we can formulate the SOF problem as a feasibility BMI-SDP problem in variables K and P. As we cannot formulate the problem with sharp matrix inequalities, we can solve the following system instead (note that the objective function is added to bound matrix P):
minimize K,P traceP subject to A+BKCT P+PA+BKC -I PI. (6)
For n=p=2, m=1,
A= -1 2 -3 -4 ,   B= -1 -1 ,  C=I  
and the unknown matrices expressed as
P = x1 x2 x2 x3 ,  K = x4 x5 ,  
the problem (6) can be rewritten in the form (3) as follows:
minimize x5 x1+x3 subject to 2x1 x4 + 2 x2 x4 x1 x5 + x2 x4 + x2 x5 + x3 x4 sym. 2x2 x5 + 2x3 x5 + 2x1 + 6x2 -2x1 + 5x2 + 3x3 sym. -4x2 + 8x3 - I 0 x1 x2 sym. x3 - I 0 .  
This formulation has been stored in a generic BMI-SDP data file which is processed and solved by the example program.

10.1  Program Text

Program Text (e04rpfe.f90)

10.2  Program Data

Program Data (e04rpfe.d)

10.3  Program Results

Program Results (e04rpfe.r)


E04RPF (PDF version)
E04 Chapter Contents
E04 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2016