.Modelica_LinearSystems2.Math.Matrices.rsf

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

Interface

function rsf
  extends Modelica.Icons.Function;
  import Modelica.Math.Matrices.LAPACK;
  input Real A[:, size(A, 1)];
  output Real T[size(A, 1), size(A, 2)];
  output Real Z[size(A, 1), size(A, 2)];
  output Real alphaReal[size(A, 1)] "Real part of eigenvalue=alphaReal+i*alphaImag";
  output Real alphaImag[size(A, 1)] "Imaginary part of eigenvalue=(alphaReal+i*alphaImag";
end rsf;

Generated at 2024-11-23T19:25:52Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos