File: IB01PY.html

package info (click to toggle)
slicot 5.9.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,528 kB
  • sloc: fortran: 148,076; makefile: 964; sh: 57
file content (389 lines) | stat: -rw-r--r-- 15,620 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
<HTML>
<HEAD><TITLE>IB01PY - SLICOT Library Routine Documentation</TITLE>
</HEAD>
<BODY>

<H2><A Name="IB01PY">IB01PY</A></H2>
<H3>
Estimating system matrices B and D using a structure exploiting QR factorization
</H3>
<A HREF ="#Specification"><B>[Specification]</B></A>
<A HREF ="#Arguments"><B>[Arguments]</B></A>
<A HREF ="#Method"><B>[Method]</B></A>
<A HREF ="#References"><B>[References]</B></A>
<A HREF ="#Comments"><B>[Comments]</B></A>
<A HREF ="#Example"><B>[Example]</B></A>

<P>
<B><FONT SIZE="+1">Purpose</FONT></B>
<PRE>
  1. To compute the triangular  (QR)  factor of the  p-by-L*s
  structured matrix  Q,

      [ Q_1s  Q_1,s-1  Q_1,s-2  ...  Q_12  Q_11 ]
      [  0      Q_1s   Q_1,s-1  ...  Q_13  Q_12 ]
  Q = [  0       0       Q_1s   ...  Q_14  Q_13 ],
      [  :       :        :           :     :   ]
      [  0       0        0     ...   0    Q_1s ]

  and apply the transformations to the p-by-m matrix  Kexpand,

            [ K_1 ]
            [ K_2 ]
  Kexpand = [ K_3 ],
            [  :  ]
            [ K_s ]

  where, for MOESP approach (METH = 'M'), p = s*(L*s-n), and
  Q_1i = u2(L*(i-1)+1:L*i,:)'  is  (Ls-n)-by-L,  for  i = 1:s,
  u2 = Un(1:L*s,n+1:L*s),  K_i = K(:,(i-1)*m+1:i*m)  (i = 1:s)
  is  (Ls-n)-by-m, and for N4SID approach (METH = 'N'), p = s*(n+L),
  and

            [   -L_1|1    ]          [ M_i-1 - L_1|i ]
     Q_11 = [             ],  Q_1i = [               ],  i = 2:s,
            [ I_L - L_2|1 ]          [     -L_2|i    ]

  are  (n+L)-by-L  matrices, and
  K_i = K(:,(i-1)*m+1:i*m),  i = 1:s,  is  (n+L)-by-m.
  The given matrices are:
  For  METH = 'M',  u2 = Un(1:L*s,n+1:L*s),
                    K(1:Ls-n,1:m*s);

                        [ L_1|1  ...  L_1|s ]
  For  METH = 'N',  L = [                   ],   (n+L)-by-L*s,
                        [ L_2|1  ...  L_2|s ]

                    M = [ M_1  ...  M_s-1 ],  n-by-L*(s-1),  and
                    K,                        (n+L)-by-m*s.
                    Matrix M is the pseudoinverse of the matrix GaL,
                    built from the first  n  relevant singular
                    vectors,  GaL = Un(1:L(s-1),1:n),  and computed
                    by SLICOT Library routine IB01PD for METH = 'N'.

  Matrix  Q  is triangularized  (in  R),  exploiting its structure,
  and the transformations are applied from the left to  Kexpand.

  2. To estimate the matrices B and D of a linear time-invariant
  (LTI) state space model, using the factor  R,  transformed matrix
  Kexpand, and the singular value decomposition information provided
  by other routines.

  IB01PY  routine is intended for speed and efficient use of the
  memory space. It is generally not recommended for  METH = 'N',  as
  IB01PX  routine can produce more accurate results.

</PRE>
<A name="Specification"><B><FONT SIZE="+1">Specification</FONT></B></A>
<PRE>
      SUBROUTINE IB01PY( METH, JOB, NOBR, N, M, L, RANKR1, UL, LDUL,
     $                   R1, LDR1, TAU1, PGAL, LDPGAL, K, LDK, R, LDR,
     $                   H, LDH, B, LDB, D, LDD, TOL, IWORK, DWORK,
     $                   LDWORK, IWARN, INFO )
C     .. Scalar Arguments ..
      DOUBLE PRECISION   TOL
      INTEGER            INFO, IWARN, L, LDB, LDD, LDH, LDK, LDPGAL,
     $                   LDR, LDR1, LDUL, LDWORK, M, N, NOBR, RANKR1
      CHARACTER          JOB, METH
C     .. Array Arguments ..
      DOUBLE PRECISION   B(LDB, *), D(LDD, *), DWORK(*), H(LDH, *),
     $                   K(LDK, *), PGAL(LDPGAL, *), R(LDR, *),
     $                   R1(LDR1, *), TAU1(*), UL(LDUL, *)
      INTEGER            IWORK( * )

</PRE>
<A name="Arguments"><B><FONT SIZE="+1">Arguments</FONT></B></A>
<P>

<B>Mode Parameters</B>
<PRE>
  METH    CHARACTER*1
          Specifies the subspace identification method to be used,
          as follows:
          = 'M':  MOESP  algorithm with past inputs and outputs;
          = 'N':  N4SID  algorithm.

  JOB     CHARACTER*1
          Specifies whether or not the matrices B and D should be
          computed, as follows:
          = 'B':  compute the matrix B, but not the matrix D;
          = 'D':  compute both matrices B and D;
          = 'N':  do not compute the matrices B and D, but only the
                  R  factor of  Q  and the transformed Kexpand.

</PRE>
<B>Input/Output Parameters</B>
<PRE>
  NOBR    (input) INTEGER
          The number of block rows,  s,  in the input and output
          Hankel matrices processed by other routines.  NOBR &gt; 1.

  N       (input) INTEGER
          The order of the system.  NOBR &gt; N &gt; 0.

  M       (input) INTEGER
          The number of system inputs.  M &gt;= 0.

  L       (input) INTEGER
          The number of system outputs.  L &gt; 0.

  RANKR1  (input) INTEGER
          The effective rank of the upper triangular matrix  r1,
          i.e., the triangular QR factor of the matrix  GaL,
          computed by SLICOT Library routine IB01PD. It is also
          the effective rank of the matrix  GaL.  0 &lt;= RANKR1 &lt;= N.
          If  JOB = 'N',  or  M = 0,  or  METH = 'N',  this
          parameter is not used.

  UL      (input/workspace) DOUBLE PRECISION array, dimension
          ( LDUL,L*NOBR )
          On entry, if  METH = 'M',  the leading  L*NOBR-by-L*NOBR
          part of this array must contain the matrix  Un  of
          relevant singular vectors. The first  N  columns of  UN
          need not be specified for this routine.
          On entry, if  METH = 'N',  the leading  (N+L)-by-L*NOBR
          part of this array must contain the given matrix  L.
          On exit, the leading  LDF-by-L*(NOBR-1) part of this array
          is overwritten by the matrix  F  of the algorithm in [4],
          where  LDF = MAX( 1, L*NOBR-N-L ), if  METH = 'M';
                 LDF = N,                    if  METH = 'N'.

  LDUL    INTEGER
          The leading dimension of the array  UL.
          LDUL &gt;= L*NOBR, if  METH = 'M';
          LDUL &gt;= N+L,    if  METH = 'N'.

  R1      (input) DOUBLE PRECISION array, dimension ( LDR1,N )
          If  JOB &lt;&gt; 'N',  M &gt; 0,  METH = 'M',  and  RANKR1 = N,
          the leading  L*(NOBR-1)-by-N  part of this array must
          contain details of the QR factorization of the matrix
          GaL,  as computed by SLICOT Library routine IB01PD.
          Specifically, the leading N-by-N upper triangular part
          must contain the upper triangular factor  r1  of  GaL,
          and the lower  L*(NOBR-1)-by-N  trapezoidal part, together
          with array TAU1, must contain the factored form of the
          orthogonal matrix  Q1  in the QR factorization of  GaL.
          If  JOB = 'N',  or  M = 0,  or  METH = 'N', or  METH = 'M'
          and  RANKR1 &lt; N,  this array is not referenced.

  LDR1    INTEGER
          The leading dimension of the array  R1.
          LDR1 &gt;= L*(NOBR-1), if  JOB &lt;&gt; 'N',  M &gt; 0,  METH = 'M',
                              and  RANKR1 = N;
          LDR1 &gt;= 1,          otherwise.

  TAU1    (input) DOUBLE PRECISION array, dimension ( N )
          If  JOB &lt;&gt; 'N',  M &gt; 0,  METH = 'M',  and  RANKR1 = N,
          this array must contain the scalar factors of the
          elementary reflectors used in the QR factorization of the
          matrix  GaL,  computed by SLICOT Library routine IB01PD.
          If  JOB = 'N',  or  M = 0,  or  METH = 'N', or  METH = 'M'
          and  RANKR1 &lt; N,  this array is not referenced.

  PGAL    (input) DOUBLE PRECISION array, dimension
          ( LDPGAL,L*(NOBR-1) )
          If  METH = 'N',  or  JOB &lt;&gt; 'N',  M &gt; 0,  METH = 'M'  and
          RANKR1 &lt; N,  the leading  N-by-L*(NOBR-1)  part of this
          array must contain the pseudoinverse of the matrix  GaL,
          as computed by SLICOT Library routine IB01PD.
          If  METH = 'M'  and  JOB = 'N',  or  M = 0,  or
          RANKR1 = N,  this array is not referenced.

  LDPGAL  INTEGER
          The leading dimension of the array  PGAL.
          LDPGAL &gt;= N,  if   METH = 'N',  or  JOB &lt;&gt; 'N',  M &gt; 0,
                        and  METH = 'M'  and RANKR1 &lt; N;
          LDPGAL &gt;= 1,  otherwise.

  K       (input/output) DOUBLE PRECISION array, dimension
          ( LDK,M*NOBR )
          On entry, the leading  (p/s)-by-M*NOBR  part of this array
          must contain the given matrix  K  defined above.
          On exit, the leading  (p/s)-by-M*NOBR  part of this array
          contains the transformed matrix  K.

  LDK     INTEGER
          The leading dimension of the array  K.  LDK &gt;= p/s.

  R       (output) DOUBLE PRECISION array, dimension ( LDR,L*NOBR )
          If  JOB = 'N',  or  M = 0,  or  Q  has full rank, the
          leading  L*NOBR-by-L*NOBR  upper triangular part of this
          array contains the  R  factor of the QR factorization of
          the matrix  Q.
          If  JOB &lt;&gt; 'N',  M &gt; 0,  and  Q  has not a full rank, the
          leading  L*NOBR-by-L*NOBR  upper trapezoidal part of this
          array contains details of the complete orhogonal
          factorization of the matrix  Q,  as constructed by SLICOT
          Library routines MB03OD and MB02QY.

  LDR     INTEGER
          The leading dimension of the array  R.  LDR &gt;= L*NOBR.

  H       (output) DOUBLE PRECISION array, dimension ( LDH,M )
          If  JOB = 'N'  or  M = 0,  the leading  L*NOBR-by-M  part
          of this array contains the updated part of the matrix
          Kexpand  corresponding to the upper triangular factor  R
          in the QR factorization of the matrix  Q.
          If  JOB &lt;&gt; 'N',  M &gt; 0,  and  METH = 'N'  or  METH = 'M'
          and  RANKR1 &lt; N,  the leading  L*NOBR-by-M  part of this
          array contains the minimum norm least squares solution of
          the linear system  Q*X = Kexpand,  from which the matrices
          B  and  D  are found. The first  NOBR-1  row blocks of  X
          appear in the reverse order in  H.
          If  JOB &lt;&gt; 'N',  M &gt; 0,  METH = 'M'  and  RANKR1 = N,  the
          leading  L*(NOBR-1)-by-M  part of this array contains the
          matrix product  Q1'*X,  and the subarray
          L*(NOBR-1)+1:L*NOBR-by-M  contains the  corresponding
          submatrix of  X,  with  X  defined in the phrase above.

  LDH     INTEGER
          The leading dimension of the array  H.  LDH &gt;= L*NOBR.

  B       (output) DOUBLE PRECISION array, dimension ( LDB,M )
          If  M &gt; 0,  JOB = 'B' or 'D'  and  INFO = 0,  the leading
          N-by-M part of this array contains the system input
          matrix.
          If  M = 0  or  JOB = 'N',  this array is not referenced.

  LDB     INTEGER
          The leading dimension of the array B.
          LDB &gt;= N, if  M &gt; 0 and JOB = 'B' or 'D';
          LDB &gt;= 1, if  M = 0 or  JOB = 'N'.

  D       (output) DOUBLE PRECISION array, dimension ( LDD,M )
          If  M &gt; 0,  JOB = 'D'  and  INFO = 0,  the leading
          L-by-M part of this array contains the system input-output
          matrix.
          If  M = 0  or  JOB = 'B'  or  'N',  this array is not
          referenced.

  LDD     INTEGER
          The leading dimension of the array D.
          LDD &gt;= L, if  M &gt; 0 and JOB = 'D';
          LDD &gt;= 1, if  M = 0 or  JOB = 'B' or 'N'.

</PRE>
<B>Tolerances</B>
<PRE>
  TOL     DOUBLE PRECISION
          The tolerance to be used for estimating the rank of
          matrices. If the user sets  TOL &gt; 0,  then the given value
          of  TOL  is used as a lower bound for the reciprocal
          condition number;  an m-by-n matrix whose estimated
          condition number is less than  1/TOL  is considered to
          be of full rank.  If the user sets  TOL &lt;= 0,  then an
          implicitly computed, default tolerance, defined by
          TOLDEF = m*n*EPS,  is used instead, where  EPS  is the
          relative machine precision (see LAPACK Library routine
          DLAMCH).
          This parameter is not used if  M = 0  or  JOB = 'N'.

</PRE>
<B>Workspace</B>
<PRE>
  IWORK   INTEGER array, dimension ( LIWORK )
          where  LIWORK &gt;= 0,       if  JOB =  'N',  or   M = 0;
                 LIWORK &gt;= L*NOBR,  if  JOB &lt;&gt; 'N',  and  M &gt; 0.

  DWORK   DOUBLE PRECISION array, dimension ( LDWORK )
          On exit, if  INFO = 0,  DWORK(1) returns the optimal value
          of  LDWORK,  and, if  JOB &lt;&gt; 'N',  and  M &gt; 0,  DWORK(2)
          contains the reciprocal condition number of the triangular
          factor of the matrix  R.
          On exit, if  INFO = -28,  DWORK(1)  returns the minimum
          value of LDWORK.

  LDWORK  INTEGER
          The length of the array DWORK.
          LDWORK &gt;= MAX( 2*L, L*NOBR, L+M*NOBR ),
                                      if  JOB = 'N',  or  M = 0;
          LDWORK &gt;= MAX( L+M*NOBR, L*NOBR + MAX( 3*L*NOBR+1, M ) ),
                                      if  JOB &lt;&gt; 'N',  and  M &gt; 0.
          For good performance,  LDWORK  should be larger.

</PRE>
<B>Warning Indicator</B>
<PRE>
  IWARN   INTEGER
          = 0:  no warning;
          = 4:  the least squares problem to be solved has a
                rank-deficient coefficient matrix.

</PRE>
<B>Error Indicator</B>
<PRE>
  INFO    INTEGER
          = 0:  successful exit;
          &lt; 0:  if INFO = -i, the i-th argument had an illegal
                value;
          = 3:  a singular upper triangular matrix was found.

</PRE>
<A name="Method"><B><FONT SIZE="+1">Method</FONT></B></A>
<PRE>
  The QR factorization is computed exploiting the structure,
  as described in [4].
  The matrices  B  and  D  are then obtained by solving certain
  linear systems in a least squares sense.

</PRE>
<A name="References"><B><FONT SIZE="+1">References</FONT></B></A>
<PRE>
  [1] Verhaegen M., and Dewilde, P.
      Subspace Model Identification. Part 1: The output-error
      state-space model identification class of algorithms.
      Int. J. Control, 56, pp. 1187-1210, 1992.

  [2] Van Overschee, P., and De Moor, B.
      N4SID: Two Subspace Algorithms for the Identification
      of Combined Deterministic-Stochastic Systems.
      Automatica, Vol.30, No.1, pp. 75-93, 1994.

  [3] Van Overschee, P.
      Subspace Identification : Theory - Implementation -
      Applications.
      Ph. D. Thesis, Department of Electrical Engineering,
      Katholieke Universiteit Leuven, Belgium, Feb. 1995.

  [4] Sima, V.
      Subspace-based Algorithms for Multivariable System
      Identification.
      Studies in Informatics and Control, 5, pp. 335-344, 1996.

</PRE>
<A name="Numerical Aspects"><B><FONT SIZE="+1">Numerical Aspects</FONT></B></A>
<PRE>
  The implemented method for computing the triangular factor and
  updating Kexpand is numerically stable.

</PRE>
<A name="Comments"><B><FONT SIZE="+1">Further Comments</FONT></B></A>
<PRE>
  The computed matrices B and D are not the least squares solutions
  delivered by either MOESP or N4SID algorithms, except for the
  special case n = s - 1, L = 1. However, the computed B and D are
  frequently good enough estimates, especially for  METH = 'M'.
  Better estimates could be obtained by calling SLICOT Library
  routine IB01PX, but it is less efficient, and requires much more
  workspace.

</PRE>

<A name="Example"><B><FONT SIZE="+1">Example</FONT></B></A>
<P>
<B>Program Text</B>
<PRE>
  None
</PRE>
<B>Program Data</B>
<PRE>
  None
</PRE>
<B>Program Results</B>
<PRE>
  None
</PRE>

<HR>
<A HREF=support.html><B>Return to Supporting Routines index</B></A></BODY>
</HTML>