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 still leaves me with the question on how I make a matrix with the
+1,-1 diagonals as a function of their position.
The matrix you had, has -1 on the diagonals? Not -1 and +1. But if you want to replace all those -1 with values given by (i (n - j))^(1/2) where n is the size of the matrix, and i is the row number, and j is the column number, then one way is
ps. there might be a way to do the above directly at the Band level, but right now I do not know and I have a HW I have to finish soon, so have to go. I hope the above does what you wanted.
I was wondering if you could help me now with a way to add a variable in the (1,1) location and the (n,n) location and then solving for the eigenvalues. My professors have no idea how to do this.
I was wondering if you could help me now with a way to add a variable
in the (1,1) location and the (n,n) location and then solving for the
eigenvalues.
Do you mean add a number to the (1,1) and (n,n) locations after doing the above? You mean just like this:
This gets me exactly what I need(I know its not the same as mentioned above/ my professor changed it) except for the fact that I can not get the variable (g) to add into the 1,1 and n,n positions. Can someone please let me know what I am doing wrong.
Also once I have that I will take the matrix and find what conditions are needed for the variable (g) to produce real eigenvalues for the matrix.
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.