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!
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With