I am trying to make a 50x50 matrix that has values in the +1 diagonally and the -1 diagonal that are a function of its position and then take the eigenvalue for the given matrix.
For example: for a 5x5 matrix it would be as follows: [(0,x,0,0,0),(x,0,x,0,0),(0,x,0,x,0),(0,0,x,0,x),(0,0,0,x,0)] where x is a represented by the function (i(n-j))^(1/2) Here n is the size of the matrix (5), i is the row number and j is the column number.
I also have to do this for a matrix that has the +1,-1 diagonals equal to -1 and then solve for the eigenvalues but have not had any luck doing so. I was wondering if someone could help me out with this.
This is how I was attempting to do that problem.
1) a = SparseArray[{Band[{2, 1}] -> -1, Band[{1, 2}] -> -1}, {50, 50}] // MatrixForm
2)Eigenvalues[{a}]
Line 1) creates a matrix exactly how it needs to be but, line 2) does not find the eigenvalues for the given matrix (a).
Thank you very much for anyone that does pay this any attention.
Andrew