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

 
 

bug #61667: [octave forge] (control) tf() function gives wrong result for complex state space models

Submitter:  Karl Stephan Stille <kssupb>
Submitted:  Mon 13 Dec 2021 01:19:15 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 6.2.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 20 Mar 2022 05:04:17 PM UTC, comment #3: 

I think this is a general problem since the free SLICOT routines, that are used for some functionality of the control package, do not support complex coefficients, at least as far as I know. In this case, I suggest to throw an error with an appropriate error message instead of returning a wrong result.

Torsten Lilge <ttl>
Group Member
Wed 15 Dec 2021 06:41:11 PM UTC, comment #2: 

Confirmed with the simple example:

A = [ -1 0 ; 0 j ]; B = [ 1 ; 1 ]; C = [ 1   1 ]; D = 0;

sys_ss = ss (A,B,C,D);
eigenvalues_A = eig (A)

sys_tf = tf (sys_ss)
[n,d] = tfdata (sys_tf,'v');
poles_tf = roots (d)


Torsten Lilge <ttl>
Group Member
Mon 13 Dec 2021 03:06:38 PM UTC, comment #1: 

Adding package maintainer to CC.

Markus Mützel <mmuetzel>
Group administrator
Mon 13 Dec 2021 01:19:15 PM UTC, original submission:  

When using the tf() function for state space models with complex entries the result strips complex poles from the result. As can be seen in the following example, the order decreases by two.

Example system:

A=[-0.2071,0,0,0;0,-3.7646,0,0;0,0,-0.58+4.183*i,0;0,0,0,-0.58+4.183*i];
b=[44.3;160;-39.2-38.1*i;39.2+38.1*i];
cT=[0.502,-0.075,-0.0251-0.18*i,-0.0251+0.18*i];
d=0;
sys=ss(A,b,cT,d)
tf(sys)



The result in Matlab:


ans =

     -(3.477-14.11i) s^3 + (89.71+35.95i) s^2 + (110.7-457.9i) s - (1354+343.1i)
  ---------------------------------------------------------------------------------
  s^4 + (5.132-8.366i) s^3 - (11.77+38.08i) s^2 - (67.25+25.79i) s - (13.38+3.783i)


where octave gives:


Transfer function 'ans' from input 'u1' to output ...

         10.24 s + 81.23
 y1:  ----------------------
      s^2 + 3.972 s + 0.7796


This bug also affects functions as e.g. step()

Tested with control package version 3.3.1

Karl Stephan Stille <kssupb>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #52499:  bug.m added by kssupb (191B - text/x-objcsrc)

 

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 mmuetzel
  • -email is unavailable- added by kssupb (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-12-15 ttl StatusNone Confirmed
    2021-12-13 mmuetzel Carbon-CopyRemoved 102357 -
    2021-12-13 mmuetzel Carbon-Copy- Added ttl
    2021-12-13 mmuetzel Carbon-CopyRemoved ttf -
    2021-12-13 mmuetzel Summarytf() function gives wrong result for complex state space models [octave forge] (control) tf() function gives wrong result for complex state space models
        Carbon-Copy- Added ttf
    2021-12-13 kssupb Attached File- Added bug.m, #52499

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code