Skip to content

Discussion of frequency responses #321

@olof3

Description

@olof3

@baggepinnen @mfalt and I have been starting to look at how to utilize the specialized inversion algorithm for Hessenberg matrices that was in introduced in 1.3 to speed up the computation of frequency responses. Here are some thoughts to start of further discussions.

A question is how to exploit properly and avoid re-compuing Hessenberg factorziations too often.

  1. freqresp should obvioulsy exploit the Hessenberg structure if the StateSpace is known to be structured (i.e., specific subtypes of HeteroStateSpace). However what should be done if A is a regular matrix?
    A. Should the user have to explicitly have construct a structured statespace with a Hessenberg A matrix?
    B. Should the Hessenberg factorization somehow be cached in the StateSpace object?
    C. Automatically compute a Hessenberg factorization for each call to freqresp and evalfr (probably overloading the broadcase evalfr. for StateSpace). Either a strucatured statespace could be constructed, or the factorization could just be used directly.
    D. Other ideas?

To me, C seems like the best option, it is much more straightforward than B, and if the user really cares about efficiency it should be relatively easy to compute a structured statespace with Hessenberg structure.

Some other thoughts while we are discussing frequency responses

  1. What ordering of the output of freqresp dimensions should we use? To me it seems seems more natural to have the index corresponding to frequency first, as typically one considers the frequencies one at a time. (except when plotting, which is why we decided on this ordering in the first place, I guess)

  2. It should be possible to use freqresp on a single number (with a matrix output). This situation occurs quite often to me and it is a hassle having to go through evalfr or dropping dimensions.

  3. The name of evalfr is notoriously easy to confuse with freqresp. Some ideas: i) rename it to evaltf, or something even better (evaltf has some obvious problems, but I'd say it is much better than evalfr). ii) Only allow Complex inputs in the exported function (we already have dcgain for the by far most common real input. Or is there something like DualNumbers for which this would break?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions