PDL::Slatec Problem of eigenvalue of Matrix

Discussion in 'Perl' started by Junmou Zhang, Jul 10, 2003.

  1. Junmou Zhang

    Junmou Zhang Guest

    I have installed the PDL module and use it to calculate eigenvalue of
    a
    matrix. The PDL do gives me some eigenvalue and eigenvector. But the
    problem is that these values are different from the eigenvalue and
    eigenvector calculated in Matlab.

    A simple example is:

    use PDL::LiteF;
    my $mat = pdl [ 3.4603 , 1.7529 , 1.6990 , 2.1181],
    [ 2.5459 , 2.5615 , 2.2525 , 2.3606],
    [ 2.3606 , 2.2515 , 2.5628 , 2.5459],
    [ 2.1181 , 1.6982 , 1.7537 , 3.4603];
    ($eigvals,$eigvecs) = eigsys($mat);
    print $eigvecs,$eigvals,"\n";


    The results are:

    For PDL module is:
    [
    [0.0541307 -0.554549 0.789897 -0.256142]
    [0.0412208 0.635852 0.202431 -0.743649]
    [ 0.87661 -0.252953 -0.320313 -0.254888]
    [-0.476366 -0.473479 -0.482167 -0.562502]
    ] and eigenvalue
    [0.272291 0.63145 1.7178 9.42336]


    But for matlab, the results are

    -0.4788 -0.6962 0.4294 -0.0371
    -0.5203 -0.1238 -0.5616 0.7063
    -0.5203 0.1239 -0.5619 -0.7059
    -0.4788 0.6961 0.4295 0.0370
    and the eigenvalue is


    9.3294 0 0 0
    0 1.3519 0 0
    0 0 1.0631 0
    0 0 0 0.3004


    As you can see, the results from PDL is greatly different from Matlab.
    So is my installation not correct? or something wrong with my perl
    script?

    Could somebody who has the PDL installed try this simple example, and
    tell me
    what is you eigenvalue and eigenvector?

    Thanks
     
    Junmou Zhang, Jul 10, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lvcargnini

    Matrix composed by two matrix

    lvcargnini, Jul 4, 2006, in forum: VHDL
    Replies:
    3
    Views:
    2,703
    Jonathan Bromley
    Jul 5, 2006
  2. drife
    Replies:
    9
    Views:
    447
    Robert Kern
    Jan 29, 2005
  3. Holgerson

    Matrix*Vector and Vector*Matrix

    Holgerson, Oct 25, 2007, in forum: C++
    Replies:
    3
    Views:
    429
    Holgerson
    Oct 26, 2007
  4. Terry Reedy
    Replies:
    0
    Views:
    573
    Terry Reedy
    Apr 2, 2009
  5. Keflavich
    Replies:
    0
    Views:
    137
    Keflavich
    Feb 15, 2007
Loading...

Share This Page