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

 
 

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

Submitted by:  None
Submitted on:  Tue 06 Jan 2015 10:54:11 PM UTC  
 
Category:  Octave Forge Package Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Scott Jobling Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  other
Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project Administrator
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>
Project Administrator
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 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)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    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.5