MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: preserving order of eigenvalues in a matrix diagonalization

  • To: mathgroup at
  • Subject: [mg61849] Re: [mg61824] Re: [mg61819] preserving order of eigenvalues in a matrix diagonalization
  • From: Pratik Desai <pdesai1 at>
  • Date: Tue, 1 Nov 2005 00:39:57 -0500 (EST)
  • References: <> <>
  • Sender: owner-wri-mathgroup at

Kristjan Kannike wrote:

>On Mon, 31 Oct 2005 grub_snuffler at wrote:
>>I'm trying to diagonalize a matrix in Mathematica, but I need the eigenvalues
>>to stay in order.  So, for instance, for the initial matrix m,
>First, how do you specify the order of the eigenvalues, if your matrix is
>not diagonal to begin with?
You don't, but since the eigenvalues are an ordered set of values, they 
can always be sorted. The fun actually begins when you have match the 
eigenvectors in the unitary matrix to match the eigenvalues. plus if you 
have complex eigenvalues, it becomes even more hilarious. :-)

>I had the same problem: I un-diagonalized a diagonal matrix with a unitary
>matrix in the beginning, used it in the initial conditions to a system of
>ODEs, and later had to recover the _changed_ eigenvalues AND eigenvectors
>in the same order as put in. (As the eigenvalues were continuous functions
>of the variable t, their order made sense.)
>I did not find an easy way.
>So I:
>1) got symbolic expressions for eigenvalues by evaluationg the native
>Eigenvalues function for a general matrix of appropriate dimension, e.g.
>{{m11,m12},{m21,m22}} in your case);
>2) re-ordered the said expressions by evaluating them numerically on the
>initial matrix and comparing them to the initial eigenvalues (in correct
>order by def.);
>3) and made the expressions into a function.
>It is not pretty, but it does work.
>The eigenvectors I reordered after eigenvalues, of course.
>Kristjan Kannike

Pratik Desai
Graduate Student
Department of Mechanical Engineering
Phone: 410 455 8134

  • Prev by Date: Re: SymbolName question
  • Next by Date: Re: problem with making boxes
  • Previous by thread: Re: SymbolName question
  • Next by thread: Re: Exporting notebooks to xml (cnxml)