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

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

[Octave-bug-tracker] [bug #60384] Residue Function incorrect results


From: Luiz Antonio Maccari Junior
Subject: [Octave-bug-tracker] [bug #60384] Residue Function incorrect results
Date: Mon, 12 Apr 2021 13:15:14 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0

URL:
  <https://savannah.gnu.org/bugs/?60384>

                 Summary: Residue Function incorrect results
                 Project: GNU Octave
            Submitted by: luiz
            Submitted on: Mon 12 Apr 2021 05:15:12 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 6.1.0
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Function residue is presenting unexpected results. I have made two examples to
show the problem. 



% Residue test
%test 1

num1 = [1315.789473684211];
den1 =  [1   1.100000536842105e+04  1.703789473684211e+03   0];

poles1 = roots(den1)

[r1,p1,k1,e1]=residue(num1,den1)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% test 2
num2 = [1];
den2 =  [1   1   1   0];

poles2 = roots(den2)
[r2,p2,k2,e2]=residue(num2,den2)




Test 1 presents an wrong result. It was expected p1 equal a poles1 but I got

p1 =

  -7.744602880490632e-02
  -7.744602880490632e-02
  -1.099985047636344e+04

poles1 =

  -1.099985047636344e+04
  -1.548920576098126e-01
                       0

In test2 the correct result are occurring. p2 equals poles2.

p2 =

  -0.500000000000000 + 0.866025403784438i
  -0.500000000000000 - 0.866025403784438i
                   0 +                 0i

poles2 =

  -0.500000000000000 + 0.866025403784438i
  -0.500000000000000 - 0.866025403784438i
                   0 +                 0i

I cant find where is the problem. In matlab the code works well.






    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60384>

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




reply via email to

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