List Info

Thread: Trouble with Octave




Trouble with Octave
country flaguser name
United States
2007-09-22 19:34:41
I have both PPC and Intel installations of Octave. They both
give the wrong
answer to this short script. 

num = [1 0 1]; 
den = [1 0 18 0 81]; 
[a,p,k,e] = residue(num,den) 

I did the math ... 

(x^2+1)/(x^4+18*x^2+81) = (2/9)/(x-3i) + (2/9)/(x+3i) +
(1/54i)/(x-3i)^2 -
(1/54i)/(x+3i)^2 

Thus, 

a = [1/54i 2/9 -1/54i 2/9] 
p = [3i 3i -3i -3i] 
k = [] 
e = [2 1 2 1] 

However, my Intel version gives 

a = 

  -3.0108e+06 - 1.9734e+06i 
  -3.0108e+06 + 1.9734e+06i 
  3.0108e+06 + 1.9734e+06i 
  3.0108e+06 - 1.9734e+06i 

p = 

  -0.0000 + 3.0000i 
  -0.0000 - 3.0000i 
   0.0000 + 3.0000i 
   0.0000 - 3.0000i 

k = [](0x0) 
e = 

   1 
   1 
   1 
   1 

and my PPC version gives 

a = 

  8.4492e+06 - 3.9658e+06i 
  8.4492e+06 + 3.9658e+06i 
  -8.4492e+06 + 3.9658e+06i 
  -8.4492e+06 - 3.9658e+06i 

p = 

   0.0000 + 3.0000i 
   0.0000 - 3.0000i 
  -0.0000 + 3.0000i 
  -0.0000 - 3.0000i 

k = [](0x0) 
e = 

   1 
   1 
   1 
   1 

For reference, Matlab gives 

a = 

        0 - 0.0926i 
   0.2222 - 0.0000i 
        0 + 0.0926i 
   0.2222 + 0.0000i 


p = 

   0.0000 + 3.0000i 
   0.0000 + 3.0000i 
   0.0000 - 3.0000i 
   0.0000 - 3.0000i 

k = 

     [] 

A non-Fink installation for 2.9.14 produces the correct
answer as well, see
the link below. 

http://www.nabble.com/bug-in-residue.m-tf4475396.html 

Can any confirm they get the same result? 

p.s. I tried posting to the users list, but forgot to
subscribe before doing
that. I'll try to delete that post from Nabble momentarily.
-- 
View this message in context: http://www.nabble.com/Trouble-with-Octave-tf45
02632.html#a12841449
Sent from the fink-beginners mailing list archive at
Nabble.com.


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Fink-beginners mailing list
Fink-beginnerslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-beg
inners

Re: Trouble with Octave
country flaguser name
United States
2007-09-22 21:11:29
Ben Abbott wrote:
> I have both PPC and Intel installations of Octave. They
both give the wrong
> answer to this short script. 
>
> num = [1 0 1]; 
> den = [1 0 18 0 81]; 
> [a,p,k,e] = residue(num,den) 
>
> I did the math ... 
>
> (x^2+1)/(x^4+18*x^2+81) = (2/9)/(x-3i) + (2/9)/(x+3i) +
(1/54i)/(x-3i)^2 -
> (1/54i)/(x+3i)^2 
>
> Thus, 
>
> a = [1/54i 2/9 -1/54i 2/9] 
> p = [3i 3i -3i -3i] 
> k = [] 
> e = [2 1 2 1] 
>
> However, my Intel version gives 
>
> a = 
>
>   -3.0108e+06 - 1.9734e+06i 
>   -3.0108e+06 + 1.9734e+06i 
>   3.0108e+06 + 1.9734e+06i 
>   3.0108e+06 - 1.9734e+06i 
>
> p = 
>
>   -0.0000 + 3.0000i 
>   -0.0000 - 3.0000i 
>    0.0000 + 3.0000i 
>    0.0000 - 3.0000i 
>
> k = [](0x0) 
> e = 
>
>    1 
>    1 
>    1 
>    1 
>
> and my PPC version gives 
>
> a = 
>
>   8.4492e+06 - 3.9658e+06i 
>   8.4492e+06 + 3.9658e+06i 
>   -8.4492e+06 + 3.9658e+06i 
>   -8.4492e+06 - 3.9658e+06i 
>
> p = 
>
>    0.0000 + 3.0000i 
>    0.0000 - 3.0000i 
>   -0.0000 + 3.0000i 
>   -0.0000 - 3.0000i 
>
> k = [](0x0) 
> e = 
>
>    1 
>    1 
>    1 
>    1 
>
> For reference, Matlab gives 
>
> a = 
>
>         0 - 0.0926i 
>    0.2222 - 0.0000i 
>         0 + 0.0926i 
>    0.2222 + 0.0000i 
>
>
> p = 
>
>    0.0000 + 3.0000i 
>    0.0000 + 3.0000i 
>    0.0000 - 3.0000i 
>    0.0000 - 3.0000i 
>
> k = 
>
>      [] 
>
> A non-Fink installation for 2.9.14 produces the correct
answer as well, see
> the link below. 
>
> http://www.nabble.com/bug-in-residue.m-tf4475396.html 
>
> Can any confirm they get the same result? 
>
> p.s. I tried posting to the users list, but forgot to
subscribe before doing
> that. I'll try to delete that post from Nabble
momentarily.
>   
I get the same thing as your PowerPC results on my own G4,
for both a 
Fink and non-Fink installation of Octave 2.9.13 (from
octave.sf.net) ; 
so that inclines me to think it's an upstream issue, and
potentially 
solveable by updating the package to 2.9.14. (Maintainer
cced)

For that matter, using 2.9.9 on Linux (Intel) I get:

a =

  7.4540e+03 - 9.9176e+06i
  7.4540e+03 + 9.9176e+06i
  -7.4540e+03 + 9.9176e+06i
  -7.4540e+03 - 9.9176e+06i

p =

   0.0000 + 3.0000i
   0.0000 - 3.0000i
  -0.0000 + 3.0000i
  -0.0000 - 3.0000i


And with 2.9.13 on another Linux box:

a =

  7.4540e+03 - 9.9176e+06i
  7.4540e+03 + 9.9176e+06i
  -7.4540e+03 + 9.9176e+06i
  -7.4540e+03 - 9.9176e+06i

p =

   0.0000 + 3.0000i
   0.0000 - 3.0000i
  -0.0000 + 3.0000i
  -0.0000 - 3.0000i


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Fink-beginners mailing list
Fink-beginnerslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-beg
inners

Re: Trouble with Octave
country flaguser name
United States
2007-09-22 22:21:08

Alexander K. Hansen-2 wrote:
> 
> I get the same thing as your PowerPC results on my own
G4, for both a 
> Fink and non-Fink installation of Octave 2.9.13 (from
octave.sf.net) ; 
> so that inclines me to think it's an upstream issue,
and potentially 
> solveable by updating the package to 2.9.14.
(Maintainer cced)
> 

Thanks for the thorough work!



-- 
View this message in context: http://www.nabble.com/Trouble-with-Octave-tf45
02632.html#a12842513
Sent from the fink-beginners mailing list archive at
Nabble.com.


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Fink-beginners mailing list
Fink-beginnerslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-beg
inners

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )