-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsl_gsep.m
316 lines (313 loc) · 16.7 KB
/
sl_gsep.m
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
%SL_GSEP MEX-function for descriptor system spectral separations.
%
% [At,Et,Bt,Ct,...] = SL_GSEP(TASK,A,E,B,C,...) computes, according to
% the selected value TASK = 1-6, a specific similarity transformation
% to separate the generalized eigenvalues of the pair (A,E), as follows:
% TASK = 1: finite-infinite separation
% TASK = 2: reduction to generalized Hessenberg form with
% finite-infinite separation
% TASK = 3: reduction to generalized real Schur form with
% finite-infinite separation
% TASK = 4: reduction to block diagonal generalized real Schur form
% with finite-infinite separation
% TASK = 5: reduction to generalized Schur form with ordered
% finite-infinite separation
% TASK = 6: reduction to block diagonal generalized real Schur form
% with ordered finite-infinite separation
%
% See also sl_gsep1, sl_gsep2, sl_gsep3, sl_gsep4, sl_gsep5, sl_gsep6,
% corresponding to the choices TASK = 1, 2, ..., 6, respectively.
% Author: A. Varga, 13-01-2016.
% Revision(s):
%
%SL_GSEP MEX-function for finite-infinite spectral separation.
%
% [At,Et,Bt,Ct,DIMS,TAU,Q,Z] = sl_gsep(1,A,E,B,C,JOB,TOL) computes, for
% the descriptor system triple (A-lambda*E,B,C), the orthogonal
% transformation matrices Q and Z, such that the transformed descriptor
% system triple
% (At-lambda*Et,Bt,Ct) = (Q*A*Z-lambda*Q*E*Z,Q*B,C*Z)
% has the matrices At and Et in the block upper triangular form
%
% ( A11 A12 ) ( E11 E12 )
% At = ( ) , Et = ( ) ,
% ( 0 A22 ) ( 0 E22 )
%
% where the pairs (A11,E11) and (A22,E22) have distinct sets of
% generalized eigenvalues, as specified by the input parameter JOB:
% JOB = 0: (A11,E11) contains the infinite spectrum, with A11 invertible
% and upper triangular and E11 nilpotent and upper triangular;
% (A22,E22) contains the finite spectrum, with
% E22 invertible (default);
% JOB = 1: (A11,E11) contains the finite spectrum, with E11 invertible,
% and (A22,E22) contains the infinite spectrum, with A22
% invertible and upper triangular and E11 nilpotent and
% upper triangular.
% TOL specifies an optional relative tolerance for rank computations
% (default: internally computed).
%
% The output parameters DIMS and TAU provide additional information on the
% structure of the resulting pair (At,Et), as follows:
% DIMS is a vector [n1,0,n2,rankE], where n1 is the order of the pencil
% A11-lambda*E11, n2 is the order of the pencil A22-lambda*E22, and
% rankE is the rank of E;
% TAU contains the dimensions of the diagonal blocks in the subpencil
% which contains the infinite eigenvalues. The number of
% simple (nondynamic) infinite generalized eigenvalues of the pair (A,E)
% is contained in TAU(END) for JOB = 0 and TAU(1) for JOB = 1.
%
%
%SL_GSEP MEX-function for Hessenberg finite-infinite spectral separation.
%
% [At,Et,Bt,Ct,DIMS,TAU,Q,Z] = sl_gsep(2,A,E,B,C,JOB,TOL) computes, for
% the descriptor system triple (A-lambda*E,B,C), the orthogonal
% transformation matrices Q and Z, such that the transformed descriptor
% system triple
% (At-lambda*Et,Bt,Ct) = (Q*A*Z-lambda*Q*E*Z,Q*B,C*Z)
% has the pair (At,Et) in a generalized Hessenberg form with At and Et
% having the block upper triangular forms
%
% ( A11 A12 ) ( E11 E12 )
% At = ( ) , Et = ( ) ,
% ( 0 A22 ) ( 0 E22 )
%
% where the pairs (A11,E11) and (A22,E22) have distinct sets of
% generalized eigenvalues, as specified by the input parameter JOB:
% JOB = 0: (A11,E11) contains the infinite spectrum, with A11 invertible
% and upper triangular and E11 nilpotent and upper triangular;
% (A22,E22) contains the finite spectrum, with A22 in upper
% Hessenberg form and E22 invertible and upper triangular;
% JOB = 1: (A11,E11) contains the finite spectrum, with A11 in upper
% Hessenberg form and E11 invertible and upper triangular, and
% (A22,E22) contains the infinite spectrum, with A22
% invertible and upper triangular and E11 nilpotent and
% upper triangular.
% TOL specifies an optional relative tolerance for rank computations
% (default: internally computed).
%
% The output parameters DIMS and TAU provide additional information on the
% structure of the resulting pair (At,Et), as follows:
% DIMS is a vector [n1,0,n2,rankE], where n1 is the order of the pencil
% A11-lambda*E11, n2 is the order of the pencil A22-lambda*E22, and
% rankE is the rank of E;
% TAU contains the dimensions of the diagonal blocks in the subpencil
% which contains the infinite eigenvalues. The number of
% simple (nondynamic) infinite generalized eigenvalues of the pair (A,E)
% is contained in TAU(END) for JOB = 0 and TAU(1) for JOB = 1.
%
%
%SL_GSEP MEX-function for Schur finite-infinite spectral separation.
%
% [At,Et,Bt,Ct,DIMS,TAU,Q,Z] = sl_gsep(3,A,E,B,C,JOB,TOL) computes, for
% the descriptor system triple (A-lambda*E,B,C), the orthogonal
% transformation matrices Q and Z, such that the transformed descriptor
% system triple
% (At-lambda*Et,Bt,Ct) = (Q*A*Z-lambda*Q*E*Z,Q*B,C*Z)
% has the pair (At,Et) in a generalized real Schur form with At and Et
% having the block upper triangular forms
%
% ( A11 A12 ) ( E11 E12 )
% At = ( ) , Et = ( ) ,
% ( 0 A22 ) ( 0 E22 )
%
% where the pairs (A11,E11) and (A22,E22) have distinct sets of
% generalized eigenvalues, as specified by the input parameter JOB:
% JOB = 0: (A11,E11) contains the infinite spectrum, with A11 invertible
% and upper triangular and E11 nilpotent and upper triangular;
% (A22,E22) contains the finite spectrum, with A22 upper
% quasi-triangular and E22 invertible and upper triangular;
% JOB = 1: (A11,E11) contains the finite spectrum, with A11 upper
% quasi-triangular and E11 invertible and upper triangular, and
% (A22,E22) contains the infinite spectrum, with A22
% invertible and upper triangular and E11 nilpotent and
% upper triangular.
% TOL specifies an optional relative tolerance for rank computations
% (default: internally computed).
%
% The output parameters DIMS and TAU provide additional information on the
% structure of the resulting pair (At,Et), as follows:
% DIMS is a vector [n1,0,n2,rankE], where n1 is the order of the pencil
% A11-lambda*E11, n2 is the order of the pencil A22-lambda*E22, and
% rankE is the rank of E;
% TAU contains the dimensions of the diagonal blocks in the subpencil
% which contains the infinite eigenvalues. The number of
% simple (nondynamic) infinite generalized eigenvalues of the pair (A,E)
% is contained in TAU(END) for JOB = 0 and TAU(1) for JOB = 1.
%
%
%SL_GSEP MEX-function for block-diagonal finite-infinite spectral separation.
%
% [At,Et,Bt,Ct,DIMS,TAU,Q,Z] = sl_gsep(4,A,E,B,C,JOB,TOL) computes, for
% the descriptor system triple (A-lambda*E,B,C), the transformation
% matrices Q and Z, such that the transformed descriptor system triple
% (At-lambda*Et,Bt,Ct) = (Q*A*Z-lambda*Q*E*Z,Q*B,C*Z)
% has the pair (At,Et) in a generalized real Schur form with At and Et
% having the block-diagonal forms
%
% ( A11 0 ) ( E11 0 )
% At = ( ) , Et = ( ) ,
% ( 0 A22 ) ( 0 E22 )
%
% where the pairs (A11,E11) and (A22,E22) have distinct sets of
% generalized eigenvalues, as specified by the input parameter JOB:
% JOB = 0: (A11,E11) contains the infinite spectrum, with A11 invertible
% and upper triangular and E11 nilpotent and upper triangular;
% (A22,E22) contains the finite spectrum, with A22 upper
% quasi-triangular and E22 invertible and upper triangular;
% JOB = 1: (A11,E11) contains the finite spectrum, with A11 upper
% quasi-triangular and E11 invertible and upper triangular, and
% (A22,E22) contains the infinite spectrum, with A22
% invertible and upper triangular and E11 nilpotent and
% upper triangular.
% TOL specifies an optional relative tolerance for rank computations
% (default: internally computed).
%
% The output parameters DIMS and TAU provide additional information on the
% structure of the resulting pair (At,Et), as follows:
% DIMS is a vector [n1,0,n2,rankE], where n1 is the order of the pencil
% A11-lambda*E11, n2 is the order of the pencil A22-lambda*E22, and
% rankE is the rank of E;
% TAU contains the dimensions of the diagonal blocks in the subpencil
% which contains the infinite eigenvalues. The number of
% simple (nondynamic) infinite generalized eigenvalues of the pair (A,E)
% is contained in TAU(END) for JOB = 0 and TAU(1) for JOB = 1.
%
%
%SL_GSEP MEX-function for ordered Schur finite-infinite spectral separation.
%
% [At,Et,Bt,Ct,DIMS,TAU,Q,Z] = sl_gsep(5,A,E,B,C,JOB,TOL,DISC,SMARG)
% computes, for the descriptor system triple (A-lambda*E,B,C), the
% orthogonal transformation matrices Q and Z, such that the transformed
% descriptor system triple
% (At-lambda*Et,Bt,Ct) = (Q*A*Z-lambda*Q*E*Z,Q*B,C*Z)
% has the pair (At,Et) in a generalized real Schur form with At and Et
% having the block upper-triangular forms
%
% ( A11 A12 A13 ) ( E11 E12 E13 )
% At = ( 0 A22 A23 ) , Et = ( 0 E22 E23 ) ,
% ( 0 0 A33 ) ( 0 0 E33 )
%
% where the pairs (A11,E11), (A22,E22) and (A33,A33) have distinct sets of
% generalized eigenvalues, as specified by the input parameter JOB:
% JOB = 0: (A11,E11) contains the infinite spectrum, with A11 invertible
% and upper triangular and E11 nilpotent and upper triangular;
% (A22,E22) contains the unstable finite spectrum, with A22
% upper quasi-triangular and E22 invertible and
% upper triangular; and
% (A33,E33) contains the stable finite spectrum, with A33
% upper quasi-triangular and E33 invertible and
% upper triangular;
% JOB = 1: (A11,E11) contains the stable finite spectrum, with A11
% upper quasi-triangular and E11 invertible and
% upper triangular;
% (A22,E22) contains the unstable finite spectrum, with A22
% upper quasi-triangular and E22 invertible; and
% (A33,E33) contains the infinite spectrum, with A33 invertible
% and upper triangular and E33 nilpotent and upper triangular;
% JOB = 2: (A11,E11) contains the infinite spectrum, with A11 invertible
% and upper triangular and E11 nilpotent and upper triangular;
% (A22,E22) contains the stable finite spectrum, with A22
% upper quasi-triangular and E22 invertible and
% upper triangular; and
% (A33,E33) contains the unstable finite spectrum with A33
% upper quasi-triangular and E33 invertible and
% upper triangular;
% JOB = 3: (A11,E11) contains the unstable finite spectrum, with A11
% upper quasi-triangular and E11 invertible and
% upper triangular;
% (A22,E22) contains the stable finite spectrum, with A22
% upper quasi-triangular and E22 invertible and
% upper triangular; and
% (A33,E33) contains the infinite spectrum, with A33 invertible
% and upper triangular and E33 nilpotent and upper triangular.
% TOL specifies an optional relative tolerance for rank computations
% (default: internally computed).
% DISC and SMARG specifies the stability domain for the generalized
% eigenvalues of the pair (A,E), as follows:
% DISC = 0: complex numbers with real parts at most SMARG (default);
% DISC = 1: complex numbers with moduli at most SMARG.
% The default values of SMARG are -sqrt(eps) for DISC = 0 and
% 1-sqrt(eps) for DISC = 1.
%
% The output parameters DIMS and TAU provide additional information on the
% structure of the resulting pair (At,Et), as follows:
% DIMS is a vector [n1,n2,n3,rankE], where n1 is the order of the pencil
% A11-lambda*E11, n2 is the order of the pencil A22-lambda*E22, n3 is the
% order of the pencil A33-lambda*E33, and rankE is the rank of E;
% TAU contains the dimensions of the diagonal blocks in the subpencil
% which contains the infinite eigenvalues. The number of
% simple (nondynamic) infinite generalized eigenvalues of the pair (A,E)
% is contained in TAU(END) for JOB = 0 or 2 and TAU(1) for JOB = 1 or 3.
%
%
%SL_GSEP MEX-function for ordered block-diagonal spectral separation.
%
% [At,Et,Bt,Ct,DIMS,TAU,Q,Z] = sl_gsep(6,A,E,B,C,JOB,TOL,DISC,SMARG)
% computes, for the descriptor system triple (A-lambda*E,B,C), the
% transformation matrices Q and Z, such that the transformed descriptor
% system triple
% (At-lambda*Et,Bt,Ct) = (Q*A*Z-lambda*Q*E*Z,Q*B,C*Z)
% has the pair (At,Et) in a generalized real Schur form with At and Et
% having a block-diagonal form
%
% ( A11 A12 A13 ) ( E11 E12 E13 )
% At = ( 0 A22 A23 ) , Et = ( 0 E22 E23 ) ,
% ( 0 0 A33 ) ( 0 0 E33 )
%
% with either A13, A23, E13, E23 zero or A12, A13, E12, E13 zero, and
% where the pairs (A11,E11), (A22,E22) and (A33,A33) have distinct sets of
% generalized eigenvalues, as specified by the input parameter JOB:
% JOB = 0: A13, A23, E13, E23 are zero, and
% (A11,E11) contains the infinite spectrum, with A11 invertible
% and upper triangular and E11 nilpotent and upper triangular;
% (A22,E22) contains the unstable finite spectrum, with A22
% upper quasi-triangular and E22 invertible and
% upper triangular; and
% (A33,E33) contains the stable finite spectrum, with A33
% upper quasi-triangular and E33 invertible and
% upper triangular;
% JOB = 1: A12, A13, E12, E13 are zero and
% (A11,E11) contains the stable finite spectrum, with A11
% upper quasi-triangular and E11 invertible and
% upper triangular;
% (A22,E22) contains the unstable finite spectrum, with A22
% upper quasi-triangular and E22 invertible; and
% (A33,E33) contains the infinite spectrum, with A33 invertible
% and upper triangular and E33 nilpotent and upper triangular;
% JOB = 2: A13, A23, E13, E23 are zero, and
% (A11,E11) contains the infinite spectrum, with A11 invertible
% and upper triangular and E11 nilpotent and upper triangular;
% (A22,E22) contains the stable finite spectrum, with A22
% upper quasi-triangular and E22 invertible and
% upper triangular; and
% (A33,E33) contains the unstable finite spectrum with A33
% upper quasi-triangular and E33 invertible and
% upper triangular;
% JOB = 3: A12, A13, E12, E13 are zero and
% (A11,E11) contains the unstable finite spectrum, with A11
% upper quasi-triangular and E11 invertible and
% upper triangular;
% (A22,E22) contains the stable finite spectrum, with A22
% upper quasi-triangular and E22 invertible and
% upper triangular; and
% (A33,E33) contains the infinite spectrum, with A33 invertible
% and upper triangular and E33 nilpotent and upper triangular.
% TOL specifies an optional relative tolerance for rank computations
% (default: internally computed).
% DISC and SMARG specifies the stability domain for the generalized
% eigenvalues of the pair (A,E), as follows:
% DISC = 0: complex numbers with real parts at most SMARG (default);
% DISC = 1: complex numbers with moduli at most SMARG.
% The default values of SMARG are -sqrt(eps) for DISC = 0 and
% 1-sqrt(eps) for DISC = 1.
%
% The output parameters DIMS and TAU provide additional information on the
% structure of the resulting pair (At,Et), as follows:
% DIMS is a vector [n1,n2,n3,rankE], where n1 is the order of the pencil
% A11-lambda*E11, n2 is the order of the pencil A22-lambda*E22, n3 is the
% order of the pencil A33-lambda*E33, and rankE is the rank of E;
% TAU contains the dimensions of the diagonal blocks in the subpencil
% which contains the infinite eigenvalues. The number of
% simple (nondynamic) infinite generalized eigenvalues of the pair (A,E)
% is contained in TAU(END) for JOB = 0 or 2 and TAU(1) for JOB = 1 or 3.
%