Hello everyone,
I am working on an element in whose formulation I need to determine the eigenvalues and the eigenvectors of a matrix... could anybody let me know how I may do eigen analysis in OpenSees? I tried using the following lines, but I could not set the size for theEigenSOE object:
static BandGenLinSolver *theSolver = new BandGenLinLapackSolver();
static LinearSOE *theArpackSOE = new BandGenLinSOE(*theSolver);
static EigenSOE *theEigenSOE = new ArpackSOE(*theArpackSOE, 0.0);
theEigenSOE->zeroA();
theEigenSOE->zeroM();
theEigenSOE->addA(K_ms, eleID); // "K_ms" is the matrix I need its eigenvalues
theEigenSOE->addM(I, eleID); // "I" is identity matrix
theEigenSOE->solve(9, true);
eigenValues(i) = theEigenSOE->getEigenvalue(i);
eigenVectors[i] = theEigenSOE->getEigenvector(i);
Also, I am wondering if any of the solvers other than Arpack can compute all the N eigenvalues of a N-by-N matrix, instead of the first N-1. I am looking forward to hearing from you and thanks in advance.
How to Get Eigen Values and Eigen Vectors of a Matrix?
Moderators: silvia, selimgunay, Moderators
How to Get Eigen Values and Eigen Vectors of a Matrix?
Mohammad Salehi
Graduate Research Assistant
PhD Student - Structural Engineering and Structural Mechanics
University of Colorado at Boulder
Graduate Research Assistant
PhD Student - Structural Engineering and Structural Mechanics
University of Colorado at Boulder
Re: How to Get Eigen Values and Eigen Vectors of a Matrix?
I found out how to do this... for those who may concern, you need to modify the FullGenEigenSolver class or similar EigenSolver classes to get a Matrix object without calling analysis classes and needing Graph objects to set the size given to the EigenSolver; you also need to utilize a couple of functions of FullGenEigenSOE to add matrices to the class in the form of pointers, i.e. FullGenEigenSOE::addA() and addM()... By the way, note that while FullGenEigenSolver refers to a Fortran code which can compute all the N eigenvalues of a N-by-N matrix, Arpack solver can only compute the first N-1.
Mohammad Salehi
Graduate Research Assistant
PhD Student - Structural Engineering and Structural Mechanics
University of Colorado at Boulder
Graduate Research Assistant
PhD Student - Structural Engineering and Structural Mechanics
University of Colorado at Boulder