This question is a duplicate of this question that I asked on dsp stack exchange. However, nobody had the answer there but the question seems more appropriate on this forum (If not feel free to tell me, it's my first post here).
The question is the following :
I've got my state space representation $$ \dot{X} = AX+BU $$ $$Y = CX$$
with Laplace we get : $$Y(s) = C(A-sI)^{-1}BU(s) = H(s)U(s)$$ And I want to evaluate the coefficients of the rational function matrix : $$H(s) = C(A-sI)^{-1}B$$
my first idea was to use the cofactor formula : $$(sI-A)^{-1} = \frac{1}{det(sI-A)}Com(sI-A)^T$$ with $Com(sI-A)^T$ the matrix of the cofactors of $sI-A$.
my second idea was $$A-sI = -s(I-\frac{1}{s}A)$$
and then if you have $(\frac{1}{s}A)^{n} \xrightarrow[n \to \infty]{} 0$ for $|s|$ above a certain threshold: $$(I-\frac{1}{s}A)^{-1} = \sum_{k=0}^{\infty}(\frac{1}{s}A)^{k} \approx \sum_{k=0}^{N}(\frac{1}{s}A)^{k}$$
Although I feel like it's a bad idea somehow.
I also checked the ss2tf scipy function code but I really don't get what they do (especially in the loop l 278/280).
Can anyone enlighten me?