Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compute eigenvectors and eigenvalues of complex matrices in Modelica?

I am trying to use Modelica to compute the eigenvalues and eigenvectors for a complex matrix. Are there any libraries or built-in standard library functionality that I could leverage to assist me with this calculation?

Any help would be greatly appreciated!

like image 554
Alireza Masoom Avatar asked Dec 30 '25 18:12

Alireza Masoom


1 Answers

Check out the Math Matrices library it has various supported functions for matrices.

For example the eigenValues(...) method appears to be one that would be of interest to you:

(eval,evec) = eigenValues(A) - returns eigen values "eval" and eigen vectors "evec" for a real, nonsymmetric matrix A in a Real representation.

Straight from the documentation here is an example of using the eigenValues() method:

Example
  Real A[3,3] = [1,2,3;
                 3,4,5;
                 2,1,4];
  Real eval[3,2];
algorithm
  eval := Matrices.eigenValues(A);  // eval = [-0.618, 0;
                                    //          8.0  , 0;
                                    //          1.618, 0];
i.e., matrix A has the 3 real eigenvalues -0.618, 8, 1.618.

Hopefully that helps!

like image 167
Nathan Avatar answered Jan 01 '26 16:01

Nathan