Copyright © IFAC Nonlinear Control Systems, Stuttgart, Germany, 2004
ELSEVIER
IFAC PUBLICATIONS www.e1sevier.com/1ocate/ifac
A NOTE ON DISCRETE-TIME STABILIZATION OF HAMILTONIAN SYSTEMS Dina Shona Laila and Alessandro Astolfi 1
Electrical and Electronic Engineering Department Imperial College, Exhibition Road, London S W7 2A Z, UK. E-mail: {d .laila, a. astolf i }
Abstract: In this paper we present some preliminary results on the stabilization problem for Hamiltonian systems using approximate discrete-time models. The issues of constructing a discrete-time model for Hamiltonian system are in general different from those for dissipative systems. We propose an algorithm for constructing an approximate discrete-time model, which guarantees the Hamiltonian conservation, and apply the algorithm to a class of port-controlled Hamiltonian systems. We illustrate the usefulness of the algorithm in designing a discrete-time controller to stabilize the angular velocity of a rigid body. Copyright © 2004 IFAC Keywords: Hamiltonian systems; Discrete-time systems; Stabilization; Nonlinear systems; Conservation.
1. INTRODUCTION
approximate and the exact models (see (Nesic and Teel, 2004; Nesic et al., 1999b; Stuart and Humphries, 1996)). Unfortunately, most numerical methods that apply to dissipative systems do not apply to conservative systems, in the sense that numerical approximation in most cases will destroy the conservative property of the systems. As a results, we may not be able to use these methods to obtain a good model for conservative systems, especially when control design exploits the conservative property of the plant.
One of the main issues of direct discrete- time design for a nonlinear sampled-data control system is to find a good model to use. Even if the continuoustime model of the plant is known, we cannot in general compute the exact discrete-time model of the plant, since it requires computing an explicit analytic solution of a nonlinear differential equation. A way to solve the problem of finding a good model is by using an approximate model of the plant.
Hamiltonian systems are an important class of nonlinear systems commonly used to model conservative physical systems, e.g. electrical networks, rigid manipulators etc. There has been a lot of research to develop numerical algorithms that preserve important properties of Hamiltonian conservative systems, particularly conservation of the symplectic mapping and Hamiltonian conservation, which are two of the most important properties of these systems (see for example (Stuart and Humphries, 1996; Gonzalez, 1996) and references therein). However, to the best of the authors knowledge, there is only very little research done
A quite general framework for stabilization of sampled-data nonlinear systems via their approximate discrete-time model was presented in (Nesic and Teel, 2004; Nesic et al., 1999b). In these works, the problems are seen from the framework of dissipative systems. In this context, approximate discrete-time models can be obtained using various numerical algorithms, such as Runge-Kutta and multistep methods. Consistency properties are used to measure the discrepancies between the 1 This work is supported by the EPSRC Portfolio Award, Grant No. GR/S61256/01.
967
in the direction of direct discrete-time controller design. Motivated by the importance of Hamiltonian systems in control design and the prevalence use of computers to control such systems, in this paper we study a stabilization problem for Hamiltonian conservative systems via approximate discrete-time models. We need to mentioned that although it is possible to model non-conservative systems using Hamiltonian approach, in this paper we restrict the use of the term Hamiltonian systems only for Hamiltonian conservative systems.
J(x) is an n x n skew-symmetric matrix with entries depending smootWy on x. Note that J(x) is not necessarily non-singular. The system (5) is called a port-controlled Hamiltonian systems with structure matrix J(x) and Hamiltonian H(x). It can be seen that -9tH(x(t)) = u'(t)y(t), showing that the system (5) is conservative if H 2: O. Another important property of port-controlled Hamiltonian systems which may be inferred from the structure of J(x), is the existence of Casimir functions C(x). These functions are independent of the Hamiltonian H (x). If for a port-controlled Hamiltonian system there exist a function C (x) which is a solution of
In this paper, we use some available results in literature to propose a numerical recipe for constructing a discrete-time model for a class of Hamiltonian systems. We show that the algorithm guarantees the Hamiltonian conservation. We present an application of the algorithm to port-controlled Hamiltonian systems with quadratic Hamiltonian, and propose a result that allows us to use a direct discrete-time technique to design a controller that stabilizes the discrete-time model of the system.
(a~~x))' J(x) = 0 dC (x) =
dt
Example 2.1 (van der Schaft, 2000). An important example of port-controlled Hamiltonian systems is a controlled rigid body spinning around its center of mass in the absence of gravity, which is commonly used to model a satelite. The energy variables are the three components of the angular momentum p along the three principal axes p = (a, (3, ,)', and the energy is the kinetic energy
(1)
(J+ J)' = J+ J x' Jx = 0 .
J+ J J+
and
=
(J+ J)2
J+ =
1( 2 H(p) = 2 Iaa
(2)
J+ J
(3) (4)
[~ !a] ~~ + [1~] [~:~] I,'Y =
-0"1 -{3 a 0
u.
(9)
aH
a,
In this paper, we focus on Hamiltonian systems with collocated inputs and outputs, namely portcontrolled Hamiltonian systems (van der Schaft, 2000). Port-controlled Hamiltonian systems are conservative, although not all nonlinear conservative systems can be represented as port-controlled Hamiltonian systems. A generalized representation of port-controlled Hamiltonian systems is as follows:
aH y = g'(x) ax (x) ,
(8)
aH
2.2 Port-controlled Hamiltonian systems
+ g(x)u
2) + If3{3 2 + Ly'"Y,
where la, I f3 , I, are the principal moments of inertia. The dynamics model of the system with only one control is
In the case when J is invertible with inverse J- 1 , we have that J+ = J- 1 .
. aH x = J(x) ax
(7)
function C(x) is conserved. For more details about port-controlled Hamiltonian systems, we refer to (van der Schaft, 2000).
J' = -J and
(x) ) , ( ) 9 x u .
= 0 (or for arbitrary input if (a~1x))' g(x) = 0), then d~~X) = 0 and the
The set of real and natural numbers (including 0) are denoted respectively by lR and N. To avoid confusion, we use the notation T for a sampling period, and A' to denote the transpose of a matrix A. If J is a skew symmetric matrix and J' and J+ are respectively the transpose and the MoorePenrose inverse of J, then the followings hold: J
(acax
It is obvious that for u
2.1 General notions and notation
=
(6)
then along the trajectories of the system we have
2. PRELIMINARIES
J J+ J
'Ix,
The corresponding collocated output is given by
y=a+{3+,.
(10)
It is obvious that the system is a port-controlled Hamiltonian system, and it is easy to see that the derivative of the Hamiltonian is dH T
di
= U y.
(11)
Hence, as H 2: 0, the system is conservative.
(5)
2.3 Numerical methods for Hamiltonian conservation
where x E lR n , u E lRm and y E jRm are respectively the state, input and output vectors.
Most of the commonly known numerical methods are used for modeling the dynamics of dissipa-
968
tive systems. The issues of modeling Hamiltonian systems are in general quite different from that of dissipative systems. Numerical methods that define the dynamics of dissipative systems do not necessarily define the dynamics of Hamiltonian systems, in the sense that most of the methods would destroy the Hamiltonian conservation property of the systems.
Note that (14) restricts Algorithm ALG1 to apply only if J is invertible, whereas singular J often arises in practice. An example of this is the rigid body considered in Example 2.1. The result presented in the next section is a generalization of Algorithm ALG1, which relaxes the restriction on nonsingularity of J and allows the algorithm to be used for systems with arbitrary dimension.
In this subsection, a review of a numerical method that can be used to model Hamiltonian conservative systems with no input is presented (Gonzalez, 1996; Stuart and Humphries, 1996). The method involves evaluation of the Hamiltonian H(·) and its gradient \7H(·), and it follows the algorithm:
3. MAIN RESULT
3.1 General construction In this section we present our main result. The result is a numerical algorithm which can be seen as a generalization of Algorithm ALG 1. It allows us to deal with the case of singular J and this automatically extends the applicability of the algorithm to systems of arbitrary dimension. As in subsection 2.1, in this section we consider Hamiltonian systems with no input (u = 0). The formula of the new algorithm is very similar to Algorithm ALG 1, with some modifications by introducing a new symmetric matrix S. It is written as
Xk+~- Xk = J(xl.)\7H(xl.) 2
2
+ J(Xl.2 )[H(Xk+d -
(12)
H(Xk)
Xk+l - Xk - (\7H(X!),Xk+l - Xk)] II( )11 2 Xk+1 - Xk where
1
X! = 2(Xk+1
+ Xk)
,
'
(13)
and J is a skew symmetric matrix that satisfies not only (1), but J' = -J = J- 1 . (14)
Xk+~- Xk
2
=
a} ,
Il
inf
11\7 H(x)11 > 0 ,
for all T E (0, T*).
2
,
x k+l - Xk II~ := (Xk+l - Xk)' S(X! )(Xk+l - Xk).
A1 (Xk+l - Xk)' S(Xk+l - Xk) =I O. A2 (Xk+l- Xk)'S(Xk+1- Xk) =I (Xk+l- Xk)'(Xk+lx k), for S = J+ J =I I.
(15)
Note that due to limited space, we often drop the arguments of parameters or variables whenever it does not cause any confusion.
•
Proposition 1. Suppose A1 holds. Algorithm ALG2 guarantees the Hamiltonian conservation for the approximate discrete-time model. •
Theorem 2.2. (Stuart and Humphries, 1996) Under Assumption 2.1, there exists T = T* (a) such that Algorithm ALG1 generates a semigroup Fj, : Ba ---+ Ba for T E (0, T*). Furthermore, the semigroup is convergent with order 2 and there is a constant K = K(T*, a) such that, for all X E Ba,
IIF;x - F(t)xll ~ KT
'
To state our result, we assume the following.
(16)
i.e., Ba does not contain anyequilibria.
Xk+1 - Xk 2 - Xk lis
II X k+1
We refer to this modified algorithm (18) as Algorithm ALG2. The Hamiltonian conservation of Algorithm ALG2 is presented in Proposition 1, and the convergence of this algorithm follows directly from Theorem 2.2 under Assumption 2.1, with the compact set B~ := {x E }RN : H(x) = a} (the system may have arbitrary dimension).
and it is such that xEB a
2
where the matrix S(·) := J+(-)J(.), and
c
lR2N : H(x)
(18)
- H(Xk)
- (\7H(Xl.),S(Xl)(Xk+1 - Xk))]
Assumption 2.1. (Stuart and Humphries, 1996) The function H E oo (lR 2N ,lR), with N E N is such that for some a E lR, the system (5) with u = 0, defines a dynamical system on a compact set Ba, which is defined as := {X E
J(x!)\7H(x!)
+ J(xl)([H(Xk+d 2
We refer to the algorithm (12), (13) as Algorithm ALG 1. The method is a second order accurate automatic conserving method that directly enforce conservation and applies for systems of arbitrary even dimension. Note that the method is a perturbation of the implicit midpoint rule. The perturbation is sufficiently small to retain second order accuracy, and the method automatically conserves the Hamiltonian. The convergence of this automatic Hamiltonian conserving method is guaranteed by Theorem 8.5.4 of (Stuart and Humphries, 1996), which we restate below.
Ba
=
Proof of Proposition 1: Suppose that the sampling time T > 0 is sufficiently small so that the Implicit Function Theorem (Stuart and Humphries, 1996) holds for all x E B~. Let
(17)
~x :=
•
969
Xk+1 - Xk
~H := H(Xk+d - H(Xk) .
Cl Algorithm ALG2 guarantees the Hamiltonian conservation for the approximate discretetime model of the system. C2 Algorithm ALG2 reduces to an implicit midpoint algorithm for the system. _
Multiply both sides of (18) with T~'xJ+(Xl), to obtain 2
Ll'xJ+Ll x
=TLl'xJ+JVH(Xl)+T~'xJ+J~H
Ll X2
II~xlls
2
Proof of Corollary 2: The proof of Cl is a direct consequence of Proposition 1, and here we concentrate on the proof of C2. From Cl, we have that the Hamiltonian is conserved. Therefore,
- TLl'xJ+ J(VH(Xl)'S~X)~ lI~xlls
2
, (Xl.) = T~XSVH
Ll x
,
+T~XS~H---2
II~xlls
2
- TLl'xS
Ll
x
2
IVH(xl)'S~X)
IILlxll s \
~H
.
2
T~'xS~H
Ll
x
~x
Ll x - J(x~)(VH(x!), SLl x ) 11~~lls
(24)
.
2
IILlxll s
II~xll~
We claim the following:
(19)
= T~ Ll'xS~x = T~ H
(23)
-T = J(xl)VH(Xl) 2 2
It can be seen easily that the first and the third terms eliminate each other, so we are left with
Ll'xJ+ ~x =
= H(Xk+d - H(Xk) = 0 ,
and Algorithm ALG2 can be written as
.
Claim. If J (X) and H (x) are as specified in Corollary 2 then (V H(Xl), S(xl)Ll x ) = 0 . _
H
2
Since J+ is a skew-symmetric matrix, then the left hand side term is zero. Hence, this implies
2
Proof of Claim. To prove the claim, we consider two cases.
(20)
Case 1: S = J+ J
=I I
which completes the proof of Hamiltonian conservation. _
Using the property (1)- (4) of J and by the fact that Algorithm ALG2 is Hamiltonian conserving, we can write
Remark 3.1. Note that Algorithm ALG2 can further be generalized not only for Hamiltonian conservation, but also to include other conserved quantities, e.g. Casimir functions, by replacing the term H(Xk+d - H(Xk) with
(VH(x~),SLlX )
j
L (Hi (xk+d -
= Ll'xSVH(Xl) 2
(VH(Xl),SLl x )
2
Hi(xk))
(25)
= T(J(Xl)VH(x 1 ))' SV H(Xl) 2 2 2 -T(J(Xl)
,
2:
2
I
~x) SVH(Xl)
IILl x lis (VH(Xl)'S~x) -T 2 Ll'x(J(Xl))'VH(Xl) II~x lis (VH(Xl)' S~x) 2
i=l
where Hi denote the conserved quantities.
_ =
2
2
3.2 Application to systems with quadratic Hamiltonian Motivated by the application of Algorithm ALG 1 to linear systems (Stuart and Humphries, 1996), in this subsection, we focus on applying ALG2 to a subclass of port-controlled Hamiltonian systems with quadratic Hamiltonian, i.e.
H(x) =
~x' Ax 2
= T
aa
H(x) = Ax ,
\la ER.
~'xJ(xl)VH(Xl) .
2
II~xlls
2
2
T Ll'xJ(Xl)VH(Xl) 2 2
~'x (~x + T J(Xl)
(VH(Xl),S~X) 2
=~'x~x+T = ~'x~x
2
II~xlls
2
(21)
x with A a positive definite symmetric matrix, and the matrix J(x) a linear function of x, which satisfies J(ax) := aJ(x),
2
2
From Algorithm ALG2, we have
=
and
2
(VH(xl),S~x) 2
2
IILlx lIs
~x)
~'xJ(Xl)~X 2
.
Hence, we obtain
(22)
IV H(Xl), S~x) = IV H(Xl), SLl x ) Ll'x Llx2
Corollary 2. Suppose A1 and A2 hold. Consider the port-controlled Hamiltonian systems (5), with u = 0, the structure matrix J(x) satisfying (22), and the Hamiltonian H(x) satisfying (21). Then the followings hold.
\
2
\
By the assumption A2, that
970
(VH(X~),S~x) =
2
IILl x
lis
.
~lx~11 =I 1, which implies O.
Case 2: S = J+ J Humphries, 1996))
= / (see also (Stuart and
Hence applying u[ = -cg(x ~)' AXk+1 gives
~H
Substitute S = I and we use the fact that tl H = !X~+l AXk+l - !X~AXk = 0 to obtain
\VH(x~),tlX) = tl'xVH(x~) = (Xk+l - Xk)' A(Xk+1 + Xk)
(26)
•
Therefore, Algorithm ALG2 reduces to
tl
Tx
= J(x!)VH(x!) 111
J(2Xk+1
+ 2Xk)A[2xk+l + 2 Xk ] (27)
1
=
4 J (Xk+l
+ xk)A[Xk+l + Xk]
u[
,
4. STABILIZATION PROBLEM As mentioned earlier, in order to carry out a direct discrete-time controller design we require a 'good' and 'well behaved' discrete-time model of the plant. The result we have presented in the previous section provides the tool to construct the model we need. In this section, we use this tool and consider the stabilization problem for a class of port-controlled Hamiltonian systems.
and the dynamic of the system can be written as .
1
1
/J =
-a, + ~u
a=3(3')'+3 u (29)
'Y = af3 + u . It was shown in Example 2.1 that the system with u = 0 is conservative, and U C = -kg' txH(x) = -k(a + f3 + ')'), for k > 0 is a stabilizing controller for the system (29) (see also (Outbib and Sallet, 1992)). Since (29) satisfies the requirement for Corollary 2, we can apply the implicit midpoint algorithm to obtain its discrete-time model with Hamiltonian conservation when u = O. The discrete-time model of the system is as follows.
Sketch of the proof of Proposition 3: Suppose Xk+l is obtained using the Hamiltonian conserving algorithm ALG2, assuming that u = O. Hence the Hamiltonian difference for the system with u = 0 is tl 11 = O. Without loss of generality, we use the Hamiltonian H as a control Lyapunov function. The Lyapunov difference for the system with control input u[ is then
(Xk+l = (Xk
+
lIT 12T~,B~'Y + 3Tuk lIT
f3k+1 = f3k - 4T~,~o
tl H = X~+l AXk+1 - XkAxk )' A(Xk+l
(27)
Example 4.1 Consider the rigid body given in Example 2.1, with the principal moments of inertia I 1 = 3, /2 = 2, /3 = 1, and the Hamiltonian 1 H = 2(3Q? + 2(32 + ,),2) , (28)
Proposition 3. A discrete-time approximate model obtained by Algorithm ALG2, of the system (5) with the structure matrix J(x) satisfying (22) and the Hamiltonian H(x) satisfying (21), with A > 0, is semiglobally practically stabilized by the discrete-time feedback u = u[ = -Cg(Xl)' AXk+l' where c > 0 and x k+1 denotes Xk+l for the system with u = O. •
= (Xk+l + Tg(x! )u
uk + Tg' Af(xk) ,
=
where u k is the sampled version of a continuoustime stabilizing controller of the system. Some studies show that compared with the control u k' the extra term Tg' Aj(Xk) of u[ works as a compensation that improves the closed-loop response (see (Laila and Nesic, 2003; Warshaw and Schwartz, 1996)). •
which turn out to be the implicit midpoint algorithm, and this completes the proof. •
T
)
Remark 4.1. If X~+l = Xk + Tj(Xk) and g(x) = 9 is a constant vector, we obtain that the discretetime controller u[ takes form
1
=
2
Note that Proposition 3 shows the stabilization of the approximate discrete-time model. Using a similar idea as the one has been used in (Nesic et al., 1999a; Nesic and Teel, 2004), we can relate this to the stability of the exact discrete-time model and the sampled-data systems.
- (Xk)' AXk+l = 0 ,
which proves the claim.
-2cT(Xk+lY Ag(Xl)g(Xl)' AXk+l + O(T 2 2
which shows the system is practically stable. The semiglobal property comes from the fact that T is a function of the set in which the approximate model is defined. •
= (Xk+l)' AXk+l - (Xk)' AXk
+ (xk+d' AXk
::;
')'k+1 = ')'k
+ Tg(x~)u[)
- X~AXk
with
=
tl H+ 2T(Xk+l)' Ag(x!)u[
use
=
+ T 2 (g(x 12 )u[)'g(Xl2 )u[ 2 2T(Xk+1Y Ag(x~ )u[ + O(T )
1
+ 2 Tuk
(30)
T
+ 4T~o~,B + TUk ,
(Xk + (Xk+1, ~,B := f3k + f3k+l and + ')'k+1· Since u[+1 is not known, we
~o :=
~, := ')'k
u[
instead of
!(u[ + U[+l)
in the model.
Now, to design a controller for the system, we consider the case when u 1= 0 and use the Hamiltonian
.
971
as a control Lyapunov function. Since ~ H = 0, then the Hamiltonian difference is obtained as ~H
the Hamiltonian is shown in Figure 2. In the simulation we have used T = O.ls, and X o = (252525)'.
= H(Xk+d - H(Xk) =
It is shown that the midpoint based controller outperforms the emulation controller, in terms of the transient response. Figure 1 shows that the midpoint based controller reduces the oscillation of the states. Further simulations show that this phenomena is consistent for large initial states, while both controllers give very similar response for small initial states.
~H + Tu[(a + (J +,) + T2U[(2-~,8~'Y 12
-
1 4~/'~a
1 ) 2 T 2 + 4~a~,8 + 11 12 T (Uk) .
Applying
UkT
= -2
(
1 1 1 ) a+tJ+,+4T( 12 tJ'-"4,a+ 4 atJ) ,
we obtain that 5. SUMMARY !:i. H
= -2T( 0' + 13 + 7 + 4T( 112137 1
1
)2
(31)
We have presented a preliminary result on stabilization of sampled-data Hamiltonian systems. A numerical algorithm that guarantee Hamiltonian conservation for systems with arbitrary dimension and possibly singular structure matrix has been proposed. With an example, we have shown the usefulness of the algorithm for discrete-time controller design based on Hamiltonian conserving approach. This result gives a strong motivation for further investigation on sampled-data design for Hamiltonian conservative systems.
- 4,a + 4atJ ) + O(T 2 ) Hence the controller u[ stabilizes the discrete-time model in a semiglobal practical sense. 20
(
I
en
..j.
-5'----~----'----'
' . '. .. :
0 ·.i·,· I,:
.
ii Ij'
-10
......... ....::: .
o
I"
I '; ~,
',: ; ..... : .
..
(~.:
10
:7'~:.~----l ,
.
-30'----~-----'
o
6. REFERENCES ISO
Gonzalez, O. (1996). Time integration and discrete Hamiltonian systems. J. Nonlin. Science 6, 449-467. Laila, D. S. and D. Nesic (2003). Changing supply rates for input-output to state stable discretetime nonlinear systems with applications. A utomatica 39, 821-835. Nesic, D., A. R. Teel and E. Sontag (1999a). Formulas relating K£ stability estimates of discrete-time and sampled-data nonlinear systems. Syst. Contr. Lett. 38, 49-60. Nesic, D., A. R. Teel and P. Kokotovic (1999b). Sufficient conditions for stabilization of sampled-data nonlinear systems via discrete-time approximations. Syst. Contr. Lett. 38, 259-270. Nesic, D. and A. R. Teel (2004). A framework for stabilization of nonlinear sampled-data systems based on their approximate discrete-time models. accepted in IEEE Trans. Auto. Contr. Outbib, R. and G. Sallet (1992). Stabilizability of the angular velocity of a rigid body revisited. Syst. Cont. Lett. 18, 93-98. Stuart, A. M. and A. R. Humphries (1996). Dynamical Systems and Numerical Analysis. Cambridge Univ. Press. New York. van der Schaft, A. (2000). L 2 -Gain and Passivity Techniques in Nonlinear Control. Springer. Warshaw, G. D. and H. M. Schwartz (1996). Sampled-data robot adaptive control with stabilizing compensation. The International Journal of Robotic Research 15, 78-91.
-IOO'----~----'----'
o
Figure 1. Response with midpoint based controller u[ (solid line) and emulation controller uk (dashed-dot line).
0'-----1..--=========---..1------1.----1 o Figure 2. Hamiltonian with midpoint based controller u[ (solid line) and emulation controller u k (dashed-dot line). The responses of the closed-loop system when applying the emulation controller (which is obtained via continuous-time design) with k = 2 and the midpoint based controller to control the continuous-time plant are shown in Figure 1 and
972