List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] eigenvect for real nonsymmetric matrix
| [MUG] eigenvect for real nonsymmetric matrix |
|
Author:
Posted: Thu, 09 May 2002 02:47:51 -0400
|
>> From: "jdwright"
To whom it may concern,
Does Maple's linalg[eigenvects] routine handle real non-symmetric matrices? I
need eigenvalues and eigenvectors for a real non-symmetric matrix. It seems to
me that in my case, Maple's linalg[eigenvects] does a good job to within my
required accuracy. What method does linalg[eigenvects] use for real non-
symmetric matrices?
I would also like to find an equally good routine for finding the eigenvalues
(eigenvectors maybe too) using the C programming language on a UNIX platform.
If anyone out there has any suggestions I would appreciate hearing from you.
Thanks,
David Wright
Graduate Student
Physics Department
Wesleyan University
"jdwright"
|
| [MUG] Re: eigenvect for real nonsymmetric matrix |
|
Author: Maple User Group
Posted: Wed, 15 May 2002 11:27:21 -0400
|
>> From: Maple User Group "maple_gr"
>> From: "jdwright"
| Does Maple's linalg[eigenvects] routine handle real non-symmetric
| matrices? ...
| What method does linalg[eigenvects] use for real non- symmetric
| matrices?
| I would also like to find an equally good routine for finding the
| eigenvalues (eigenvectors maybe too) using the C programming language
| on a UNIX platform.
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Mon, 13 May 2002 16:26:41 +0200
To: "maple-list"
From: Juan Manuel de Olazabal "olazabaj"
Subject: eigenvect for real nonsymmetric matrix
I suggest you
http://www.matesco.unican.es/%7Eolazabal/software/maples/algelin/english/
and
http://www.matesco.unican.es/%7Eolazabal/software/maples/algelin/engli
sh/similarity/autov/autov.html
If you like it, I could send you more information about it.
Yours sincerely,
J.M. de olazabal
Manolo
Departamento de Matematicas, E. y Computacion
Facultad de Ciencias
Universidad de Cantabria
Avda. Los Castros s/n
39005 Santander Cantabria Spain
Tfno. 942 201426
e-mail: "olazabaj"
URL: http://www.matesco.unican.es/~olazabal
http://gesacapc22.gestion.unican.es:8000/public/4304_2/index.html
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Tue, 14 May 2002 11:52:54 -0400 (EDT)
From: David Linder "dlinder"
To: "maple-list"
Subject: eigenvect for real nonsymmetric matrix
David Wright () asked about the
algorithm used by linalg[eigenvects]. Since he mentioned
accuracy, I am supposing that he is dealing with
floating-point matrices.
For a real nonsymmetric floating point matrices the
linalg[eigenvects] routine obtains its result from
`evalf/EigensR`. For details, see,
B.N. Parlett and C.Reinsch, "Balancing a Matrix for
Calculation of Eigenvalues and Eigenvectors",
Numer. Math. 13, 1969, 293-304.
Maple's more recent LinearAlgebra[Eigenvectors] routine will
make use of a compiled routine via Maple's external calling
mechanism. For example, in Maple 7,
> infolevel[LinearAlgebra]:=1:
> M:=LinearAlgebra[RandomMatrix](3,outputoptions=[datatype=float]):
> LinearAlgebra[Eigenvectors](M):
Eigenvectors: "calling external function"
Eigenvectors: "NAG" hw_f02ebf
In the above example, the "hw_" prefix denotes a computation
performed at hardware double precision. If Digits is set
higher than evalhf(Digits) then the same algorithm would be
used in software float mode, at the higher precision.
The LinearAlgebra[Eigenvectors] routine, available in Maple 6
and higher, is recommended over the older linalg[eigenvects]
routine for floating-point problems.
A generally well-regarded set of routines for such computations
are in the LAPACK suite available at,
http://www.netlib.org/
One can also find a Fortran-to-C (f2c) translated version
of this package, under the name CLAPACK. The CLAPACK package
can be linked with either a generic BLAS (Basic Linear Algebra
Subprograms), or a tuned set of BLAS such as ATLAS, either of
which can also be obtained from the same site. For more
details, see,
http://www.netlib.org/lapack/double/dgeevx.f
http://www.netlib.org/lapack/double/dgeev.f
The CLAPACK library can be accessed directly from Maple 7,
using the external calling mechanism. Here is a brief
example, using the dgeev function to obtain the eigenvalues
and eigenvectors. Refer to CLAPACK's own documentation
for calling sequence details. Notice that, unlike function
dgeevx, the function dgeev does not allow for optional
control of scaling and balancing.
NB. Adequate workspace must be supplied. The dimensions
of the arrays WORK, VR, etc, below must be adequate
according to the minimal values specified in the
CLAPACK documentation.
|\^/| Maple 7 (IBM INTEL LINUX)
._|\| |/|_. Copyright (c) 2001 by Waterloo Maple Inc.
\ MAPLE / All rights reserved. Maple is a registered trademark of
<____ ____> Waterloo Maple Inc.
| Type ? for help.
>
> A := Matrix(2,2,[[1,1],[2,3]],datatype=float[8]);
[1. 1.]
A := [ ]
[2. 3.]
>
> copyA := copy(A): # CLAPACK overwrites A.
>
> extDGEEV := define_external(`dgeev_`,
> jobvl::REF(char[1]),
> jobvr::REF(char[1]),
> n::REF(integer[4]),
> a::ARRAY(1..i,1..j,float[8]),
> lda::REF(integer[4]),
> wr::ARRAY(1..i,1..j,float[8]),
> wi::ARRAY(1..i,1..j,float[8]),
> vl::ARRAY(1..i,1..j,float[8]),
> ldvl::REF(integer[4]),
> vr::ARRAY(1..i,1..j,float[8]),
> ldvr::REF(integer[4]),
> work::ARRAY(1..i,1..j,float[8]),
> lwork::REF(integer[4]),
> info::REF(integer[4]),
> LIB="libclapack.so"):
>
> JOBVL:="N":
> JOBVR:="V":
> LDA:=LinearAlgebra:-RowDimension(copyA):
> N:=LinearAlgebra:-ColumnDimension(copyA):
> WR:=Vector(LDA,datatype=float[8]):
> WI:=Vector(LDA,datatype=float[8]):
> LDVL:=1:
> VL:=Matrix(LDVL,N,datatype=float[8]):
> LDVR:=N:
> VR:=Matrix(LDVR,N,datatype=float[8]):
> LWORK:=`if`( (JOBVR="V" or JOBVL="V"), max(1,4*N), max(1,3*N) ):
> WORK:=Vector(LWORK,datatype=float[8]):
> INFO:=0:
>
> extDGEEV(JOBVL,JOBVR,N,copyA,LDA,WR,WI,VL,LDVL,VR,LDVR,WORK,LWORK,INFO);
>
> INFO; # Zero if successful. See CLAPACK dgeev.f comments.
0
>
# See CLAPACK dgeev.f comments for details of output format,
# especially with respect to complex conjugate eigenvalues.
> WR;
[0.267949192431122807]
[ ]
[3.73205080756887720 ]
> WI;
[0.]
[ ]
[0.]
> VR;
[-0.806898221355073497 -0.343723769333440288]
[ ]
[0.590690494568872237 -0.939070801588044124]
>
> Digits := 15;
Digits := 15
> LinearAlgebra[Eigenvectors](A);
[3.73205080756887720 + 0. I ]
[ ],
[0.267949192431122807 + 0. I]
[0.343723769333440010 + 0. I 0.806898221355073053 + 0. I ]
[ ]
[0.939070801588044012 + 0. I -0.590690494568872015 + 0. I]
- Dave Linder
"dlinder"
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Tue, 14 May 2002 19:56:45 +0300
From: Florin Sabau "fsabau"
To: "maple-list"
Subject: eigenvect for real nonsymmetric matrix
Hello, I'm quite new to this list (and to Maple also) so, apologies
from the start if I may be "off topic".
1. Don't know how Maple really computes eigenvals, but (theoretically)
it should be the same as following:
2. If you have a matrix A (of an linear operator for instance), then
the eigenvalues of the matrix A are the roots of the characteristic
polynom (in lambda):
det(A-lambda*I)=0
By "real non-symmetric matrix" do you mean a non-symmetric matrix with
real elements? If so there should be no problem in finding eigenvalues
with the charactertic polynom (only the equation in lambda has real
coefficients).
| 1 2 -1|
for instance: A=| 2 1 1|
|-1 -1 1|
-- det(A-lambda*I)=-lambda^3+3*lambda^2+lambda-3=0
-- lambda(1,2,3)=-1, 1, 3
If you're interested, I could wrap up a few routines in C to get
eigenvalues.
PS: I may be wrong about this. (first semester, when I was studying
Linear Algebra at school, is so far away in the past!)
--
Best regards,
Florin "mailto:fsabau"
|
Previous by date: [MUG] How to do matrix parallel computation,
Next by date: [MUG] Galois Fields, David Rees
Previous thread: [MUG] Polar Plotting, Roush, Craig Ryan UMKC-Student
Next thread: [MUG] Galois Fields, David Rees
|