[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #49291] residue function gives incompatible re

From: Rik
Subject: [Octave-bug-tracker] [bug #49291] residue function gives incompatible result
Date: Fri, 7 Oct 2016 19:26:00 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Follow-up Comment #3, bug #49291 (project octave):

More thoughts, since residue is invertible it should be able to apply residue
twice and arrive back at the original inputs.  This works for more ordinary
inputs, but not for the special case presented here.  I made a script,
tst_res.m, which is attached.

rf = [1e3 2e3 1e3 2e3];
cf = [316.2e-9 50e-9 31.6e-9 5e-9];
r = 1./cf
p = -1./(rf.*cf)
k = 0
[b, a] = residue (r, p, k);
[r2, p2, k2] = residue (b, a)

When running it in Octave I get,

r =

   3.1626e+06   2.0000e+07   3.1646e+07   2.0000e+08

p =

  -3.1626e+03  -1.0000e+04  -3.1646e+04  -1.0000e+05

k = 0
r2 =


p2 =


k2 =  1759.6

As you can see, r2 and p2 don't even have the correct number of elements, and
k2 is wildly off from 0.

(file #38683)

Additional Item Attachment:

File name: tst_res.m                      Size:0 KB


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]