bugGNU Octave - Bugs: bug #43586, control package: tf function...

 
 

bug #43586: control package: tf function accepts any string as the variable name

Submitted by:  Arnaud Miege <am304>
Submitted on:  Wed 12 Nov 2014 10:57:13 AM UTC  
 
Category: Octave Forge PackageSeverity: 2 - Minor
Priority: 3 - LowItem Group: Documentation
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: otherOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Sun 18 Oct 2015 04:57:51 PM UTC, comment #6:

In recent development version, I restricted the transfer function variable to 's', 'p' for continuous-time and 'z', 'q', 'z^-1', 'q^-1' for discrete-time models.

Until I release an official version, you can download a snapshot from here:

http://sourceforge.net/p/octave/control/ci/default/tree/

Accordingly, this bug report can be closed.

Lukas Reichlin <paramaniac>
Fri 19 Jun 2015 01:57:15 PM UTC, comment #5:

So it looks like Matlab strictly validates the string given to the tf function and it probably has to exactly match one of the allowed "variable" strings 's', 'z', 'p', 'q', 'z^-1', or 'q^-1'.

Since any other string is disallowed by Matlab, there's no harm in accepting other strings in the control package for compatibility.

It's up the control package maintainer whether more strict checks should be added for the variable name string, or whether it's documented clearly enough as is.

Mike Miller <mtmiller>
Project Administrator
Tue 16 Jun 2015 08:05:04 PM UTC, comment #4:

Output from Matlab 2015a:

>> s = tf('s')


s =

s

Continuous-time transfer function.

>> s=tf('string')

Error using tf (line 241)
Invalid syntax. The first input argument of
the "tf" command cannot be a string.

>> s=tf('1/(s+1)')

Error using tf (line 241)
Invalid syntax. The first input argument of
the "tf" command cannot be a string.

>> s=tf('a')

Error using tf (line 241)
Invalid syntax. The first input argument of
the "tf" command cannot be a string.

Nicholas Jankowski <nrjank>
Thu 15 Jan 2015 02:34:21 AM UTC, comment #3:

I think it would be useful to get someone to show what Matlab does with

According to http://www.mathworks.com/help/control/ref/tf.html, the tf object Variable property is allowed to be one of the strings 's', 'z', 'p', 'q', 'z^-1', or 'q^-1', but it doesn't say what Matlab does if you try to use a different string.

Mike Miller <mtmiller>
Project Administrator
Fri 02 Jan 2015 11:17:57 PM UTC, comment #2:

Can we close this report as invalid?

Andreas Weber <andy1978>
Project Member
Sat 22 Nov 2014 11:45:07 AM UTC, comment #1:

The tf function accepts any string as transfer function variable, even '1/(s+1)':

This can be useful, but also very misleading. As you can see below, the result of your system c is always computed correctly:

One could argue that only 's' and 'z' (and maybe 'p' and 'q' for time domain) should be accepted by tf, though.

Lukas Reichlin <paramaniac>
Wed 12 Nov 2014 10:57:13 AM UTC, original submission:

The tf function from the control package can output the wrong result if the transfer function is not correctly entered, and it does not error out. The details can be found at this StackOverflow question but in essence, it boils down to the following:

c is incorrectly defined, but Octave does error out when doing so, and it then reports the wrong result.

Arnaud Miege <am304>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by nrjank (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by andy1978 (Posted a comment)
  • -unavailable- added by paramaniac (Posted a comment)
  • -unavailable- added by am304 (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 19 Oct 2015 02:26:38 PM UTCmtmillerStatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Fri 19 Jun 2015 01:57:15 PM UTCmtmillerSeverity3 - Normal=>2 - Minor
      Priority5 - Normal=>3 - Low
      Item GroupIncorrect Result=>Documentation
      Release3.8.0=>other
      Summarycontrol package: tf function outputs wrong results=>control package: tf function accepts any string as the variable name
    Thu 15 Jan 2015 02:34:21 AM UTCmtmillerStatusNone=>Need Info
      Operating SystemMicrosoft Windows=>Any
      Summarytf function outputs wrong results=>control package: tf function outputs wrong results

    Back to the top


    Powered by Savane 3.1-cleanup1