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 definite. 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}\]
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 |
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 |