Creating a matrix with desirable eigenvalues

In summary, the conversation discusses ways to generate a matrix with eigenvalues in a small interval while maintaining a small difference between the maximum and minimum eigenvalues. One suggestion is to use a diagonal matrix and conjugate it with a random orthogonal transformation. Another option is to use the Gram-Schmidt process to create an orthogonal matrix with random orthogonal vectors as columns and then multiply it with a diagonal matrix with desired eigenvalues. LAPACK library is also recommended for better numerical behavior.
  • #1
Deimantas
41
0
Hello,

I want to generate a (large) matrix with eigenvalues that are all in a small interval. The relationship between the maximum eigenvalue and minimum eigenvalue should be as small as possible, that's the goal. And the eigenvalues must all be positive.

Is there any simple way to do this? I'm using Mathcad, and I've built a function to randomly generate a symmetric matrix. And when I want all the eigenvalues positive, I just use the matrix multiplied by it's transpose. But the eigenvalues are scattered in a large interval, and the relationship between the max eigenvalue and min eigenvalue is in the hundreds and thousands. Any tricks to make the eigenvalues get closer to each other?
 
Physics news on Phys.org
  • #2
Are you trying to generate random matrices? Because you can just pick a diagonal matrix if all you want is an arbitrary single such matrix.

Otherwise pick a diagonal matrix randomly, and conjugate it by a random orthogonal transformation. The eigenvalues are determined by the diagonal entries and the eigenvectors by the orthogonal matrix so by picking them with the appropriate distribution you can get your eigenvectors and eigenvalues to have whatever distribution you want without too much fuss.
 
  • Like
Likes 1 person
  • #3
Office_Shredder said:
Are you trying to generate random matrices? Because you can just pick a diagonal matrix if all you want is an arbitrary single such matrix.

Otherwise pick a diagonal matrix randomly, and conjugate it by a random orthogonal transformation. The eigenvalues are determined by the diagonal entries and the eigenvectors by the orthogonal matrix so by picking them with the appropriate distribution you can get your eigenvectors and eigenvalues to have whatever distribution you want without too much fuss.

Thanks for replying. So that's the easiest way, right? Could you give a simple example of conjugating a small diagonal matrix by an orthogonal transformation?
 
  • #4
^ Let's say you want a 2x2 matrix with eigenvalues 2 and 3. First you form the diagonal matrix

##\begin{pmatrix}2&0\\0&3\end{pmatrix}##

then you multiply this matrix from the left side with the rotation matrix (which is orthogonal)

##\begin{pmatrix}\cos\theta&\sin\theta\\-\sin\theta&\cos\theta\end{pmatrix}##

and finally you multiply the resulting matrix from the right side with the inverse rotation matrix

##\begin{pmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{pmatrix}##

If the parameter ##\theta## is chosen randomly from interval ##[0,2\pi]##, the eigenvalues are probably not obviously visible from the resulting matrix, but they will still be 2 and 3.
 
  • Like
Likes 1 person
  • #5
Thank you both for the help, much appreciated
 
  • #6
Look at the test programs that come with the LAPACK library, and their documentation. There are matrix generation routines that do this type of thing, and for "large" matrices they will probably have better numerical behavior than code you invent for yourself. IIRC they use other numerical methods besides the idea in post #4. http://www.netlib.org/lapack/
 
  • #7
I'm afraid acquinting myself with LAPACK would take too much time.. Oh and it turns out matrix rotation isn't exactly the thing I was looking for, because what I need is a 100x100 matrix, not 2x2 or 3x3..
 
  • #8
Deimantas said:
Oh and it turns out matrix rotation isn't exactly the thing I was looking for, because what I need is a 100x100 matrix, not 2x2 or 3x3..

You don't have to use a rotation matrix as the orthogonal transformation. You can form other orthogonal transformations by making NxN matrices that have a set of N orthogonal vectors as their columns. If you want to make a set of N orthogonal vectors in ℝN, just create N random vectors and use the Gram-Schmidt orthogonalization method on them.

Once you have created the orthogonal matrix ##U## that has the random orthogonal vectors as its columns, you just make the diagonal matrix ##D## that has the desired eigenvalues, and then compute ##U^{-1}DU##, which is a random matrix that has the eigenvalues you want. Remember that for an orthogonal matrix ##U##, ##U^{-1}## is just the transpose of ##U##.

For more info, see

http://en.wikipedia.org/wiki/Orthogonal_matrix

http://en.wikipedia.org/wiki/Gram-schmidt
 

1. How do I create a matrix with specific eigenvalues?

To create a matrix with desired eigenvalues, you can use the diagonalization method. First, determine the eigenvalues you want for your matrix. Then, create a diagonal matrix with these eigenvalues on the main diagonal. Finally, use the eigenvectors of this diagonal matrix to form your desired matrix.

2. What is the importance of having desirable eigenvalues in a matrix?

Having desirable eigenvalues in a matrix is important in many applications, such as in physics, engineering, and data analysis. Eigenvalues represent the scaling factor of the eigenvectors, and they can provide valuable information about the behavior of a system or data set.

3. Can you manipulate a matrix to have specific eigenvalues?

Yes, you can manipulate a matrix to have specific eigenvalues by using elementary row operations. These operations do not change the eigenvalues of a matrix, but they can change the eigenvectors. By carefully performing these operations, you can create a matrix with your desired eigenvalues.

4. Are there any limitations to creating a matrix with desirable eigenvalues?

There are some limitations to creating a matrix with desirable eigenvalues. For example, not all combinations of eigenvalues are possible for a given matrix size. Additionally, the process of creating a matrix with desired eigenvalues can be complex and may require advanced mathematical knowledge.

5. Can the number of eigenvalues in a matrix be changed?

No, the number of eigenvalues in a matrix cannot be changed. The number of eigenvalues is equal to the dimension of the matrix. However, you can manipulate the existing eigenvalues by using transformations on the matrix, such as scaling, rotation, or reflection.

Similar threads

  • Calculus and Beyond Homework Help
Replies
4
Views
845
  • Special and General Relativity
Replies
1
Views
548
  • Engineering and Comp Sci Homework Help
Replies
5
Views
5K
  • Linear and Abstract Algebra
Replies
5
Views
3K
Replies
16
Views
1K
  • Programming and Computer Science
Replies
1
Views
3K
  • Mechanics
Replies
1
Views
2K
  • Advanced Physics Homework Help
Replies
10
Views
6K
Replies
14
Views
927
Replies
9
Views
891
Back
Top