functioneigenValuesAsRealMatrix
Return eigenvalues for a real, nonsymmetric matrix in a Real representation (computation with optional balancing)
Extends from Modelica.Icons.Function (Icon for functions).
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.
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:,size(A, 1)] | A | Matrix | |
| Boolean | balance | true | =true, if A is balanced (pre-scaled) before computation of the eigen values |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[size(A, 1),2] | eigenvalues | Eigenvalues of matrix A (Re: first column, Im: second column) |