Eigenvector

Top  Previous  Next

EIGENVECTOR is a utility that calculates the eigenvalues and eigenvectors of a symmetric positive-definite matrix.

It is used by using $Call or Execute on the command

 eigenvector inputgdxfile indexofmatrix matrixtofindeigen outputgdxfile resultanteigenvalues resultanteigenvectors

Where the parameters in this line are

 

inputgdxfile

Name of gdxfile sent to invert that has the matrix for which to find eigenvalues

indexofmatrix

Name of set that defines row and column names of the matrix

matrixtofindeigen

Name of the matrix to find eigenvalues for that must be in inputgdxfile

outputgdxfile

Name of gdxfile  that has the resultant eigenvalues

resultanteigenvalues

Name to call the eigenvalue vector in the gdx file outputgdxfile

resultanteigenvectors

Name to call the eigenvector matrix in the gdx file outputgdxfile

 

Example eigenexample.gms

Set index /i1*i2/;

Table a(index,index) matrix to find eigenvalues for

             i1   i2

    i1       2     1

    i2       1     3;

parameter eigenvalues(index) vector of eigenvalues of A;

parameter eigenvector(index,index) matrix of eigenvectors of A;

execute_unload 'gdxforutility.gdx' index,A;

execute 'eigenvector gdxforutility.gdx index A gdxfromutility.gdx eigenvalues eigenvectors';

execute_load 'gdxfromutility.gdx' , eigenvalues, eigenvectors;

display a, eigenvalues,eigenvectors;