octave-bug-tracker
[Top][All Lists]
Advanced

[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,


tst_res
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 =

   3.1703e+06
   2.3710e+07
   2.1554e+07

p2 =

  -3.1573e+03
  -1.1024e+04
  -1.9857e+04

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:

  <http://savannah.gnu.org/bugs/?49291>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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