bugGNU Octave - Bugs: bug #45334, [octave forge] (control) incorrect...

 
 

bug #45334: [octave forge] (control) incorrect results on repeated MIMO tf multiplies

Submitter:  Nicholas Jankowski <nrjank>
Submitted:  Tue 16 Jun 2015 09:26:08 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Inaccurate Result
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 17 Feb 2020 03:11:01 AM UTC, comment #6: 

this appears to still be present in control 3.2.0 on Octave 5.2.0  (although the a5 output coefficients have changed values the rest is more or less the same)

Nicholas Jankowski <nrjank>
Group Member
Tue 26 Feb 2019 10:02:01 PM UTC, comment #5: 

I think this is still present with control 3.1.0.

Mike Miller <mtmiller>
Group Member
Thu 18 Jun 2015 06:21:08 AM UTC, comment #4: 

I had a quick look at the problem and noticed the following:

- the transfer function matrix from Maxima is the transpose of the one from Matlab/Octave. (you can use a1.' in Octave, note the dot)

- the tolerance on line 120 of the file @tf/__sys2ss__.m has a huge impact on the results.

Lukas Reichlin <paramaniac>
Wed 17 Jun 2015 09:55:50 AM UTC, comment #3: 

Adding package maintainer to cc list

Carnë Draug <carandraug>
Group Member
Wed 17 Jun 2015 02:11:42 AM UTC, comment #2: 

confirmed this behavior also exists in control-2.8.2. The output is almost identical, except for the 'minreal' case, where many of the polynomial constants go to inf instead of zero on the 5th multiply.

Nicholas Jankowski <nrjank>
Group Member
Tue 16 Jun 2015 09:27:13 PM UTC, comment #1: 

forgot the Maxima output.  attached.


Nicholas Jankowski <nrjank>
Group Member
Tue 16 Jun 2015 09:26:08 PM UTC, original submission:  

using control-2.8.1. performing a multiple MIMO tf multiplication produces erroneous output. (haven't checked this under 2.8.2, as that version produces a different error)

using a simple 2x2 tf, the following commands reproduce the problem:


>> a1=tf({[1],[2];[3],[4]},{[1 3],[1 4];[2 3],[1 1]});
>> a2=a1*a1
>> a3=a1*a2
>> a4=a1*a3
>> a5=a1*a4


a2 calculates as expected, and a minreal(a2) produces the expected minimized form. the a3 and a4 results get huge, and then the a5 result drops and zeros out almost all of the numerator coefficients.  using minreal between multiplies for a3, a4 and a5 make little difference.

As the output gets messy, I attached a text file of the Octave output with and without minreal.

Note that the order of multiplication (whether it's a1* or *a1) in the definition of a2-a5 seems to matter on whether the coefficients match the expected analytical result, but it produces zeros on a5.

Checking Matlab output for the same (ML 2015a) produces sensible results, although as expected they don't minimize as nicely as Maxima. A minreal between multiply steps gets it fairly close through a4.

I attached a png of a maxima output showing what the minimized output of those should be. granted I expect Maxima to be better at handling the higher order polynomials.

Nicholas Jankowski <nrjank>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #34241:  maximaoutput.png added by nrjank (105KiB - image/png)
file #34239:  MLoutput.txt added by nrjank (29KiB - text/plain - outputs from Octave (txt), Maxima (png) and Matlab (txt files))
file #34240:  Octave_output_withminreal.txt added by nrjank (21KiB - text/plain - outputs from Octave (txt), Maxima (png) and Matlab (txt files))
file #34237:  Octave_output.txt added by nrjank (32KiB - text/plain - outputs from Octave (txt), Maxima (png) and Matlab (txt files))
file #34238:  MLoutput-withminreal.txt added by nrjank (17KiB - text/plain - outputs from Octave (txt), Maxima (png) and Matlab (txt files))

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by paramaniac (Posted a comment)
  • -email is unavailable- added by carandraug (Lukas Reichlin - maintainer of the control package)
  • -email is unavailable- added by nrjank (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-26 mtmiller Item GroupIncorrect Result Inaccurate Result
        StatusNone Confirmed
        Release4.0.0 dev
        Operating SystemMicrosoft Windows Any
        Summary[octave forge] (control) version 2.8.1 - incorrect results on repeated MIMO tf multiplies [octave forge] (control) incorrect results on repeated MIMO tf multiplies
    2017-08-13 jwe Summarycontrol package 2.8.1 - incorrect results on repeated MIMO tf multiplies [octave forge] (control) version 2.8.1 - incorrect results on repeated MIMO tf multiplies
    2015-06-17 carandraug Carbon-Copy- Added -email is unavailable-
    2015-06-16 nrjank Attached File- Added maximaoutput.png, #34241
    2015-06-16 nrjank Attached File- Added Octave_output.txt, #34237
        Attached File- Added MLoutput-withminreal.txt, #34238
        Attached File- Added MLoutput.txt, #34239
        Attached File- Added Octave_output_withminreal.txt, #34240

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code