Ok, so I know that if I have a system that looks like Ax=b
it is foolish to solve it by solving for the inverse of A and one should instead use something like Gaussian elimination, or something like that. However, I am trying to calculate H(s) = B*(sI-A)^-1*C
, where s
is some scalar and A
,B
,C
are matrices (of dimensions such that H(s)
is a scalar too, if that helps). Now, this is a large system and I can't do this calculation symbolically, but when I try and plug in the s
values that I am interested in, the (sI-A)
matrix has really bad condition numbers (something like 10^10
) and I highly doubt that my numeric results are in any way accurate --- it's not just the condition numbers, the answer comes out completely unlike what I would expect it to be. Do you have any ideas on either some algorithm that could help me out, or a math trick that would scale things in a such a way that inversion would not run into machine precision problems?
Just so everyone knows, this comes up when trying to calculate a transfer function from the state space representation of a linear system.