algorithmic modeling for Rhino
Hello,
I was trying to find a computational method of acquriing the eigenvalues and eigenvectors of a high dimension square matrix. I am an architect and have little knowledge regarding this field, but have found out that I need to get the eigenvalues of a square matrix, to do the SVD method and get teh diagonal matrix. However, when I inserted the numbers in the eigen system component, I do not get the adequate eigenvalues. For a matrix 7,3;3,-1 I get the correct values, but for a similar 2x2 matrix 1,5;3,3 I do not get good values, Same goes for higher dimensional matrices. I know how to do it manually and for a 3x3 matrix but would like to implement higher dimensional ones as well. Can you help me in recognizing the problem with the component, arranging the numbers adequately for the matrix input and/or procuring some examples that use this component and/or similar method. Thank You in advance for Your time and patience.
Tags:
Hi,
The eigensystem component expects square and symmetric matrices [so whether you are using column major or row major order does not matter].
[7,3,3-1] is symmetric but [1,5,3,3] is not. The component assumes that the second matrix is symmetric and so picks only 5 or 3 .
Also note that the eigenvectors have complex components but GH makes it look as if each complex number is a 2 vector.
Millipede is using Intel Math Kernel Library internally for eigensystem decomposition [which is a C/C++ library]
If you do need to solve for non symmetric matrices then you need a different library.
I think there are a few .net libraries that would do the same and would be easily accessible in GH [just create a C# component, attach the dll file and call the function inside [possibly one line of code]]
hope that helps,
Hi,
Thanks for a quick reply.
I have a symmetric matrix which I would like to solve, I was just using lower column and row matrices to check if it works. Now I understand where I have made an error. So it will work for a covariance matrix, whhich is symmetric, and procure eigenvalues and eigenvectors accordingly. Thank You again.
Hi,
I have another question regarding the vectors. You said that a higher dimensional matrices have complex eigenvectors but instead GH gives two numbers for each vector. How do you go about getting a correct value of a vector, in higher dimensional matrix?
I think I got it, just extract those numbers using complex components component in GH and I'll get the eigenvectors, respectively. Hopefully, You can confirm this. Thanks
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by