Time Optimality of a Bang-Bang Trajectory with Maple

Time Optimality of a Bang-Bang Trajectory with Maple

IFAG Copyright re IFAC Lagrangian and Hamiltonian Methods for Nonlinear Control, Seville, Spain, 2003 c: 0 C> Publications www.elsevier.com 'Ioca...

545KB Sizes 1 Downloads 43 Views

IFAG

Copyright re IFAC Lagrangian and Hamiltonian Methods for Nonlinear Control, Seville, Spain, 2003

c:

0

C>

Publications www.elsevier.com 'Iocaterifac

TIME OPTIMALITY OF A BANG-BANG TRAJECTORY WITH MAPLE Gianna Stefani· PierLuigi Zezza··

• Dip. di Matematica Applicata. University of Firenze, Italy •• Dip. di Matematica per le Decisioni, University of Fir-enze. Italy

Abstract: 'Ve analyze the time-optimal properties of a bang-bang extremal trajectory of the Van der Pol controlled equation. Our goal is to verify if some general abstract second order conditions obtained by the authors could be verified numerically or formally by the computer algebra system l\Iaple. In this example we are able te obtain a complete description of the structure of the state-local time-optimal state trajectories. Copyright ~ 2003 IFAC Keywords: Computer Algebra. Strong optima. Time Optimality. Bang-bang extremals.

1. INTRODUCTION

well described in (l\laurer and Osmolovskii. 2003). see also (Kaya and Noakes. 2003). (Kaya and Koakes. 1996) and the references therein.

In (Agrachey et al .. 2002). (Poggiolini and Stefani. 2002b) and (Poggiolini and Stefani. 2002a) are stated some abstract second order conditions for time optimality of an extremal bang-bang trajectory. In this note we want to check the possibilit~, of verifying these conditions by using a computer algebra system (:\laple). As a case stud~' we take the following minimum time problem Minimize

Existence. The optimal control exists if belongs to the reachable set from IO .

Since we ,vill state all the conditions with the Hamiltonian formalism let us introduce the control depending Hamiltonian

tf

h : (p. x. u) .........

subject to

PI X2

~1(t)=6(t).

~2 (t) =

(1 - ~l (t)2) 6 (t) -

~(O) = .1'0·

~(tf) =

+ u(t) Xl (~(t»

2

- P2 X2 XI - P2 Xl

+ P2 u.

I

(1 )

Pontryagin maximum principle. sary optimalit~· condition.

IdO l ::; 1. Our controlled differential equation can be written in the abstract form ~(t) = Xo(~(t»

+ P2 X2

here P = (PI. P2) E ll~?' is a row vector while = (XI' .r2) T E 1R 2 is a column.

~I (t) + v(t)

.1'tf

Xt f

n

A neces-

Theorem 1. (Pontryagin). If({ solves the problem (1) then there exist >'0 E {O. I} and a solution ~ of the adjoint equation

(2)

~(t) = -oxh(>.(t). ~(t). D(t)

and it is a Van der Pol oscillator whose specific meaning as a model of a Tunneldiode oscillator is

which satisfy the non triviality condition

135

AO

then A == 0 and H(~(t). A(t)) == 0 and hence this extremal does not satisfy the non triviality condition of the Pontryagin maximum principle.

+ 11 '\(0)11> 0

and the maximality condition h('\(t). ~(t). v(t)) =

max h('\(t). ~(t) . u) = AO.

Remark.

uEI-l.l j

If we consider the switching function a: t

Extremals. An extremal is a couple ({,\) which satisfies the Pontryagin maximum principle. \\'e may have two different types of extremals (1) AO = 1. (2) Ao = O.

+

a(t)

a(t) =1= 0 on the switching surface and hence the

(X2.

(1-

Xj)X2 -

J'l

+ 1) T

X- : =

(X2.

(1-

Xi)X2 -

Xl

_l)T

?

extremals are forced to switch when they cross the hypersurface H+ = H- . In this example. all the extremals will be bang-bang since we have that

u(t) = sgn(a(t)). We have to mention that there is another general regularity assumption. (Agrachev et al .. 2002). that requires the bang-bang extremals to be regular . This condition is trivially satisfied in our case since the control is one-dimensional.

and define H +(p.x) := pX+(x) . H-(p.x) := pH -(x) .

\Vith these notations the maximized Hamiltonian is H: (p.x)

= PI

X2

>---+

1.1 Candidate minimizers

max{H+(p.x) . H-(p.x)} =

+ P2 X2

- P2 X2

xT -

P2 XI

Let us consider a fixed initial point

+ Ip2 1

2

and hence the associated Hamiltonian system is

~(t))

( ~(t )

= H(>.(t).

(0) = --. 5 As it is stated by the maximum principle for a minimum time problem the value of the maximized Hamiltonian along an extremal has to be constant and we can reduce to the following cases. Xl

~(t))

where H=

Abnormal Extremals. Abnormal extremals correspond the zero energy level of the Hamiltonian (Ao = 0) and hence if we evaluate the Hamiltonian at the initial point of the extremal 2 3 ( ex. t3. - 5' '5) we have

which in our example becomes ~I (t) = -2 A2(t) ~I (t) 6(t) .

A2(t) = Al (t) -

+ A2(t) 2 A2(t) + A2(t) 6 (t)

~l (t) = 6(t) ~2(t)

= ~l (t)

= '\(t) [Xo. Xd(~(t)).

then the above condition (3) is equivalent to

normal extremals. abnormal extremals.

=

:

'\(t) Xl (~(t))

and its derivative

Let us consider the two vector fields obtained for u = 1 and u = -1 respectively X

>---+

- 6(t) ~(t):2 - ~I (t)

3

+ sgn(A2(t)).

131 + 5 ex +

Let us remark that the right end side of this differential equation is not continuous. For this reason we have to check if the flow of this Hamiltonian system is well defined and smooth with respect to the initial data.

this equation can be solved with respect to ex obtaining (4)

and hence the abnormal extremals are parametrized b~' 3. 11oreover it is easy to check that

Regularity of the flow. Following (Agrache\' et al.. 2002) the regularity is guaranteed b~' the strengthened Legendre condition dp /l. dq(H+. H-)=I=O

onH'"'=H-

1) 2) 3) 4)

(3)

where dp /I. dq is the canonical two-form in the cotangent bundle. Let check this condition in our example. if in a point (p. x) := (A(f). ~(f)) of an extremal we have that H+ = H- that is

P2

113 125 3 = 0:

The Hamiltonian system is linear in A. The state ~ depends onl~' on the sign of A2' Equation (4) is positively homogeneous in 3. The solution corresponding to .3 = 0 is not an extremal.

Hence .3 =1= 0 and the projection onto the state space of the abnormal extremals generates onl~' two extremal state trajectory the one corresponding to .3 = 1 and the one to 3 = -l.

= 0

and

Let us remark that the switching function is P2 = since H = 0 along the whole abnormal

o and.

dp /l. dq(ii +. Jj-) =p[X+.X-] = 2PI = 0

136

extremal. we must have PI X2 = O. but we have already excluded the possibility of PI and P2 being zero at the same time and hence abnormal state extremals switch when they hit the xl-axis.

extremals are parametrized by 8 we denote these extremals by (>.(-, 3). ~(-. 3 )). To find a candidate optimal solution we solve the optimization problems

~Iinimize

1 1 ~(tf' 8) _ tf > O. 3 El

Let us now use the graphic capabilities of a computer algebra system like 1Iaple by drawing the two abnormal state extremals emanating from the reference point by numerically integrating the four dimensional Hamiltonian s~' stem. The abnormal trajectory starting with X+ follows the field X+ in the upper half plane and the field X - in the lower half. while the other. which starts with X-. has this behaviour only after the first switch. The global behavior is described in Figure 1

PI12

where I is one of the two intervals [0. x) or (-x.O) and if the solution has value zero then it is a candidate to be time-optimal. This search can be easily implemented in a 1Iaple numerical procedure which. for the proposed example. gives two different solutions that are described in Figure 3. To be able to apply the second order conditions to an extremal we need to know its switching times and switching points. once again this can be done numerically with l\laple by finding the zeros of the switching function and the corresponding values of the solution of Hamiltonian system. The numerical data describing these two extremals are in Figure 2.

If we consider the point Q := (-1.9. -0.5) following the same procedures we find only one extremal but with two switches. the numerical data describing these two extremals are in Figure 6.

Fig. 1. Abnormal state extremals and the Hamiltonian field Normal Extremals. Normal extremals correspond the a constant nonzero (>'0 = 1) energy level of the Hamiltonian and hence if we evaluate the Hamiltonian at the initial point of the trajectory (0:.;3, -~. we have

2. SUFFICIENT OPTI1IALITY CONDITIOI"S To check the time-optimality of an extremal trajectory we are going to use the sufficient optimality conditions stated in (Poggiolini and Stefani. 2002b). Under the strengthened Legendre condition and assuming that the reference bangbang extremal is regular the sufficient optimality conditions require the positivity of a finite dimensional quadratic form which is the second variation of the subproblem obtained by moving the switching times of the reference trajectory. These conditions can be stated through the vector fields obtained by the pull-back of the reference ones.

t)

3

IBI + 50: +

113

125 B = 1

this equation can be solved with respect to 0: obtaining

0: =

5

113

5

--1 31 - -75 3 +-3 3

(5)

and hence the normal extremals are parametrized by 3 . Since the value of Hamiltonian is not zero we have a one-parameter family of extremals or better we haw two one-parameter families of extremal for 3 E [0. x) and 3 E (-x. 0) . They correspond to the extremals that start follO\\'ing the field H+ and H- respectively. reall~'

To be more precise: let ({~) be a bang-bang extremal whose switching times are T i. i = 1. 2 . . . . . r and set TO = 0 and 7,.+ I = if. following (Poggiolini and Stefani. 2002 b) denote by Si (:r) the solution at time t of

The switching curve and the reachable set. By numerically integrating the extremal flow we can obtain more information on its structure. In Figure 5 we have drawn some level lines of the minimum time map and some arcs of the s\\'itching curve. namely those corresponding to the first two switches.

~(t)

=

Xo(~(t)) + -D(t) Xl (~(t)).

with initial condition ~(O) = X and define the pullback reference vector fields as odd el'elL Definition 2. Let V be the space of the first order admissible variations of the finite dimensional subproblem. namely

Finding candidates. Let us no\\' consider as our target the point P := (0.2.1)T: recalling that the initial point is fixed and that the normal

137

-

TO

=0

T]

= 0.192

tf

= 0.635

_

TO

=0

T]

= 1.509

tf

= 2.683

Xl

-0.400

-0.2486

0.200

XI

X2

0.600

0.9912

1.000

X2

0.600

-0.4172

1.0000

p] 0.9982

1.008

0.916

PI

0.767

-2.3989

-1.311

P2

0.216 0.10910- 7

Fig. 2. Extremals reaching P

-0.400 -0.64410-

3

P2 -5.647 0.68510- 8

-0.356

0.2000

1.313

= (0.2.1)

----_.. .

.. ... .

-2 ; //,/// '

\\

'"

-' ,----- .------,/ '

,>~/

/

-4 •

Fig. 3. Normal Extremals: the normal extremal starting with X- loses its optimality when selfintersecting r+1

V =

{(cl .... ,cr+d E ]Rr+ l :

L CiYi(~(O)) =

optimality we need the further assumption that the extremal is not self-intersecting.

O}.

;=1

From this approach it follows also that an extremal can loose (x. t f )-optimalit:,-' only at the switching times.

The second variation at the switching points is given by the finite dimensional quadratic form

Let us now use these condition to analyze our example.

r+1 i - I

J" : V

->

]R.

C

f->

L L CiCj~(O) [y,. Yj l (~(O))

Abnormal extremals. The abnormal extremals belong to the level set H = O. they switch on )'2 = O. where X+ and X- are non zero and parallel. In this case we have that J(~. > 0 if the two vector fields have the same direction and J~~ < 0 if they have opposite directions. In our example they haw opposite directions on the x]axis for -1 ::; Xl :s 1 and hence

; =2 J=l

The quoted results state that: Theorem. If either the Yi 's are linearly independent at ~(O) or the second variation at the switching points is positive definite then the reference extremal is locally optimal.

(1) The one starting with X+ is x-time optimal because it crosses the Xl-axis for IXll > 2. (2) The one starting with X - is no longer (x t f)-time optimal after the first switch.

The results concern two different kind of optima

(x. tf )-local optimality w.r.t. a neighborhood of the graph of ~ in ]Rn+l and hence local w.r.t. both state and final time (Agrache\" et al.. 2002).

This behavior is illustrated in Figure 4. Normal extremals. From the abstract results in (Poggiolini and Stefani. 2002a) we deduce that all the normal extremal are always (x. t f)-local optimal up to the second switch but they can loose x-local optimality if they self-intersect. This kind of behavior is illustrated in Figure 3 where we can see two (1.' . t f)-local optimal extremal reaching the point P starting from the same point Xo but only

x-local optimality \V.r.t. a neighborhood of the range of ~ in ]Rn and hence local only w.r.t. the state (Poggiolini and Stefani.2002b). The abo\"e Theorem describes (x. t f)-local optimality of a reference extremal while for x-local

138

M* :=K T • C;.I J e= k

k-l

+ is:r T Ad Tk)

= ( is p =1: I (-:"Ir)

=-dTd ox

)

The algorithm proposed in (Poggiolini and Stefani. 2003) to verify the second order conditions can be implemented as a I\Iaple procedure. Since our example is two dimensional we construct a sequence of non zero vectors M i . i = 0 .... . r starting from

Fig. 4. Abnormal Extremals: the abnormal extremal starting with X- loses its optimality when bouncing against x2-axis

Mo := (Po.O) S.t. Poh(xo)

= O.

We define

the one starting with X+ (which switches at S) is x-local optimal because the other one (which switches at T) is self-intersecting.

:=

Ml

M~

+ Wl K 1 (t 1 )

dp l\ dq(MJ '

s.t.

K2 (id) =0.

From the definition of JP I we have that

Further analysis. It is possible to implement a ?-'Iaple procedure to verify the second order sufficient conditions. For normal extremals this has to be done only from the second switch on. The procedure involves computing the linearization of the Hamiltonian system along the reference trajectory.

dp 1\ dq (M I .

K2 (i d) =

=Po =~I(Tdh(iIl+ +WI dp 1\ dq (K l(iIl. K2( i d) = 0 and we can recover the value of ""'I recalling condition (3). If we set

Denote by tk := (Pk. ik) , k = 1, .... r. the switching points and set iD := (Po , iD) to be the initial point. We denote by

ak :=dpl\dq(Kk(ik ), KHI(£d) we can deduce ""'I

=-

Po=~I(Tdh(id al

the reference vector field and we define

.

In general we define

M" = (Jpk , iSXk) :=M k_1

the associated Hamiltonian. Since Kt. It are piecewise t-constant we denote by K i . I i their values in the interval h - I' Td . By linearization along the reference trajectory we can define

dp 1\ dq (Mlr.

W" = -

(-2~dt)€2(t) - 1 -~1\t)2 )

+ +

B(t) := ~(t)D2 It(~(t)) =

0

= (-~2(t)(2~1(t)~2(t)+1) ~1(t)+~2(t)(1-~I(t)2)) .

Let us consider the Jacobi matrix system

=1: 1(TdIHl (iJ..)+

ak JxJ_ I AdTk) IH I (i'd + ak C,,(t)=,,(Tk)Jxk-l air

+

.

= oisx/; + 3 IdiJ..)

where

The second variation at the switching points is positive definite if and only if

l~(t) = -A(t) A(t) - =(t) T B(t). { =(t) = A(t) =(t).

=kl

Jpk-l

h +l(iJ..)

C(t) := ~(t)D It (~(t)) =

and denote by (Air' conditions

0

Kow we decompose IHdiJ..) with respect to JXk and Idid. we can write

= (-2~2(t)~2(t) -2~I(t)~2(t)) -2~I(t),\2(t)

K HI( i d) =

s.t.

as in the previous ones we get

A(t) := D It(~(t)) =

=

+ WkK di k )

3> O.

the solution with initial

Kt_ is the flow of the Jacobi M = (Jp. Jx)

In our example it is possible to check that the reference trajectory described in Figure 6 is xlocal time-optimal until the third switch. s~'stem

The maple worksheet containing the procedures and the computations will be a\'ailable on request.

and hence for

139

- 1

\.

0,

2,

/

-2

Fig. 5. Levels of the minimum time map and the switching curve

70

=0

71

= 0.06350

72

= 3.11365

tf

= 3.20145

Xl

-0.40000

-0.35800

-1.83907

-1 .90024

.T2

0.60000

0.72358

-0.90483

-0.49998

Pl

1.38056

1.38209

-1.10519

-1.08981

P2

0.09015

0.00000

0.00000

0.10826

Fig. 6. Extremal reaching Q = (-1.9, -0, 5) with two switches REFERENCES Agrachev. Andrey. Gianna Stefani and PierLuigi Zezza (2002) . Strong optimality for a bangbang trajectory. SIAM J Control Optim. 41(4),991- 1014. Kaya. C.Yal<;in and J.Lyle Noakes (1996). Computations and time-optimal controls. Optimal Control Applications and Methods 17(3). 171-185. Kaya. C.Yal<;in and J.Lyle Noakes (2003). Computational method for time-optimal switching control. to appear. :'Ilaurer. Helmut and ~ikolai P. Osmolovskii (2003). Second order sufficient conditions for time optimal bang-bang control problems. SIAM J. ControlOptim. Poggiolini. Laura and Gianna Stefani (2002a). i\linimum time optimality of a bang-bang trajectory. In: Proceedings of the CDC 2002. Poggiolini. Laura and Gianna Stefani (2002b). On the minimum time optimalit~· for a single input control system . In : Proceedings of Con trolo02. Poggiolini. Laura and Gianna Stefani (2003) . State local optimalit~· of a bang-bang trajectory: an Hamiltonian approach.

140