This is definitely a fun exercise, and I'm having fun playing with it
(mostly looking at intermediate results and a few variations on the
theme).

That said, what I was really looking for was documentation or
explorations on J's facilities (such as mt or lapack) for working with
eigenvalues (and eigenvectors - in principle if you have the one the
other is straightforward).

Here, though, you did not use mt, nor did you use lapack. You started
with a specific set of eigenvalues and demonstrated a context where
you could plug them in.

And I certainly appreciate the effort - and it does demonstrate some
of the identities involving their use - but of course I am looking for
more!

Thanks,

-- 
Raul


On Sat, Oct 5, 2013 at 6:54 AM, km <[email protected]> wrote:
> NB. Responding to a request from Raul in Jbeta
>
>
> NB. A cool use of eigen values and vectors -- recursion
>
>
> NB. Preliminaries
>
> clean =: * *@|  NB. numbers with 2^_44 > | are replaced by 0
>
> mp =: +/ . *  NB. matrix product
>
> NB. below, square matrix x to integer power y
>
> mpwr =: ( 4 : 'x mp^:y =i.#x' )"2 0
>
>
> NB. The recursion ( (1+k) { u ) -: A mp k { u where u is a matrix
>
> ]A  =: 1 1,.1 0 NB. used for Fibonnaci recursion
>
> ]lambda =: 2 %~ (1+%:5),1-%:5  NB. eigenvalues of A
>
> ]Lambda =: lambda * =i.# lambda  NB. eigenvalues on diagonal
>
> ]S =: 2 2 $ lambda,1 1  NB. columns are eigenvectors
>
> (A mp S) -: lambda *&.|: S  NB. test claimed eigen vectors, values
>
> ]u0 =: 1 0  NB. first row of matrix u
>
> ]nr =: 7  NB. number of rows in u
>
> ]u =: (A mpwr i. nr) mp"2 1 u0  NB. produce matrix u
>
> NB. Rows obey Fibonnaci recursion, observe second column
>
> (}. u) -: }: A mp&.|: u  NB. test "A" recursion in the rows of u
>
> NB. You can produce u using the eigen vectors and values of A:
>
> u -: ( S mp"2 (Lambda mpwr i. nr) mp"2 S mpwr _1 ) mp"2 1 u0
>
> NB. More simply:
>
> c =: (S mpwr _1) mp u0
>
> u -: S mp"2 1 c *"1 lambda^"1 0 i. nr
>
>
> NB. Above will work if n by n A has n linearly independent eigenvectors.
>
>
> --Kip Murray
>
> Sent from my iPad
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to