You are on page 1of 26

436-405 Advanced control

Nonlinear system and control


Lecture 4

Lyapunov stability

1
Previously
Over the last 2 lectures we considered qualitative
approaches to investigating nonlinear systems
Looked at drawing phase portraits
Linearising the system and classifying the
critical point
In 436-433 we briefly discussed Lyapunov
stability for (linear) digital systems
A more quantitative approach
There was some reason behind introducing this
concept
Today we will look at stability of nonlinear
continuous time systems using the method of
Lyapunov
2
Nonlinear stability
Types of stability:
x2 zone of
x2 x2
attraction

x1 x1 x1

Global asymptotic Local asymptotic Lyapunov


stability stability stability

Asymptotic stability
trajectories approach equilibrium point as t
Stability 'in the sense of Lyapunov'
equilibrium point is stable if all trajectories
starting 'nearby' stay nearby
3
Lyapunov stability analysis
Concept: seek a scalar function of the states V(x)
which is positive definite in a region R around the
equilibrium point: V(x) > 0, except V(0) = 0
The function V is a Lyapunov function if V is
negative semi-definite in R: V (x) 0
The existence of a Lyapunov function is sufficient
to prove stability (in the sense of Lyapunov) in the
region R
If V is negative definite, the equilibrium is
asymptotically stable
For a discrete-time system x(k + 1) = f(x(k)); f(0) = 0 :
V (x(k ) ) > 0, except V (0) = 0
V (x(k ) ) V (f (x(k ) ) V (x(k ) ) 0
4
Example: damped simple pendulum
x1 = x2
g c
x2 = sin x1 2 x2
l ml
The total mechanical energy is a good candidate
Lyapunov function. Consider the equilibrium point
x = [ ] = [0 0]
T
 T

Try V (x) = 12 ml 2 x22 + mgl (1 cos x1 ) positive definite in


> 0 except at x = 0 R: 2 < x1 < 2
V ( x) = ml 2 x2 x2 + mgl sin x1 x1
g c
= ml x2 sin x1 2 x2 + mgl sin x1 x2
2
l ml
= cx22 negative semi-definite
Hence, with this V we can only conclude origin is stable. But
the phase portrait indicates asymptotic stability; this V fails
to show this fact. 5
Extended Lyapunov stability theorem
This difficulty arises quite often, and has led to an
extension of the basic Lyapunov theorem:
If V(x) is a Lyapunov function in a region Mc: V(x) < c
then a solution starting in the interior of Mc
remains there.
If, in addition, no solutions (except the equilibrium
x = 0) remain in the subset of Mc where V (x) 0 ,
then all solutions starting in the interior of Mc will
converge to the equilibrium

For the pendulum, at the saddle point x1 = , x2 = 0,


V(x) = 2mgl. The conditions above will be satisfied
within the region Mc within which V(x) < 2mgl = c

6
Pendulum stability, contd
At the boundary of Mc we have
V (x) = 12 ml 2 x22 + mgl (1 cos x1 ) = 2mgl
The solution defines the separatrix:
x2 = 2 g (1 + cos x1 ) / l
Within this region, we have V(x) > 0 (except at x = 0)
and V (x) = cx22
For V (x) 0 we would require x2 0. That is,
g c
x2 = sin x1 2 x2 0
l ml
Within Mc this requires x1 = 0. That is, no solution
except x = 0 remains in the subset of Mc where V (x) 0
Hence solutions starting within the region defined
by the separatrix are asymptotically stable
7
Vector
2.5
field
Vectorand
field andcontours of V
contours of total energy

1.5

0.5
x2(l/g)

-0.5

-1

-1.5

-2

-2.5
-4 -3 -2 -1 0 1 2 3 4
x1
8
Pendulum Lyapunov function
V ( x) = 12 ml 2 x22 + mgl (1 cos x1 )

9
An alternative Lyapunov function
The damped pendulum: x1 = x2
g c
x 2 = sin x1 2 x2
The total mechanical energy is l ml
g
V (x) = 12 ml 2 x22 + mgl (1 cos x1 ) = ml 2 12 x22 + (1 cos x1 )
l
Try a more general quadratic
g
V (x) = 2 x Px + (1 cos x1 )
1 T
l
p11 p12 x1 g
= 2 [x1 x2 ]
1
+ (1 cos x1 )
p12 p22 x2 l
= ( p x + 2 p12 x1 x2 + p x ) + (1 cos x1 )
1 2 g 2
2 11 1 22 2
l
For xTPx to be positive definite
p11 > 0, p22 > 0, p11 p22 p122 > 0 10
An alternative Lyapunov function
V ( x) = ( p x + 2 p12 x1 x2 + p x ) + (1 cos x1 )
1 2 2 g
2 11 1 22 2
l
Rate of change:
g g c
V (x) = p11 x1 + p12 x2 + sin x1 x2 + ( p12 x1 + p22 x2 ) sin x1 2 x2

l l ml
g g
= (1 p22 )x2 sin x1 p12 x1 sin x1
l l
c c 2
+ p11 p12 2 x1 x2 + p12 p22 2 x2
ml ml
Select p11, p12, p22 such that V (x) < 0
c
p22 = 1 (eliminate x2 sin x1 ) p11 = 2 p12 (eliminate x1 x2 )
ml c c
Then, p12 > 0 ( x1 sin x1 > 0, 0 <| x1 |< ) and, p12 < 2 p22 = 2
ml ml
c c
i.e., 0 < p12 < 2 Let p12 = 12 2 , say
ml ml 11
An alternative Lyapunov function

1 1 c
2
2 c g
Then, V (x) = 2 2 2 x1 + 2 x1 x2 + x2 + (1 cos x1 )
2

ml ml l
1 g c 1 c
V (x) = 2 x1 sin x1 2 x22
2 l ml 2 ml
Hence, over R : |x1| <
V ( x) > 0 positive definite
V (x) < 0 negative definite
That is, the origin is asymptotically stable

This example has illustrated that Lyapunov provides


sufficient conditions only.
Failure to find a V(x) does not mean the origin is
unstable - just that we havent found the right V !
We can demonstrate instability, however.
12
Constructing Lyapunov functions
An important use of Lyapunov functions is to estimate the
'region of attraction' of an equilibrium point
e.g., for the pendulum equilm (0,0): 2.5
Vector field and contours of total energy

Mc: V(x) < 2mgl 2

1.5

However, there is no generally systematic 1

procedure for constructing a Lyapunov


0.5

x2(l/g)
0

function, let alone one which will yield the -0.5

largest estimate of the region of


-1

-1.5

attraction -2

-2.5

We have just seen one approach: construct


-4 -3 -2 -1 0 1 2 3 4
x1

a candidate V based on the system energy,


but with some free parameters which can
be adjusted to satisfy the requirements
of a Lyapunov function
If the equilibrium of the linearised system is asymptotically
stable, we can try another approach, based on the fact that
we can systematically construct a Lyapunov function for a
stable linear system
13
Lyapunov functions for linear systems
Consider nonlinear system x = f (x), f (0) = 0
Linearise: x = Ax + g (x) g(x) goes to zero
faster than x does
where
Euclidean norm:
f g ( x) n
A= , lim =0 x = xT x = xi2
2
x x =0
x 0 x
i =1

Consider stability of linearised system x = Ax


Try a general quadratic function of the states
as a candidate Lyapunov function: V(x) = xTPx
where P is a symmetric positive definite matrix
A matrix P is positive definite if xTPx > 0 for all x 0
i.e., V satisfies the requirements of a Lyapunov
function that V(x) > 0, except V(0) = 0
14
d
Then, V (x) = ( xT Px )
dt
= x T Px + xT Px
= xT ( AT P + PA ) x, since x = Ax
That is, V ( x) = xT Qx
where Q is a symmetric matrix defined by
AT P + PA = Q Lyapunov equation
If Q is positive definite, V < 0 , so that V is a Lyapunov
function and the linear system is asymptotically stable.
Conversely, let Q be any symmetric, positive definite
matrix (e.g. I), and solve the Lyapunov equation for P. If
P turns out to be positive definite, the system is
asymptotically stable.
If the linear system is known to be asymptotically stable,
we can construct a Lyapunov function thus: set Q = I,
solve for the positive definite P and construct V(x) = xTPx
15
0 1
Example: x = 1 1 x

p11 p12 MATLAB solution:
Let Q = I and P = = P T

p12 p22 P = lyap(A, Q)

Lyapunov equation: A P + PA = Q
T

0 1 p11 p12 p11 p12 0 1 1 0


1 1 p + =
12 p 22 p
12 p 22 1 1 0 1
2 p12 p11 p12 + p22 1 0
p p + p =
11 12 22 2 p 12 2 p22 0 1
0 2 0 p11 1 p11 1.5
1 1 1 p = 0 p = 0.5 P = 1.5 0.5
12 12 0.5 1

0 2 2 p22 1 p22 1
Check for positive definite P : Confirm stability:
p11 > 0, p22 > 0, p11 p22 p122 = 1.25 > 0 ( A) = 12 j 23
16
This is not a particularly useful stability test for
linear systems, because solving the Lyapunov
equation and testing for the positive-definiteness
of P is just as arduous as finding the eigenvalues
of A, and provides less information.
However, if we know the equilibrium of the
linearised system to be asymptotically stable, we
can solve the Lyapunov equation to construct a
Lyapunov function, and use it to estimate the
region of attraction for the nonlinear system.

17
Example
Damped nonlinear oscillator: y + 2y + (1 y ) y = 0

State variables: x1 = y, x2 = y
State equations: x1 = x2
x2 = (1 x1 ) x1 2x2
Equilibrium points: x = 0 x2 = 0, x1 = 0 or 1
f 0 1
Linearise: A= =
x 0 1 + 2 x1 2 0
0 1 Stable
E1: (0, 0) A = , ( A ) = j 1 2

1 2 focus
= j
0 1
E2: (1, 0) A= , ( A ) = 1 + 2
Saddle
1 2
18
Region of attraction for E1: (0,0)
In this example, analysis simplified if we use modal
state variables:
0 1 i 1 1 1
A= , i I A = , v = =
(1)

1 2 1 i + 2
1 + j
1 0 Ad
Real modal matrix: T =


Similarity transformation : z = Tx z = z

1 z1 1 0 x1 y
z=T x = =
z
2 / 1/ x
2 ( y
 + y ) /
Nonlinear equations in modal variables :
0 1 1 0 0 0
x = Ax + 2 z = T ATz + 2
z = A d z + 2
x1 / 1/ x1 z1 / 19
0
z = z + 2 = A d z + g(z )
z1 /
Solve Lyapunov equation: A d P + PA d = I P = I / 2
T

Hence, V (z ) = zT Pz = ( z12 + z22 ) / 2 positive definite

 V (z ) z1 z2 z1 + z2
V (z ) = z =
z z1 z2 + z12
2
z z
= ( z12 + z22 ) + 1 2

Clearly V < 0 close to the origin. Now find where V = 0
2
z1 z2
V = 0 (z + z )+
 2
1
2
2 =0

2 3
z z
z12 = 2
Vthresh = 2
where V = 0
z2 / 1 2 ( z2 )
20
z23
Vthresh =
2 ( z2 )
Now we know that along this line:
 Vthresh (z ) Vthresh ( z2 )
Vthresh (z ) = z = z2 = 0
z z2
But we are not at an equilibrium point (or line) so z2 0
Vthresh ( z2 ) z23
= =0
z2 z2 2 ( z2 )

After algebraic manipulation this leads to z2 = 32


So substitution provides Vthresh = 278 2

For the basin of attraction, we want V < Vthresh, so


(z 2
1 + z22 ) 2 < 278 2
Region of attraction
z +z <
2
1
2
2
27
4
2 2
Is a circle! 21
Estimate is conservative
= 0.3
1.5

0.5
z2 = (y' + y)/

-0.5

-1

-1.5
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
z1 = y
22
Contours of dV/dt in phase
plane
V (z ) = 0 contour
= 0.3

V (z ) > 0

Boundary of
actual region of
attraction
(separatrix)
Boundary of
estimated region of
attraction

V (z ) < 0

23
Rate of change of V(z) in phase plane

V (z ) = 0 contours

24
= 0.3
(1, 1.5)
unstable trajectory

(0.5, 1.5)
stable trajectory

Contours of V
in phase plane
25
Summary
The existence of a Lyapunov function proves stability
for a system
However, just because one Lyapunov function doesnt
give stability doesnt mean the system is unstable
For linear systems the exercise is pretty much
academic
For nonlinear systems we can get an estimate of the
basin of attraction of an equilibrium point after
linearisation about the equilibrium point

26

You might also like