#1702 strange results from eigenvalues

closed
nobody
5
2009-07-22
2009-07-02
Anonymous
No

large matrices like matrix([72126.5,-25007.8,7670.53],[-25007.8,8670.74,-2659.53],[7670.53,-2659.53,818.809])
produce strange outputs:

(%i32) eigenvalues(T);
rat: replaced 25007.8 by 125039/5 = 25007.8
rat: replaced 2.0400004650900003E+7 by 20400005/1 = 2.0400005E+7
rat: replaced -25007.8 by -125039/5 = -25007.8
rat: replaced 818.809 by 72874/89 = 818.8089887640449
rat: replaced 7670.53 by 767053/100 = 7670.53
rat: replaced 6.6508994334000006E+7 by 66508994/1 = 6.6508994E+7
rat: replaced -7670.53 by -767053/100 = -7670.53
rat: replaced 8670.74 by 433537/50 = 8670.74
rat: replaced -7073099.8209 by -35365499/5 = -7073099.8
rat: replaced 818.809 by 72874/89 = 818.8089887640449
rat: replaced 8670.74 by 433537/50 = 8670.74
rat: replaced 72126.5 by 144253/2 = 72126.5
(%o32) [[(-(sqrt(3)*%i)/2-1/2)*((3*sqrt(12608488167242884134811801138679920231)*%i)/(3960500000*sqrt(2))+2838509476210882261900497/140993800000)^(1/3)+(58619247149883207*((sqrt(3)*%i)/2-1/2))/(79210000*((3*sqrt(12608488167242884134811801138679920231)*%i)/(3960500000*sqrt(2))+2838509476210882261900497/140993800000)^(1/3))+60531903/2225,((sqrt(3)*%i)/2-1/2)*((3*sqrt(12608488167242884134811801138679920231)*%i)/(3960500000*sqrt(2))+2838509476210882261900497/140993800000)^(1/3)+(58619247149883207*(-(sqrt(3)*%i)/2-1/2))/(79210000*((3*sqrt(12608488167242884134811801138679920231)*%i)/(3960500000*sqrt(2))+2838509476210882261900497/140993800000)^(1/3))+60531903/2225,((3*sqrt(12608488167242884134811801138679920231)*%i)/(3960500000*sqrt(2))+2838509476210882261900497/140993800000)^(1/3)+58619247149883207/(79210000*((3*sqrt(12608488167242884134811801138679920231)*%i)/(3960500000*sqrt(2))+2838509476210882261900497/140993800000)^(1/3))+60531903/2225],[1,1,1]]

ovtave gives followin:
octave.exe:3> t =
>[72126.5, -25007.8, 7670.53;
> -25007.8, 8670.74, -2659.53;
> 7670.53, -2659.53, 818.809];
octave.exe:4> eig(t)
ans =
8.2521e-004
3.0311e+000
8.1613e+004

Discussion

  • Raymond Toy

    Raymond Toy - 2009-07-02

    In what way is the result strange? Eigenvalues the floats to rationals and does a symbolic calculation. Hence the long answer. If you want a float result, you can use float and rectform to get

    [[6.912159733474255e-11 %i + 2.999728814902483,
    .03218669009947916 - 6.548361852765083e-11 %i,
    81613.01707325905 - 2.442490654175344e-15 %i], [1.0, 1.0, 1.0]]

    (These aren't quite the same as octave.)

    If you numeric results, you can try dgeev. This produces

    [81613.01707247499, 8.252057359223741e-4, 3.031102319243371]

    This is probably the same routine that octave uses to find eigenvalues.

     
  • Raymond Toy

    Raymond Toy - 2009-07-07

    Marking as pending/invalid so this will be closed automatically in two weeks.

    I don't think there's anything wrong here. If you disagree, please comment on this.

     
  • Raymond Toy

    Raymond Toy - 2009-07-07
    • status: open --> pending
     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks