1
<?xml version="1.0" encoding="UTF-8"?>
3
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4
* Copyright (C) 2008 - INRIA
6
* This file must be used under the terms of the CeCILL.
7
* This source file is licensed as described in the file COPYING, which
8
* you should have received as part of this distribution. The terms
9
* are also available at
10
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
13
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="en" xml:id="schur">
15
<refname>schur</refname>
16
<refpurpose> [ordered] Schur decomposition of matrix and pencils</refpurpose>
19
<title>Calling Sequence</title>
20
<synopsis>[U,T] = schur(A)
21
[U,dim [,T] ]=schur(A,flag)
22
[U,dim [,T] ]=schur(A,extern1)
24
[As,Es [,Q,Z]]=schur(A,E)
25
[As,Es [,Z,dim]] = schur(A,E,flag)
26
[Z,dim] = schur(A,E,flag)
27
[As,Es [,Z,dim]]= schur(A,E,extern2)
28
[Z,dim]= schur(A,E,extern2)
32
<title>Arguments</title>
37
<para>real or complex square matrix.</para>
44
real or complex square matrix with same dimensions as <literal> A</literal>.
52
character string (<literal>'c'</literal> or <literal>'d'</literal>)
59
<para>an ``external'', see below</para>
65
<para>an ``external'', see below</para>
71
<para>orthogonal or unitary square matrix</para>
77
<para>orthogonal or unitary square matrix</para>
83
<para>orthogonal or unitary square matrix</para>
89
<para>upper triangular or quasi-triangular square matrix</para>
95
<para>upper triangular or quasi-triangular square matrix</para>
101
<para>upper triangular square matrix</para>
113
<title>Description</title>
115
Schur forms, ordered Schur forms of matrices and pencils
119
<term>MATRIX SCHUR FORM</term>
123
<term>Usual schur form:</term>
126
<literal>[U,T] = schur(A)</literal> produces a Schur matrix
127
<literal>T</literal> and a unitary matrix <literal>U</literal> so that
128
<literal>A = U*T*U'</literal> and <literal>U'*U = eye(U)</literal>. By itself, schur(<literal>A</literal>) returns
129
<literal>T</literal>. If <literal>A</literal> is complex, the Complex
130
Schur Form is returned in matrix
131
<literal>T</literal>. The Complex Schur Form is upper triangular with
132
the eigenvalues of <literal>A</literal> on the diagonal. If
133
<literal>A</literal> is real, the Real Schur Form is returned. The Real
134
Schur Form has the real eigenvalues on the diagonal and the
135
complex eigenvalues in 2-by-2 blocks on the diagonal.
140
<term>Ordered Schur forms</term>
143
<literal>[U,dim]=schur(A,'c')</literal> returns an unitary
144
matrix <literal>U</literal> which transforms <literal>A</literal> into schur
145
form. In addition, the dim first columns of <literal>U</literal> make
146
a basis of the eigenspace of <literal>A</literal> associated with
147
eigenvalues with negative real parts (stable "continuous
151
<literal>[U,dim]=schur(A,'d')</literal> returns an unitary
152
matrix <literal>U</literal> which transforms <literal>A</literal> into schur
153
form. In addition, the <literal>dim</literal> first columns of
154
<literal>U</literal> span a basis of the eigenspace of <literal>A</literal>
155
associated with eigenvalues with magnitude lower than 1 (stable
156
"discrete time" eigenspace).
159
<literal>[U,dim]=schur(A,extern1)</literal> returns an unitary matrix
160
<literal>U</literal> which transforms <literal>A</literal> into schur form.
161
In addition, the <literal>dim</literal> first columns of
162
<literal>U</literal> span a basis of the eigenspace of <literal>A</literal>
163
associated with the eigenvalues which are selected by the
164
external function <literal>extern1</literal> (see external for
165
details). This external can be described by a Scilab function
166
or by C or Fortran procedure:
170
<term>a Scilab function</term>
173
If <literal>extern1</literal> is described by a Scilab function, it
174
should have the following calling sequence:
175
<literal>s=extern1(Ev)</literal>, where <literal>Ev</literal> is an eigenvalue and
176
<literal>s</literal> a boolean.
181
<term>a C or Fortran procedure</term>
184
If <literal>extern1</literal> is described by a C or Fortran function it
185
should have the following calling sequence:
186
<literal>int extern1(double *EvR, double *EvI)</literal>
187
where <literal>EvR</literal> and <literal>EvI</literal> are eigenvalue real and complex parts.
188
a true or non zero returned value stands for selected eigenvalue.
199
<term>PENCIL SCHUR FORMS</term>
203
<term>Usual Pencil Schur form</term>
206
<literal>[As,Es] = schur(A,E)</literal> produces a quasi triangular
207
<literal>As</literal> matrix and a triangular <literal>Es</literal> matrix
208
which are the generalized Schur form of the pair <literal>A, E</literal>.
211
<literal>[As,Es,Q,Z] = schur(A,E)</literal>
212
returns in addition two unitary matrices
213
<literal>Q</literal> and <literal>Z</literal> such that
214
<literal>As=Q'*A*Z</literal> and <literal>Es=Q'*E*Z</literal>.
219
<term>Ordered Schur forms:</term>
222
<literal>[As,Es,Z,dim] = schur(A,E,'c')</literal>
223
returns the real generalized
224
Schur form of the pencil <literal>s*E-A</literal>. In addition, the dim first columns
225
of <literal>Z</literal> span a basis of the right eigenspace associated with
226
eigenvalues with negative real parts (stable "continuous
227
time" generalized eigenspace).
230
<literal>[As,Es,Z,dim] = schur(A,E,'d')</literal>
233
returns the real generalized
234
Schur form of the pencil <literal>s*E-A</literal>. In addition, the dim first columns
235
of <literal>Z</literal> make a basis of the right eigenspace associated with
236
eigenvalues with magnitude lower than 1 (stable "discrete
237
time" generalized eigenspace).
240
<literal>[As,Es,Z,dim] = schur(A,E,extern2)</literal>
243
returns the real generalized Schur form of the pencil <literal>s*E-A</literal>.
244
In addition, the dim first columns
245
of <literal>Z</literal> make a basis of the right eigenspace associated with
246
eigenvalues of the pencil which are selected according to a
247
rule which is given by the function <literal>extern2</literal>. (see external
248
for details). This external can be described by a Scilab
249
function or by C or Fortran procedure:
253
<term>A Scilab function</term>
256
If <literal>extern2</literal> is described by a Scilab function, it should
257
have the following calling sequence:
258
<literal>s=extern2(Alpha,Beta)</literal>, where <literal>Alpha</literal> and
259
<literal>Beta</literal> defines a generalized eigenvalue and
260
<literal>s</literal> a boolean.
265
<term>C or Fortran procedure</term>
268
if external <literal>extern2</literal> is described by a C or a
269
Fortran procedure, it should have the following calling
273
<literal>int extern2(double *AlphaR, double *AlphaI, double *Beta)</literal>
276
if <literal>A</literal> and <literal>E</literal> are real and
279
<literal>int extern2(double *AlphaR, double *AlphaI, double *BetaR, double *BetaI)</literal>
282
if <literal>A</literal> or <literal>E</literal> are complex.
283
<literal>Alpha</literal>, and <literal>Beta</literal> defines the generalized eigenvalue.
284
a true or non zero returned value stands for selected generalized eigenvalue.
297
<title>References</title>
299
Matrix schur form computations are based on the Lapack routines DGEES and ZGEES.
302
Pencil schur form computations are based on the Lapack routines DGGES and ZGGES.
306
<title>Examples</title>
307
<programlisting role="example"><![CDATA[
308
//SCHUR FORM OF A MATRIX
309
//----------------------
310
A=diag([-0.9,-2,2,0.9]);X=rand(A);A=inv(X)*A*X;
313
[U,dim,T]=schur(A,'c');
314
T(1:dim,1:dim) //stable cont. eigenvalues
316
function t=mytest(Ev),t=abs(Ev)<0.95,endfunction
317
[U,dim,T]=schur(A,mytest);
320
// The same function in C (a Compiler is required)
322
C=['int mytest(double *EvR, double *EvI) {' //the C code
323
'if (*EvR * *EvR + *EvI * *EvI < 0.9025) return 1;'
325
mputl(C,TMPDIR+'/mytest.c')
329
lp=ilib_for_link('mytest','mytest.c',[],'c');
330
link(lp,'mytest','c');
333
[U,dim,T]=schur(A,'mytest');
334
//SCHUR FORM OF A PENCIL
335
//----------------------
340
A=coeff(F,0);E=coeff(F,1);
341
[As,Es,Q,Z]=schur(A,E);
342
Q'*F*Z //It is As+%s*Es
345
[As,Es,Z,dim] = schur(A,E,'c')
346
function t=mytest(Alpha,Beta),t=real(Alpha)<0,endfunction
347
[As,Es,Z,dim] = schur(A,E,mytest)
349
//the same function in Fortran (a Compiler is required)
350
ftn=['integer function mytestf(ar,ai,b)' //the fortran code
351
'double precision ar,ai,b'
353
'if(ar.lt.0.0d0) mytestf=1'
355
mputl(' '+ftn,TMPDIR+'/mytestf.f')
358
lp=ilib_for_link('mytestf','mytestf.f',[],'F');
359
link(lp,'mytestf','f');
363
[As,Es,Z,dim] = schur(A,E,'mytestf')
366
<refsection role="see also">
367
<title>See Also</title>
368
<simplelist type="inline">
370
<link linkend="spec">spec</link>
373
<link linkend="bdiag">bdiag</link>
376
<link linkend="ricc">ricc</link>
379
<link linkend="pbig">pbig</link>
382
<link linkend="psmall">psmall</link>