Finding the the matrix $(sI-A)^{-1} $

7k Views Asked by At

I'm using octave and I wonder how I can compute the matrix $(sI-A)^{-1} $ if $s $ is a symbolic variable and $A $ is a matrix.

1

There are 1 best solutions below

11
On BEST ANSWER

In MATLAB you can do it the following way, I think that should also work for Octave but I am not quite sure:

% Define matrix A
A = [1 2 3; 4 5 6; 7 8 9];

% Define symbolic variable s
syms s;

% evaluate (sI-A)^(-1)
(s*eye(size(A,1))-A)^(-1)

% get denominator
det(s*eye(size(A,1))-A)

An alternative way without using the symbolic toolbox is to define a state space model and then use ss2tf.

A = [ 1 2 3; 4 5 6; 7 8 9];
B = [1;1;4];
C = [1 0 0];
D = [0];
[num,den] = ss2tf(A,B,C,D)