functionrsf

Computes the real Schur form (RSF) of a square matrix

Extends from Modelica.Icons.Function (Icon for functions).

Information

Syntax

(T, Z, alphaReal, alphaImag) = Matrices.rsf(A)

Description

Function rsf (real Schur form) calculates the real Schur form of a real square matrix A, i.e.

A = Z*T*ZT

with the real nxn matrices T and Z. Z is an orthogonal matrix. T is an block upper triangular matrix with 1x1 and 2x2 blocks in the diagonal. The 1x1 blocks contains the real eigenvalues of a. The 2x2 blocks are matrices with the conjugated complex pairs of eigenvalues, whereas the real parts of the eigenvalues are the elements of the diagonal.

The calculation is performed stepwise using several lapack routines. First, lapack.dgehrd reduces matrix A is to upper Hessenberg form H=Q'AQ, whereas Q is computed by lapack.dodrghr. Finally, lapack.dhseqr transforms H to T. The eigenvalues of A are calculated straightforward from T.

Function rsf does not apply lapack.dgees, a routine to directly compute the real Schur from.

Example

  Real A[3,3] = [1, 2, 3; 4, 5, 6; 7, 8, 9];
  Real T[3,3];
  Real Z[3,3];
  Real alphaReal[3];
  Real alphaImag[3];

algorithm
  (T, Z, alphaReal, alphaImag):=Modelica_LinearSystems2.Math.Matrices.rsf(A);
//   T = [16.12, 4.9,   1.59E-015;
//        0,    -1.12, -1.12E-015;
//        0,     0,    -1.30E-015]
//   Z = [-0.23,  -0.88,   0.41;
//        -0.52,  -0.24,  -0.82;
//        -0.82,   0.4,    0.41]
//alphaReal = {16.12, -1.12, -1.32E-015}
//alphaImag = {0, 0, 0}

See also

Modelica.Math.Matrices.realSchur

Inputs

TypeNameDefaultDescription
Real[:,size(A, 1)]A

Outputs

TypeNameDefaultDescription
Real[size(A, 1),size(A, 2)]T
Real[size(A, 1),size(A, 2)]Z
Real[size(A, 1)]alphaRealReal part of eigenvalue=alphaReal+i*alphaImag
Real[size(A, 1)]alphaImagImaginary part of eigenvalue=(alphaReal+i*alphaImag