42
Optimal Control Lecture Prof. Daniela Iacoviello Department of Computer, Control, and Management Engineering Antonio Ruberti Sapienza University of Rome

Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Optimal Control

Lecture

Prof. Daniela Iacoviello

Department of Computer, Control, and Management Engineering Antonio Ruberti

Sapienza University of Rome

Page 2: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

21/11/2016 Controllo nei sistemi biologici

Lecture 1

Pagina 2

Prof. Daniela Iacoviello

Department of computer, control and management

Engineering Antonio Ruberti

Office: A219 Via Ariosto 25

http://www.dis.uniroma1.it/

Prof.Daniela Iacoviello- Optimal Control

Page 3: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Examples taken from Bruni et al. 2005

Prof.Daniela Iacoviello- Optimal Control

Page 4: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Example 1 (exercise 3.3)

Prof.Daniela Iacoviello- Optimal Control

Consider a vehicle of mass m=1 moving along a straight street.

Assume null initial position and velocity.

Indicate with u the force acting on the vehicle having the same

direction of the street.

The aim is to transfer the vehicle to the maximum

distance with final null velocity in a fixed time interval [0, tf],

with a fixed

energy:

ft

Kdttu0

2 0)(

Page 5: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.D.Iacoviello

Optimal Control

Indicate with:

x1(t) the position of the vehicle

x2(t) the velocity of the vehicle

Cost Index

ft

f

Kdttu

txxx

tutx

txtx

0

2

221

2

21

0)(

0)(0)0()0(

)()(

)()(

ft

f dttxtxxJ0

21 )()()(

Page 6: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.D.Iacoviello

Optimal Control

The problem is not convex since the isoperimetric constraint is not

linear

only necessary conditions

Define the Hamiltonian in the normal case:

)()()()()()(),,1,,( 22212 tututtxttxuxH

0)(

)()(20

)(1)(

0)(

)()(

)()(

1

2

12

1

2

21

ft

ttu

tt

t

tutx

txtx

Page 7: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.D.Iacoviello

Optimal Control

)()(20

0)(

)(

)(1)(

0)(

)()(

)()(

2

*

1

12

1

2

21

ttu

txt

tt

t

tutx

txtx

T

ff

u doesn’t have discontinuity points

Ctt

t

)(

0)(

2

1

can’t be zero

22

)()( 2 Ctt

tu

Substitute in the state

equation

Page 8: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.D.Iacoviello

Optimal Control

)()(

)()(

2

21

tutx

txtx

22

)()( 2 Ctt

tu

tCt

tx

tCt

tx

24)(

412)(

3

2

23

1

0)(2 ftx

2

ftC

2

3

0

2

2

0

2

2

4844

1)(

f

t

f

f

tt

dtt

tttdttuK

ff

Page 9: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.D.Iacoviello

Optimal Control

2

3

0

2

2

0

2

2

4844

1)(

f

t

f

f

tt

dtt

tttdttuK

ff

KK

tt ff

34

tt

tu

ttt

tx

ttt

tx

f

f

f

22

1)(

44)(

812)(

3

2

23

1

Kttt

txfff

f3224

)(

3

1

Page 10: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.D.Iacoviello

Optimal Control

No abnormal extremum exists.

In fact: define the Hamiltonian in the abnormal case:

)()()()()(),,1,,( 2221 tututtxtuxH

0)(

)()(20

)()(

0)(

)()(

)()(

1

2

12

1

2

21

ft

ttu

tt

t

tutx

txtx

Ct

t

)(

0)(

2

1

0C

2)(

Ctu

Page 11: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.D.Iacoviello

Optimal Control

2)(

Ctu

tC

tx2

)(2

That is not compatible with 0)(2 ftx

Page 12: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.Daniela Iacoviello- Optimal Control

Consider a vehicle of mass m=1 moving along a straight street.

Assume null initial position and velocity.

Indicate with u the force acting on the vehicle having the same

direction of the street.

Assume NOT fixed the final instant.

The aim is to perform an automatic coupling of a

second vehicle moving with a uniform move

(with velocity v) along the same

street,

assuming as cost index:

ft

f dttutuJ

0

2 )(2

1),(

Example 2- same as example 1 with a change

Page 13: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.D.Iacoviello

Optimal Control

The final instant is not fixed, therefore the problem is not convex.

)()()()()(2

1),,1,,( 221

2 tuttxttuuxH

)()(0

)()(

0)(

2

12

1

ttu

tt

t

0)(

)(),(

2

1

vtx

rvttxttx

f

ff

ff

21

212

11

)(

)(

)(

CtCtu

CtCt

Ct

Page 14: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.D.Iacoviello

Optimal Control

Integrate the state equations

with null initial conditions

vt

H

txt

T

ft

T

ff

f1

*

2

1

*

,,)(

)(

tCt

Ctx

tC

tCtx

2

2

12

2

2

3

11

2)(

26)(

From the transversality conditions and taking into account the

stationarity of the problem:

01 )( Hvt f 2212 CvC

Page 15: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.D.Iacoviello

Optimal Control

0)(

)(),(

2

1

vtx

rvttxttx

f

ff

ff

2212 CvC

vtCv

tC

rvtt

Cv

tC

f

f

f

ff

2

2

22

2

2

3

22

4

212

2

3

1

2

29

2

3

23

r

vC

r

vC

v

rt f

Page 16: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.Daniela Iacoviello- Optimal Control

Consider a vehicle of mass m=1 moving along a straight street.

Assume null initial position and velocity.

Indicate with u the force acting on the vehicle having the same

direction of the street.

Assume NOT fixed the final instant.

The aim is to perform an automatic coupling of a second

vehicle moving with a uniform move (with velocity v) along the

same street,

assuming fixed the energy for the control

and minimizing the cost index: ff ttJ )(

Example 3- same as example 2 with a change

0)(

0

2 Kdttu

ft

Page 17: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.D.Iacoviello

Optimal Control

Define the Hamiltonian in the normal case:

)()()()()(1),,1,,( 2221 tututtxtuxH

)()(20

)()(

0)(

)()(

)()(

2

12

1

2

21

ttu

tt

t

tutx

txtx

212

11

)(

)(

CtCt

Ct

)0()0(1 221 uuCvC 22

)( 21 CtCtu

Page 18: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.D.Iacoviello

Optimal Control

tCtC

tx

tCtC

tx

24)(

412)(

22

12

223

11

vtCt

v

C

v

rvttCt

v

C

v

ff

f

ff

244

1

4124

1

2

2

2222

2

22

2

3222

)0()0(1 221 uuCvC

v

C

vC

4

122

1

Page 19: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.D.Iacoviello

Optimal Control

2

2

2

22

222

2

3222

0

2

444

1

124

1

)(

fff

t

tCtC

v

C

v

t

v

C

v

dttuK

f

vtCt

v

C

v

rvttCt

v

C

v

ff

f

ff

244

1

4124

1

2

2

2222

2

22

2

3222

vtCt

v

C

v

ff

244

1 2

2

2222

Page 20: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

f

ff

t

rvttC 1282

2

2

2

22

222

2

3222

0

2

444

1

124

1

)(

fff

t

tCtC

v

C

v

t

v

C

v

dttuK

f

32232212324212 fffff Ktrvtrvtrvtrvt

Page 21: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

If 1r 85.3ft

26.0

83.1

74.0

2

1

C

C

If 1r 1ft

vtCt

v

C

v

ff

244

1 2

2

2222

f

ff

t

rvttC 1282

The two equations

don’t have solution

1231 KvrAssume

Page 22: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Prof.D.Iacoviello

Optimal Control

Define the Hamiltonian in the abnormal case:

Substituting into the admissibility equations and the isoperimetric

Constraint:

)()()()()(),,1,,( 2221 tututtxtuxH

)0()0( 221 uuCvC v

CC

4

22

1

Ktv

Ct

Ct

v

C

vtC

tv

C

rvttC

tv

C

fff

ff

fff

2

3

32

2

223

42

42

22

2

22

223

2

22

164192

216

448

ft

vC 42

K

vt f

3

4 2

Page 23: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Ktv

Ct

Ct

v

C

vtC

tv

C

rvttC

tv

C

fff

ff

fff

2

3

32

2

223

42

42

22

2

22

223

2

22

164192

216

448

r

vK

9

4 3

Abnormal extremal exist only if

the parameters satisfy this relation.

Page 24: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

If no solution exists 1r

If

there exist infinite

number of abnormal

solutions

1r 1ft 1221 CC

1231 KvrFor the choice

Page 25: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Example 4

Consider a simple model of phamacodynamic:

x1= quantity of drug in the gastrintestinal section

x2= quantity of drug in the blood

r=reference value of the quantity of drug in the blood

u1 flow rate of the drug by oral administration

u2 flow rate of the drug by administered intravenously

Assume

Page 26: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Minimize:

* * *

Solution of the state equation:

Page 27: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Obviously:

x2=x’2 +x’’2

intravenous Gastrintestinal

Page 28: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Since:

Define:

It can be defined the following tracking problem:

0,0,

0,00,

''2

''2

QTTtQtx

QTtQtx

It could be verified that:

Page 29: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

The problem is convex and the Lagrangian is strictly convex

necessary and sufficient conditions and,

if the solution exists, it is unique

By using the theory of optimal tracking:

Page 30: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

where:

Page 31: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

where

If the admissibility condition is satisfied then the couple

Is the unique optimal solution of the subproblem

0)(2 tuo

Page 32: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

To determine Q>0 it is possible to solve another

quadratic problem:

where are suitable affine functions depending

on the Problem; the cost index is strictly convex:

If a solution exists

it is unique and is given by

the condition:

Page 33: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Exercise

Consider the system:

The aim is to have:

with a bounded control

minimizing

)()( tutx 0)0( x

1,1)( ff ttx 1,0)( tu

ft

f dttxtutuJ0

)()(3,

The final instant is not fixed the problem is not convex

The Hamiltonian is:

)()()()(3)(,1),(),( tuttxtuttutxH

Page 34: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

Ctt )(*The costate equation yields

The minimum condition is:

The problem may be analyzed for four different cases:

and the transverality conditions will be particularized:

1,0)(1)()(1)( **** ttttu

Ctsigntu 112

1)(*

Page 35: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

1) . Three alternatives are possible:

1Ca) . From Ctsigntu 11

2

1)(*

01 Ct

0)(* tu 0)(* tx Not possible

b) . There exists a discontinuity instant

for the control with

1,2 C 1,0t

Ct 1

Page 36: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

2C

Not possible

c) . 2C 1,0,01 tforCt

1)(* tu ttx )(*acceptable

In case 1) we have obtained one normal extremum:

1)(* tu ttx )(*1ft

2,)( CCtt

Page 37: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

2) . The transversality condition yields:

1C

01)1(* C

0)(* tu 0)(* tx Not possible

3) . The transversality condition yields:

0** ft

H

1)(,1 ff txt

From the stationarity of the problem:

4C 312

1)(* tsigntu

Page 38: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

AS far as the value of is concerned two alternatives are possible:

i) . From

*ft

3,1* ft 312

1)(* tsigntu

ttx )(*

Not possible

1)(* tu

1)( *** ff ttx

ii) 3* ft

with 3)( * ftx Not possible

Page 39: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

4) . . The transversality condition yields:

0)( *** Ctt ff

1)(,1 ff txt

0)(3 **** ft

txHf

From 312

1)(* tsigntu

There exists an instant of discontinuity

for the control such that:

** ,01 ff ttt

Page 40: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

From the transversality condition: 13)( ** ff ttx

With: 1)( tt

In case 4) we have obtained one normal extremum:

The value of the cost index evaluated at point of case 4) is bigger than the

value of the cost index evaluated at the solution of point found in case 1).

1)(* tu ttx )(*1ft

2,)( CCttThe normal extremum is:

Page 41: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

As far as the abnormal solution is concerned, all the solutions with

must be rejected .

For

0)( ** ft

1)( * ftx 0)(* Ct

0)( * ftxNot acceptable:

1ftNot possible with the

condition

1ftIf one obtains

with:

1)(* tu ttx )(*1ft

0,)( CCt

Page 42: Linear Optimal control - uniroma1.itiacoviel/Materiale/Lezione-applicazione_201… · Prof.Daniela Iacoviello- Optimal Control . Examples taken from Bruni et al. 2005 Prof.Daniela

1)(* tu ttx )(*1ft

The unique possible solution is the extremum

That is both a normal and abnormal solution.