### 1.25 How to check for stability of system represented as a transfer function and state space

Problem: Given a system Laplace transfer function, check if it is stable, then convert to state space and check stability again. In transfer function representation, the check is that all poles of the transfer function (or the zeros of the denominator) have negative real part. In state space, the check is that the matrix A is negative deﬁnite. This is done by checking that all the eigenvalues of the matrix A have negative real part. The poles of the transfer function are the same as the eigenvalues of the A matrix. Use $sys=\frac {5s}{s^{2}+4s+25}$

#### 1.25.1 Checking stability using transfer function poles

 Mathematica Remove["Global*"]; sys =TransferFunctionModel[(5s)/(s^2+4s+25),s]; poles=TransferFunctionPoles[sys]  {{{-2-I Sqrt[21],-2+I Sqrt[21]}}}  Re[#]&/@poles  Out[42]= {{{-2,-2}}}  Select[%,#>=0&]  Out[44]= {} 

 Matlab clear all; s=tf('s'); sys=5*s/( s^2+4*s+25); [z,p,k]=zpkdata(sys,'v'); p  >> p = -2.0000 + 4.5826i -2.0000 - 4.5826i  find(real(p)>=0)  ans = Empty matrix: 0-by-1 

#### 1.25.2 Checking stability using state space A matrix

 Mathematica ss=StateSpaceModel[sys]; a=ss[[1,1]]  Out[49]= {{0,1},{-25,-4}}  e=Eigenvalues[a]  Out[50]= {-2+I Sqrt[21],-2-I Sqrt[21]}  Re[#]&/@e  Out[51]= {-2,-2}  Select[%,#>=0&]  Out[52]= {} 

Matlab

 sys=ss(sys); [A,B,C,D]=ssdata(sys); A  A = -4.0000 -6.2500 4.0000 0  e=eig(A)  e = -2.0000 + 4.5826i -2.0000 - 4.5826i  find(real(e)>=0)  ans = Empty matrix: 0-by-1 `