Documente Academic
Documente Profesional
Documente Cultură
DINMICOS
Problema General del Control Optimo continuo
planta
(t ) f (x, u, t )
x
u(t)
x(t)
x (t ) f (x, u, t ), x(to ) xo
to
x(T ), T 0
and
222
to
to
Donde:
h
hx
xh
x
T
223
J x(T ), T T x(T ), T
to
donde
L( x,u, t ) T (t ) f ( x,u, t ) x dt
H (x, u, t ) L( x, u, t ) f ( x, u, t )
T
quedando:-
dJ (x x ) dx (t t )dt
T
( H T x)dt ( H T x)dt
T
to
H xT x H uT u T x ( H x)T dt
to
to
xdt x x T xdt
T
to
to
dx xdt dx xdt
T
Note que:
to
to
T xdt
(T )dT
dx(T ) x(T ) x
to
225
Por lo tanto:
dJ (x Tx )T dx (t Tt H T x T x)dt
T
d ( H x x)dt dx
T
to
to
( H x )T x H uT u ( H x)T dt
to
Para el caso particular cuando to y x(to) son fijas,
dto = 0, dx(to) = 0 dando:-
dJ (x Tx )T dx (t Tt H )dt T d
T
( H x )T x H uT u ( H x)T dt
to
226
(condicin de frontera)
to
x(T ), T 0
228
Controlador Optimo
Hamilton:
H (x, u, t ) L( x, u, t ) T f ( x, u, t )
H
x H
f
T
Ecuacin de estado:
H
Hx
x
T
H
Hu
0
u
Ecuacin de co-estado:
Estacionacionaridad:
Condiciones de Frontera
x(to ) given
(x Tx )T
x(T ), T 0
dx(T ) (t Tt H ) dT 0
T
229
Notas
1. El Control ptimo depende de un problema de valor
frontera de dos puntos.
2. Para problema en horizonte de tiempo finito (i.e. to y T
fijos), dT = 0 y la condicin frontera se convierte:
(x Tx )T
dx(T ) 0
y, ademas , si
y, aun mas, si
(T ) x Tx
no existe,
(T ) x
no existe
(T ) 0.
Ejemplo
min J
u(t )
1
2
T
0
( x 0.25u ) dt
2
s. t. x u, x (0) 1
u(t)
1
s
x(t)
planta
231
Aplicacin de la condiciones de
Opatimalidad
Hamiltoniano:
H 21 ( x 2 0.25u2 ) u
Ecuacin de co-estado:
Estacionaridad:
H x x
Hu 0 0.25u 0 u 4
Condicin de frontrera:
x ( 0) 1
(T ) 0
x, (T ) 0
232
0 4
Donde A
1 0
233
m 4
mI2 A
, mI2 A m2 4 0 m 2
1 m
\1 2, 2 2
2
2
m 4
Adj mI2 A
, e1 , e2
1
1
1 m
Por lo tanto:
x ( t) b 2 2 t b 2 2 t
e
; x ( 0 ) 1, ( T ) 0
1
2 e
( t)
1
1
234
1 2b 1 2b 2
0 b 1e b 2e
2T
2 T
1
1
b1
, b2
4T
4 T
2(1 e )
2(1 e )
Por lo tanto:
x(t )
2 2t
2 2 t
1
1
(t ) 2(1 e 4T ) 1 e 2(1 e 4T ) 1 e
1
1
2t
2t
\ (t )
e
e
4T
4T
2(1 e )
2(1 e )
235
2
2
2t
2 t
u (t ) 4 (t )
e
e
1 e4T
1 e 4 T
1
1
*
2t
2 t
x (t )
e
e
4T
4 T
1 e
1 e
*
u (t ) 2e
*
-2e-2t
u(t)
2 t
x * (t ) e 2 t
1
s
planta
e-2t
x(t)
236
Solucin de Retroalimentacin
Si asumimos:
Entonces:
s( 4 ) sx
4 s x s 4 s 1
x sx
ds
-1
\ 2
4dt 2tanh (2 s) 4t c
s 0.25
2
1
2
237
1
2
planta
-k(t)
ganancia
Nota cuando:
T , k (t ) 2
238
ref = 0
k(t)
ganancia
1
s
planta
x(t)
239
MATLAB results:
optimal control of a single integrator
1
0
u(t)
-1
-2
0
1
0.5
1.5
2.5
3.5
0.5
1.5
2.5
3.5
0.5
1.5
2.5
3.5
0.5
x(t)
0
2
1
k(t)
0
240
Control sub-optimal:
k (t ) 2,
t 0T
0.5
1.5
2.5
3.5
3.5 241
1
Jopt = 0.2533
Jsub_opt = 0.2533
0.5
x(t)
0
0.5
1.5
2
t
2.5
0.2
0.4
0.6
0.8
1
Jopt = 0.2442
Jsub_opt = 0.2487
0.5
x(t)
0
0.2
0.4
0.6
t
0.8
242
MATLAB Demo
243
Donde Q y S(T) son mat. Def. positivas, R es mat. def. positiva; Q, S(T)
y R son todas simtricas, T es fijo. Deseamos encontrar u*(t) en [0,T]
para minimizar J.
Hamiltoniano: H 12 ( xT Qx uT Ru ) T ( Ax Bu )
H x Qx AT
Ecuacin de co-estado:
Estacionaridad:
Hu 0
Ru B T 0
u R 1B T
Condiciones de Frontera:
x(0) x o
(x )T
dx(T ) 0
(T ) S(T ) x(T )
244
x Ax BR B , x(0) xo
Qx A ,
T
(T ) S(T )x(T )
x A
Q
BR B x
T
A
1
Matriz de Hamilton
245
Solucin de retroalimentacin:
x Ax BR B Sx (A BR B S)x
T
Sx Sx Sx S( A BR B S)x Qx A Sx
T
246
-x(t)
K(t)
u(t)
K ( t ) R 1B TS( t )
x Ax Bu
x(t)
controlador
dependiente del tiempo
planta
247
Cuando T
A S SA SBR B S Q 0 S
T
K R B S
248
r=0
+
-x(t)
u(t)
x Ax Bu
x(t)
controller
time-invariant
plant
249
Ejemplo
min J
u(t )
1
2
( x12 u 2 ) dt
s. t. x1 x 2 , x1 ( 0 ) 1
x 2 u , x 2 ( 0 ) 0
Aqui:
1
s
x2
1
s
x1
0 1
0
1 0
A
, B , Q
, R 1
0 0
1
0 0
250
s s 0 0
s
s
1
0
s
s
12 22
12 22 12 22
s11
s12
s s 2 1,
11
12
s12
0
s22
1
0 1
s 11 ( T ) 0
s12
s11
s s s s , s ( T ) 0
12
11
12 22
12
s
22
2 s s2 ,
12
22
s22 0
s12
0
0
s ( t ), s ( t ), s ( t)
11
12
22
s 22 ( T ) 0
KR B S
T
quedando:
s11 s12
251
u Kx k1 (t ) x1 (t ) k2 (t ) x2 (t )
k2(t)
ref = 0
k1(t)
1
s
x2
1
s
x1
252
s22
s12
s11
S(t)
0.5
4
t
Kalman Gain, T = 8
1.5
k2
1
k1
K(t)
0.5
253
0
4
t
K s12
s22
k1 1, k2 2
254
2
-
ref = 0
1
+
1
s
x2
1
s
x1
255
0.5
x(t)
0
x2(t)
-0.5
0
0.5
0
u(t)
-0.5
-1
0
opt
sub_opt
4
t
= 0.7119
= 0.7119
256
0.5
1.5
2.5
3.5
0.5
0
u(t)
Jopt = 0.695
-0.5
-1
0
Jsub_opt = 0.7095
0.5
1.5
2
t
2.5
3.5
257
Matriz de Hamilton:
1 T
A
BR B
H
Q
AT
0
0
1
0
1 0 0
0 0 1
0 0 0
0 1 0
0.7071 j 0.7071
0.7071 j 0.7071
simplctica
258
-0.6
-0.4
-0.2
0
0.2
Real Axis
0.4
0.6
0.8
259
0 1 0
A c A BK
1
0 0 1
1
0
2
1 2
2 j 2
I 2 A c 2 1 0
2
2
260
261
Ejemplo
A=[0 1;0 0];B=[0;1];
Q=[1 0;0 0];R=[1];
[K,S,E ]=lqr (A,B,Q,R)
Obteniendo:
K =
1.0000
1.4142
S =
1.4142
1.0000
1.0000
1.4142
E = -0.7071 + 0.7071i
-0.7071 - 0.7071i
MATLAB Demo
263
u(t ) U , e.g. ai ui (t ) bi
(bounds)
to
264
H (x* , u* , * , t ) H (x* , u, * , t )
Para todo control admisible
denotan los valores optimos.
u(t ) donde
U, *
L.S. Pontryagin
Restricciones de los
estados finales:
x(T ), T 0
266
Controlador Optimo
H ( x, u, , t ) L( x, u, t ) T f ( x, u, t )
Hamiltoniano:
H
x H
f
T
Ec. de estado:
H
Hx
Ec. de Co-estado:
Optimalidad:
H (x* , u* , * , t ) H ( x* , u, * , t ) , u* U
Condiciones de frontera:
x(to ) given
(x Tx )T
x(T ), T 0
dx(T ) (t Tt H ) dT 0
T
267
Ejemplo
min
{J dt }
T
s. t. x 1 x 2 , x 1 ( 0 ) x 10
x 2 u ,
x 2 ( 0 ) x 20
u(t ) 1
x1 ( T ) 0
x2 (T ) 0
+1
-1
1
s
x2
x1
1
s
H 1 1x2 2u
H 0
1
x
Ec. de Co-estado :
H
2
x
1
Hamiltoniano:
268
Condiciones de Frontera:
x1 ( 0) x10 , x1 ( T ) 0
x2 ( 0) x20 , x2 ( T ) 0
( x Tx ) T dx(T ) ( t Tt H ) dT 0
T
H ( T ) 0 1 1 ( T ) x2 ( T ) 2 ( T ) u ( T ) 0
2 (T )u(T ) 1
Condicin de Optimalidad: Para minimizar H requerimos 2u
sea tan pequeo como sea posible:
1 u 1. Por lo tanto, si 2 es (+), , use u= -1; si 2 es (-)
use u = +1. El control Optimal es:
u (t ) sgn2 (t )
*
269
1 0
1 (t ) constant = c1
2 1 2 (t ) c1t c2
u (t ) sgnel
)
Control Optimo: Desde
ptimo
2 (tcontrol
es uno de las cuatro opciones, dependiendo de la condicin
inicial particular.
*
270
x1 x2 , x1 ( 0) x10
x2 u , x2 ( 0) x20 , u 1
Por lo tanto:
dx2 u
x22 x202
x2dx2 u. dx1
u( x1 x10 )
dx1 x2
2
La cual es la ecuacin de una parbola pasando atravs de
(x10,x20). Por lo tanto, el plano de fase seria una familia de
parbolas, una para cada condicin inicial.
271
u = +1
5
0
x2
-5
-5
0
u = -1
0
x2
-5
-5
0
x1
272
switching curve
u=+1
5
4
3
2
1
0
x2
x10,x20
u=+1
-1
u=-1
-2
switching
curve
-3
-4
u=-1
-5
-5
0
x1
273
x1 21 x2 x2
274
u
1
Ley de retroalimentacin
if x1 12 x2 x2
or if x1 12 x2 x2 and x1 0
if x1 12 x2 x2
or if x1 12 x2 x2 and x1 0
+1
-1
1
s
x2
1
s
x1
275
start 1
x2
T = 6.324
-1
-2
-3
-4
-5
-15
start 2
-10
-5
0
x1
10
276
15
2
0
x2 -2
-4
0
1
0
-1
0
277
10
12
10
12
6
t
10
0
x2
-5
0
1
0
-1
0
278
12
MATLAB Demo
279