-
Notifications
You must be signed in to change notification settings - Fork 89
Description
@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.
freqrespshould obvioulsy exploit the Hessenberg structure if the StateSpace is known to be structured (i.e., specific subtypes ofHeteroStateSpace). However what should be done ifAis a regular matrix?
A. Should the user have to explicitly have construct a structured statespace with aHessenbergAmatrix?
B. Should the Hessenberg factorization somehow be cached in theStateSpaceobject?
C. Automatically compute a Hessenberg factorization for each call tofreqrespandevalfr(probably overloading the broadcaseevalfr.forStateSpace). 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
-
What ordering of the output of
freqrespdimensions 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) -
It should be possible to use
freqrespon a single number (with a matrix output). This situation occurs quite often to me and it is a hassle having to go throughevalfror dropping dimensions. -
The name of
evalfris notoriously easy to confuse withfreqresp. Some ideas: i) rename it toevaltf, or something even better (evaltfhas some obvious problems, but I'd say it is much better than evalfr). ii) Only allowComplexinputs in the exported function (we already havedcgainfor the by far most common real input. Or is there something likeDualNumbersfor which this would break?