Optimal Control of An Oscillator System
Optimal Control of An Oscillator System
Optimal Control of An Oscillator System
J.C.C. Henriques
2015/02/06
Optimal control
1.1
Problem statement
Let x(t ) the state of the system with input u(t ) that satisfies the state equation [1]
= F (x, u) ,
x
(1)
x (0) = x0
(2)
uU
(3)
t [0, T ]
(4)
with
L (u, x) dt
(5)
where
xT = x (T ) .
(6)
(xT ) is the cost associated with the terminal state xT . The Lagrangian L (u, x) is the function to
be maximized in [0, T ].
1.2
Along optimal path for (x, u, (t )) it is verified the following necessary conditions for maximizing J
= F (x, u) ,
x
with
x (0) = x0
uU
t [0, T ]
(7)
= T F (x, u) + L (x, u)
(8)
and
(9)
(10)
is maximum for the optimal input u. If the maximum is for an u in the interior of U then
H
= 0.
ui
(11)
In the case that the optimum is in the boundary of U then Eq. (11) does not apply.
Oscillator system
Let as consider a simple oscillator system comprising a spring, k, a energy extraction damper,c,
and control damper, G, with damping as function of, u, see Fig. 1. The equation that describes the
motion of this system is
m z + c z + g u z + k z = f cos(t )
(12)
where the dot denotes time derivative, m is the block mass, f and are the modulus are angular
frequency of the external force. The initial conditions are z(0) = z0 and z(0) = v0 .
The extracted energy, e, can be computed using the instantaneous power of the damper c which
is given by
e = c z2 .
(13)
(14)
T
T
x = v z e = x1 x2 x3 ,
(15)
defining
Figure 1: Oscillating system with spring, k, energy extraction damper,c, and control damper, g .
and
F1
( f cos(t ) c x1 g u x1 k x2 ) /m
,
F (x, u) =
x1
F2 =
2
F3
c x1
(16)
T
x0 = v0 z0 0 .
(17)
(18)
F =
F1
x1
F2
x
1
F3
x1
F1
x2
F2
x2
F3
x2
F1
x3
F2
x3
F3
x3
(19)
(c + g u) /m k/m 0
0
,
2c x1
(20)
resulting in
1
1 (c + g u) /m + 2 + 23 c x1
=
.
1 k/m
2
3
0
The final condition of is (T ) = (T ), giving
1 (T )
x1
(T ) =
x
2
3 (T )
x
3
x = xT
=
0 .
1
(21)
(22)
( f cos(t ) c x1 g u x1 k x2 ) /m
x1
H (x, u, ) = T F = 1 2 3
c x12
(23)
= 1 ( f cos(t ) c x1 g u x1 k x2 ) /m + 2 x1 + 3 c x12
is maximum for the optimal input u. The conditions to maximize H are
u(t ) =
1,
if (1 (t )x1 (t )) 0
0,
otherwise
(24)
T [
x F (x, u)] dt .
(25)
The vector is introduced so J is optimal and satisfies the system of ordinary differential equations (1) for all t [0, T ]. In other words,
T
T [
x F (x, u)] dt ,
(26)
is a J constraint that is zero for the optimal solution1 . The vector is called co-state. Introducing
Eq. (5) in Eq. (28) we get
J = (xT ) +
L (u, x) dt
= (xT ) +
T [
x F (x, u)] dt
0
T
L (u, x) + F (x, u) dt
T
0
1
(27)
T
dt .
x
(28)
we get
J = (xT ) +
H (u, x, ) dt
dt .
T x
(29)
Let us assume that uopt is the function which maximizes then functional J then a small perturbation u results in a decrease of J . The system will follow another path x + x and the variation
of the objective function is negative
J = J (x + x, v) J x, uopt < 0,
(30)
[H (v, x + x, ) H (u, x, )] dt
T
x dt .
(31)
x dt = (T ) x (T ) (0) x (0)
T
x dt
(32)
Since the optimal control does not change x (0) we have x (0). As a result,
J = (xT + xT ) (xT ) T (T ) x (T )
ZT
Z
+
[H (v, x + x, ) H (u, x, )] dt +
0
T
x dt .
(33)
(34)
(35)
and
J = (xT ) (T ) x (T ) +
i
T
H (u, x, ) + x dt
(36)
[H (v, x, ) H (u, x, )] dt .
We can choose
T
= H (u, x, ) ,
(37)
satisfying
T (T ) = (xT ) ,
(38)
to assure that the first term of the right-hand-side of Eq. (36) is zero. This results in
J =
[H (v, x, ) H (u, x, )] dt .
(39)
The states x and co-states are computed for uopt and independently of v. If uopt is the optimum
then
H uopt , x, H (v, x, )
(40)
(41)
Since H is a continuous function, there is an interval [t1 , t1 + ] where this inequality holds.
Let w = uopt except in this interval. Using this choice, the variation is
J =
t1 +
H (w (t ) , x (t ) , (t )) H uopt (t ) , x (t ) , (t ) dt > 0
t1
However, this contradicts the hypothesis that uopt is the optimal control.
References
[1] J. L. M. Lemos, Lectures on Optimal Control, Instituto Superior Tcnico, 2012.
(42)