Various types of Stability are there for solution of differential equation of the dynamic systems. One the major stability technique for non linear dynamic system is called lyapunov.

A detailed post on the Lyapunov Stability Criteria will be uploaded soon.

A wikipedia page gives a general idea about the lyapunov stability.

Following posts gives a very basic example to hel user use the lyapunov function in Matlab.

# Problem

A non linear system with state space equation of

Find Stability at equilibrium points

# Solution

Given system as

Calculating the equilibrium points

Substitute in above equation

we get

Therefore the equilibrium points are at x = (0,0)

Q is the identity matrix with order of A and is a positive definitive matrix.

Now using the MAtrix A and Matrix Q above we will write a Matlab Program

# Matlab Code

%-------------------------------------------------------------------------- % % From the question above we will be solving for stability % x1' = -x1 + 2x1x2 % x2' = -x2 % equiliibrium at x1 = 0 and x2 = 0 % % Given ------------------------------------------------------------------- MatrixA = [-1 0;0 -1]; MatrixQ = [1 0;0 1]; % Lyap(A,Q) --------------------------------------------------------------- % AX + XA' + Q = 0 % A = MatrixA, Q = MatrixQ, X = MatrixX % ------------------------------------------------------------------------- MatrixX = lyap(MatrixA,MatrixQ); disp('Lyapunov Solution is MatrixX = '); disp(MatrixX); k = eig(MatrixX); disp('Eigen values of Lyapunov: '); disp(k); if(k(1)>0 && k(2)>0) disp('The System is Positive Definite and hence stable'); else disp('The System is not Positive Definite and hence unstable'); end

# Output:

Here the System is stable and has a unique solution to the said equation.

Lyapunov Solution is MatrixX = 0.5000 0 0 0.5000 Eigen values of Lyapunov: 0.5000 0.5000 The System is Positive Definite and hence stable

# Another Problem with Unstability

Given Non-Linear System

Calculating the equilibrium points

Substitute in the above equation

We will get

Therefore the equilibrium points are at x=(0,0)

Q is the identity matrix with order of A and is a positive definitive matrix.

Now using the Matrix A and Matrix Q above we will write a Matlab Program

# Matlab Program

To show the non uniqueness of the non linear system we are going to use the Matrix A and Matrix Q given above theory for the non linear system and see that the unique solution does not exists.

%-------------------------------------------------------------------------- % % From the question above we will be solving for stability % x1' = -x1 + 2x1x2 % x2' = -x2 % equiliibrium at x1 = 0 and x2 = 0 % % Given ------------------------------------------------------------------- MatrixA = [0 1;0 -1]; MatrixQ = [1 0;0 1]; % Lyap(A,Q) --------------------------------------------------------------- % AX + XA' + Q = 0 % A = MatrixA, Q = MatrixQ, X = MatrixX % ------------------------------------------------------------------------- MatrixX = lyap(MatrixA,MatrixQ); disp('Lyapunov Solution is MatrixX = '); disp(MatrixX); k = eig(MatrixX); disp('Eigen values of Lyapunov: '); disp(k); if(k(1)>0 && k(2)>0) disp('The System is Positive Definite and hence stable'); else disp('The System is not Positive Definite and hence unstable'); end

# Output:

Here as we already know that the system is unstable therefore the unique solution does not exists. We will get the output as shown.

??? Error using ==> lyap at 70 The solution of this Lyapunov equation does not exist or is not unique. Error in ==> stability_analysis at 51 MatrixX = lyap(MatrixA,MatrixQ);

To be Updated