bugGNU Octave - Bugs: bug #43947, [octave forge] (control) tf num...

 
 

bug #43947: [octave forge] (control) tf num and den vectors should have same length

Submitter:  None
Submitted:  Tue 06 Jan 2015 10:54:11 PM UTC
   
 
Category:  Octave Package Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  In Progress Assigned to:  None
Originator Name:  Scott Jobling Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * other
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 16 Jan 2022 12:59:22 PM UTC, comment #5: 

I have re-opened this bug report and backed out the changeset
 mentioned in comment #4. Several regressions with the package-internal use of tfdata showed up while preparing the upcoming release 3.4.0 of the control package.

This issue will be addressed again after the release of control 3.4.0.

Torsten Lilge <ttl>
Group Member
Sun 27 Jun 2021 08:23:13 PM UTC, comment #4: 

This is implemented with changeset https://sourceforge.net/p/octave/control/ci/61509077e8ea4a14c153519b65514815d0af7fa2/
and will be included in the next release of the control package.

Torsten Lilge <ttl>
Group Member
Tue 17 May 2016 05:40:14 PM UTC, comment #3: 

The output of

s = tf('s')
x = (2*s^2 + 1*s^1 + 0) / (3*s^3 + 2*s^2 + 1*s^1 + 0)
x.num
x.den
x.num{1}
x.den{1}

is

s =
 
  s
 
Continuous-time transfer function.


x =
 
      2 s^2 + s
  -----------------
  3 s^3 + 2 s^2 + s
 
Continuous-time transfer function.


ans =

    [1x4 double]


ans =

    [1x4 double]


ans =

     0     2     1     0


ans =

     3     2     1     0

Alexander Wilms <alexanderw>
Tue 17 May 2016 05:13:22 PM UTC, comment #2: 

Moving information from bug #46621 here. The num and den vectors should have the same length, also the returned vectors when calling the tfdata function.

Mike Miller <mtmiller>
Group Member
Thu 15 Jan 2015 02:52:09 AM UTC, comment #1: 

Thanks for your bug report. This should be easy for someone with access to Matlab's control toolbox to test and report back the results of the following:


s = tf('s');
x = (2*s^2 + 1*s^1 + 0) / (3*s^3 + 2*s^2 + 1*s^1 + 0);
x.num
x.den


Cc'ing the control package maintainer.

Mike Miller <mtmiller>
Group Member
Tue 06 Jan 2015 10:54:11 PM UTC, original submission:  

I was running a script originally built for Matlab and ran into several out-of-bounds errors when making assumptions about how many modeling coefficients should be returned by the numerator/denominator calls. I believe this is an issue with the x.Num/Den properties only returning the minimum necessary coefficients from the control model parameters. The person that wrote this for Matlab did so in the last two years, so I'm assuming the issues is on the Octave end. So, via Octave's TF function:


% (2*s^2 + 1*s^1 + 0) / (3*s^3 + 2*s^2 + 1*s^1 + 0)
x.Num % 2 1 0
x.Den % 3 2 1 0


Padding the smaller of the x.Num / x.Den returned arrays with zeros for the missing coefficients fixed the problem for me.


num = x.Num;
num = padarray(num, [0 2], 'pre');
% num => 0 2 1 0 => same size as x.Den


Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Carbon-Copy List
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by alexanderw (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by mtmiller
  • -email is unavailable- added by None (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 16 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-16 ttl StatusFixed In Progress
        Open/ClosedClosed Open
    2021-06-27 ttl StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2017-08-13 jwe Summarycontrol package: tf num and den vectors should have same length [octave forge] (control) tf num and den vectors should have same length
    2016-05-17 mtmiller Severity3 - Normal 1 - Wish
        StatusNeed Info Confirmed
        Release3.8.2 other
        Summarycontrol package: tf returns different sized x.num and x.den if higher order coefficients missing control package: tf num and den vectors should have same length
    2016-05-17 mtmiller Dependencies- bugs #46621 is dependent
    2016-05-17 mtmiller Dependencies- Depends on bugs #46621
    2015-01-15 mtmiller Item GroupNone Matlab Compatibility
        StatusNone Need Info
        Operating SystemMicrosoft Windows Any
        SummaryTF function in Control returns different sized x.Num and x.Den if higher order coefficients missing control package: tf returns different sized x.num and x.den if higher order coefficients missing
        Carbon-Copy- Added paramaniac

    Back to the top

    Powered by Savane 3.14-8eb0.
    Corresponding source code