Stability Analysis

Consider the following State Space Model and analyse its stability.
A=[1 -3.5 4.5;2 -4.5 4.5;-1 1.5 -2.5];
B=[-0.5 -0.5 -0.5]';
C=[1 1 0];
D=1;
G=ss(A,B,C,D);

Lyapunov First Method

Lyapunov stable?

Theorem 1: (MCT p136)
For LTI system, the sufficient and necessary condition of equilibrium being Lyapunov stable is that
  1. All the eigenvalues of matrix 𝑨 have negative real part.
  2. Eigenvalue with zero real part is the unique root of minimal polynomial
lambda=eig(A);
if sum(lambda<0) == length(lambda)
fprintf('this system is lyapunov stable')
else
fprintf('this system is not lyapunov stable')
end
this system is lyapunov stable

BIBO stable?

Theorem 3: The sufficient and necessary condition of LTI system being BIBO stable is that the poles of TF are located in left part of s domain. (MCT p137)
p=pzmap(G);%get poles of the system
if sum(real(p)<0) == length(p)
fprintf('the system is stable \nwith %dpoles and %d possitive poles',length(p),sum(real(p)>0))
else
fprintf('the system is unstable\nwith %dpoles and %d possitive poles',length(p),sum(real(p)>0))
end
the system is stable with 3poles and 0 possitive poles

Lyapunov Second Method

Lyapunov stability theorem of linear system

Remark 1: For any given positive definite matrix 𝑸, matrix 𝑷 which satisfies equation is unique. The system is asymptotically stable when 𝑷 is positive definite.(MCT p146)
Q=eye(3,3);
%solve for the matrix P
%NOTE: here in matlab the function `lyap` solves equation
%AP+PA'=-Q so we need transpose A first
P=lyap(A',Q);
check the matrix P is positive . Determine Whether Matrix Is Symmetric Positive Definite
for i=1:length(A)
if det(P(1:i,1:i))<=0
break;
end
end
if i==length(A)
fprintf('The system is stable')
else
fprintf('The system is not stable')
end
The system is stable