I am running qtoctave on windows XP octave version 2.9.15
residue doesn't give the correct answer for repeated complex roots
her is Matlab's result
» n
n =
1
» d
d =
1 8 42 104 169
» roots(d)
ans =
-2.0000+ 3.0000i
-2.0000- 3.0000i
-2.0000+ 3.0000i
-2.0000- 3.0000i
» [a b c]=residue(n,d)
a =
1.0e+005 *
1.2662+ 1.8232i
1.2662- 1.8232i
-1.2662- 1.8232i
-1.2662+ 1.8232i
b =
-2.0000+ 3.0000i
-2.0000- 3.0000i
-2.0000+ 3.0000i
-2.0000- 3.0000i
c =
[]
and qtoctave's results
n
n = 1
d
d =
1 8 42 104 169
roots(d)
ans =
-2.0000 + 3.0000i
-2.0000 - 3.0000i
-2.0000 + 3.0000i
-2.0000 - 3.0000i
[a b c]=residue(n,d)
a =
-9.3613e-018 - 9.2593e-003i
-2.7778e-002 - 5.3894e-010i
2.3130e-018 + 9.2593e-003i
-2.7778e-002 + 5.3894e-010i
b =
-2.0000 + 3.0000i
-2.0000 + 3.0000i
-2.0000 - 3.0000i
-2.0000 - 3.0000i
c = [](0x0)
I haven't looked into why this is happening yet.
Doug Stewart
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave