help-octave
[Top][All Lists]

## Re: problem with residue and repeated complex roots

 From: Ben Abbott Subject: Re: problem with residue and repeated complex roots Date: Tue, 27 Nov 2007 19:49:21 -0500

```Doug,

```
This problem was addressed with a change that made it into 2.9.16. If you check the cvs you can replace your residue.m with the one there. You'll need mpoles.m as well.
```
I should also mention that another bug/feature was fixed just yesterday.

Ben

On Nov 27, 2007, at 5:11 PM, Doug Stewart wrote:

```
```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
```