bugGNU Octave - Bugs: bug #63661, [Octave Packages] (control)...

 
 

bug #63661: [Octave Packages] (control) Results of function "tf" may lead to execution error / Other inconstencies

Submitter:  Charles Praplan <charprap>
Submitted:  Sat 14 Jan 2023 10:17:10 AM UTC
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  None Assigned to:  None
Originator Name:  Charles Praplan Open/Closed:  * Open
Release:  * 7.3.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

( Jump to the original submission )

Tue 24 Jan 2023 04:56:33 PM UTC, comment #7: 

I have personally no objection against dropping tsam = -2.

Charles Praplan <charprap>
Mon 23 Jan 2023 07:41:58 PM UTC, comment #6: 

Up to now, the characteristic "static gain" is stored in the system's sampling time, i.e. tsam = -2. As a consequence, it was not possible to have discrete-time static-gain systems with a specific sampling time.

In order to make static-gain systems more consistent and in order to improve compatibility, I am currently preparing a patch that introduces a method isstaticgain() that is used for testing for static-gain when required instead of relying on tsam = -2.

Before finishing the patch, I would like to know if there any are any objections against dropping tsam = -2 "feature", although it should have been purely package-internal.

Torsten Lilge <ttl>
Project Member
Sun 15 Jan 2023 06:38:34 PM UTC, comment #5: 

Issue 1) in the original submission was already fixed in the default branch of the package.

It seems that issue 2) should be easy to fix. However, issue 3) is more complicated since the way a static gain is stored in the system structure is using tsam. I am currently trying to figure out how this could be changed.

Torsten Lilge <ttl>
Project Member
Sun 15 Jan 2023 04:16:29 PM UTC, comment #4: 

Thanks for the report. I will have a look into the issue the next days.

Torsten Lilge <ttl>
Project Member
Sat 14 Jan 2023 06:20:31 PM UTC, comment #3: 

Copying the control package maintainers. It looks like OP's code works in control 3.3.1 but not in 3.4.0. Marking as regression, but pls revert that if the change in functionality was intended.

Arun Giridhar <arungiridhar>
Project Member
Sat 14 Jan 2023 05:56:44 PM UTC, comment #2: 

I'm using octave version 7.3.0 with control 3.4.0.
I did not update any package.

If I replace the function adjust_tf_data.m by the one of control 3.4.0, the code is working.

I append a picture comparing the two files: very few differences.


Charles Praplan <charprap>
Sat 14 Jan 2023 12:44:17 PM UTC, comment #1: 

@OP: Which version of the control package are you using? You say it used to work, so it sounds like a regression. Which version of the package worked properly for that code? Did you do "pkg update" recently? Were they all on the same version of Octave?

Arun Giridhar <arungiridhar>
Project Member
Sat 14 Jan 2023 10:17:10 AM UTC, original submission:  

1)
Everything started with the following code which was working but now produces an error:

sig=[0:9]; t=[0:9]; sys_c=tf(2,1); lsim(sys_c,sig,t,'b');
error: c2d: system is already discrete-time

Note that tf is called with the arguments to generate a continuous system: sys_c.
sys_c is newly generated as being both a continuous and a discrete static gain (previously Continuous-time model).
This is ok and is the same in matlab.

The error occurs when passing sys_c to c2d which does not accept to handle sys_c because it is already discrete.

The origin of this is in the function _adjust_tf_data_.m which has been modified (the solution is perhaps in the fct c2d).

Other inconstencies :

2) sys=tf(2,1) and sys=tf([0 2],[0 1]) do not produce the same result:

sys=tf(2,1)
isct(sys), isdt(sys), sys.Ts
sys=tf([0 2],[0 1]),
isct(sys), isdt(sys), sys.Ts

3) Following call results in the lost of sampling time information:

sys_1d=tf(2,1,7);
sys_1d.Ts

Charles Praplan <charprap>

 

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

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by arungiridhar
  • -email is unavailable- added by arungiridhar
  • -email is unavailable- added by arungiridhar (Posted a comment)
  • -email is unavailable- added by charprap (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 project members can vote.

     

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-14 arungiridhar Item GroupIncorrect Result Regression
        Carbon-Copy- Added ttl
        Carbon-Copy- Added dastew
    2023-01-14 charprap Attached File- Added _adjust_tf_data_diff.png, #54222
    2023-01-14 arungiridhar SummaryResults of function &quot;tf&quot; may lead to execution error / Other inconstencies [Octave Packages] (control) Results of function "tf" may lead to execution error / Other inconstencies

    Back to the top

    Powered by Savane 3.10