patchGNU Octave - Patches: patch #8778, [octave forge] (control)...

 
 

patch #8778: [octave forge] (control) improvement of lti/ss/freqresp numerics, possibly also a way to better ss2tf

Submitted by:  None
Submitted on:  Thu 22 Oct 2015 05:08:23 PM UTC  
 
Category: Forge : otherPriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOriginator Email: -unavailable-
Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 22 Oct 2015 05:08:23 PM UTC, original submission:

Hello,

during my work on atomic clock ensembling, which uses a lot of Control toolbox, I have encountered grave numerical errors during plotting of state-space (@lti/@ss) Bode plots, traced to _freqresp_.m.

In MATLAB it gave good plots out of the same data. I haven't looked into MATLAB and not into a SLICOT and tried a fix using high-level algebraic functions. Original _freqresp_ uses a textbook formula for on-the-fly transformation of ss LTI system into an operator transfer function, i.e. c* (es - a)^-1 b, where e is identity for regular systems, and something for stiff systems.

Here, the matrix inverse yielded a lot of rcond warnings. Although I can agree, that my system is "ugly", and there might be lot of nearly cancelling modes, it turned out to be possible to fix freqresp by calling eigendecomposition first, and then to just fiddle with inversions on diagonal. Besides the more stable behaviour, it shall be much faster, where there are (typically) lots of frequency points to evaluate.

I am attaching my test data, together with new freqresp and test script bodetst.m.

What I have not done:

1. support for stiff systems: I can not imagine the function for case of non-identity e; however, stiff systems are rare enough, so in worst case a revert to old formula could be used;

2. it seems to me silly to call Cdiag(..)D, but I am unsure about internal optimizations, JIT etc., so I do not know, whether to use this, for cycles, or something else to get fastest result.

Besides the ss/freqresp function, it may be interesting to consider improvement of ss2tf, ss2zpk conversions. It seems, that these functions are outsourced to some SLICOT code (in what I do not dare to even look). Freqresp using these converted systems are even much worse, than the original.

It seems to me, that the conversion into tf & zpk respectively could be better made by the same eigendecomposition, which I have used for freqresp. But I am not so experienced LTI guru to imagine all possible scenarios, I mean, whether the SLICOT ones could be better in some situation (but I doubt it could).

Any advanced appreciated.

Greetings,
Marek

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #35263:  lti_ss_freqresp_improve.png added by None (88KiB - image/png)
file #35264:  lti_ss_xfer_improve.tar.gz added by None (12KiB - application/gzip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by mtmiller
  • -unavailable- added by hrobotron (author)
  •  

    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 logged-in users can vote.

     

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

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 10 Apr 2018 06:02:04 AM UTCmtmillerCategoryNone=>Forge : other
      SummaryControl pkg: improvement of lti/ss/freqresp numerics, possibly also a way to better ss2tf=>[octave forge] (control) improvement of lti/ss/freqresp numerics, possibly also a way to better ss2tf
    Tue 09 Feb 2016 11:46:29 PM UTCmtmillerCarbon-Copy-=>Added paramaniac
    Thu 22 Oct 2015 06:06:29 PM UTChrobotronCarbon-Copy-=>Added marek peca
    Thu 22 Oct 2015 05:08:23 PM UTCNoneAttached File-=>Added lti_ss_freqresp_improve.png, #35263
      Attached File-=>Added lti_ss_xfer_improve.tar.gz, #35264

    Back to the top


    Powered by Savane 3.1-cleanup1