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

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

[Octave-bug-tracker] [bug #53869] Residue returning an inaccurate result


From: anonymous
Subject: [Octave-bug-tracker] [bug #53869] Residue returning an inaccurate result
Date: Wed, 9 May 2018 11:09:22 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?53869>

                 Summary: Residue returning an inaccurate result
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Wed 09 May 2018 03:09:21 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Tony Richardson
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.4.0
        Operating System: Any

    _______________________________________________________

Details:

Octave and MATLAB return different results for the following script with
argument (n) values of 3 or larger:

function residue_bug(n)
    alpha = 100;
    fr = 436;
    N=poly(1i*2*pi*fr*[-n:-1 1:n]);
    D=poly(-alpha+1i*2*pi*fr*[-n:-1 1:n]);
    [R, P, K]=residue(N,D)
end

Octave displays a warning about a singular matrix and returns results that are
different than MATLAB. MATLAB does not display a warning until n is much
larger (around 30 or so).  I can normalize the problem so that Octave results
are valid for values of n up to about 10, but MATLAB results are then valid
for much larger values of n.

I thought that the MATLAB values might be incorrect (even though it does not
display a warning), but I computed my ultimate result using a method that does
not use residue and it is consistent with the result obtain using MATLAB's
residue function.

The basic issue appears to be that whatever method MATLAB uses to compute
residue results is much better behaved than the Octave method.





    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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