Article View: sci.math.num-analysis
Article #1220Re: Very simple eigenvector/eigenvalue calculation
From: jonmach
Date: Wed, 07 Nov 2001 14:30
Date: Wed, 07 Nov 2001 14:30
73 lines
3648 bytes
3648 bytes
Alan,
Many many thanks for this.
I got to the point where I worked out that I could calculate the
polynomial, and can calculate the roots for this. I just didn't know
how to get the eigenvectors from this.
e.g. [ 2 1 ]
[ 3 4 ]
gives the polynomial x^2 - 6x + 5 = 0
giving roots (x - 1) (x - 5)
As you state,
> The eigenvectors can then be written as (b, x-a) or (x-d, c).
Your solution provides me with 4 potential eigenvectors.
(1, 1-2) = (1, -1) IS an eigenvector for the eigenvalue 1.
(1, 5-2) = (1, -3) IS NOT an eigenvector for the eigenvalue 5.
(1-4, 3) = (-3, 3) IS NOT an eigenvector for the eigenvalue 1.
(5-4, 3) = (1, 3) IS an eigenvector for the eigenvalue 5.
However, it is a simple matter to work out which 2 work, and discard
the others.
Problem solved. Thanks again
Jon
"Alan Miller" <amiller@bigpond.net.au> wrote in message news:<iB8G7.310759$bY5.1235789@news-server.bigpond.net.au>...
> jonmach wrote in message ...
> >Hi All,
> >
> >I've trawled the net and have found some very comprehensive libraries
> >and source for calculating the eigenvalues/eigenvectors of an nxn
> >matrix. However, this is very much overkill for what I need.
> >
> >I have a single 2X2 matrix holding real values and simply need to
> >calculate the 2 eigenvalues and corresponding eigenvectors. Is there
> >a very simple algorithm for this that already exists in
> >C/Fortran/Java/C++?
> >
> >Many many thanks in advance for any assistance on this.
> >
> >Jon
>
> The matrix:-
> ( a b )
> ( c d )
> has eigenvalues obtained by solving (a-x)(d-x) - bc = 0 for x.
> This is simply a quadratic equation, and the solutions are:
> 2x = -(a+d) +/- sqrt[ (a-d)^2 + 4bc ]
> The roots can of course be complex, if b & c have opposite signs
> and are moderately large compared with the diagonal elements a & d.
> The eigenvectors can then be written as (b, x-a) or (x-d, c).
>
> Complex operations and variables are intrinsic in Fortran, so that
> may be the easiest language to use.
>
> Now I have done your homework for you, you may like to look up
> the numerical solution of quadratic equations to minimize cancellation
> errors. If (a-d)^2 is approximately equal to -4bc, the cancellation errors
> could be very large, if you use the simple formula above.
Technical Details
Message-ID:
<c31cdc29.0111070630.64bed4ba@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailReferences:
<c31cdc29.0111070230.16042ed1@posting.google.com> <iB8G7.310759$bY5.1235789@news-server.bigpond.net.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11516a,e88e7b69d54b66a5 X-Google-Attributes: gid11516a,public X-Google-Thread: 1014db,e88e7b69d54b66a5 X-Google-Attributes: gid1014db,public X-Google-Thread: 10d67e,e88e7b69d54b66a5 X-Google-Attributes: gid10d67e,public X-Google-Thread: 107079,e88e7b69d54b66a5 X-Google-Attributes: gid107079,public X-Google-Thread: 109d8a,e88e7b69d54b66a5 X-Google-Attributes: gid109d8a,public X-Google-ArrivalTime: 2001-11-07 06:30:31 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: jonmach@informix.com (jonmach) Newsgroups: sci.math.num-analysis,sci.math,comp.lang.c,aus.mathematics,alt.math.undergrad Subject: Re: Very simple eigenvector/eigenvalue calculation Date: 7 Nov 2001 06:30:30 -0800 Organization: http://groups.google.com/ Lines: 73 Message-ID: <c31cdc29.0111070630.64bed4ba@posting.google.com> References: <c31cdc29.0111070230.16042ed1@posting.google.com> <iB8G7.310759$bY5.1235789@news-server.bigpond.net.au> NNTP-Posting-Host: 194.128.13.241 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1005143431 5943 127.0.0.1 (7 Nov 2001 14:30:31 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 7 Nov 2001 14:30:31 GMT