.Modelica_LinearSystems2.Math.Matrices.eigenValuesAsRealMatrix

Information

Syntax

eigenvalues = Matrices.eigenValuesAsRealMatrix(A);

Description

This function call returns the eigenvalues of a square matrix A. The first column of "eigenvalues" contains the real and the second column contains the imaginary part of the eigenvalues. Before calculating the eigenvalues, matrix A is permuted and scaled (balanced) to improve the computation. For details see the lapack documentation.

Example

  Real A[3,3] = [1,2,3;
                 3,4,5;
                 2,1,4];
  Real eval[3,2];
algorithm
  eval := Matrices.eigenValuesAsRealMatrix(A);  // eval = [ 8.0  , 0;
                                                //         -0.618, 0;
                                                //          1.618, 0];

i.e., matrix A has the 3 real eigenvalues 8.0, -0.618, 1.618.

Interface

function eigenValuesAsRealMatrix
  extends Modelica.Icons.Function;
  input Real A[:, size(A, 1)] "Matrix";
  input Boolean balance = true "=true, if A is balanced (pre-scaled) before computation of the eigen values";
  output Real eigenvalues[size(A, 1), 2] "Eigenvalues of matrix A (Re: first column, Im: second column)";
end eigenValuesAsRealMatrix;

Generated at 2024-04-28T18:16:21Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos