Calculus of Variations and Optimal Control: Continuous Systems
Calculus of Variations and Optimal Control: Continuous Systems
Optimal Control:
Continuous Systems
(various problem conditions)
x(0) & t
f
given
t
f
given, x(0) & x(t
f
) [partly] given
t
f
unconstrained, x(0), x(t
f
) [partly] given (example: min time)
Given:
t
f
t
0
t
f
x
t
f
t
f
x
0
x(t) = f (x(t), u(t), t) x(t
0
) given t [t
0
, t
f
]
u
J = (x(t
f
), t
f
) +
t
f
t
0
L(x(t), u(t), t) dt
J
J
A
= (x(t
f
), t
f
) +
t
f
t
0
L(x(t), u(t), t) dt +
t
f
t
0
T
(t) [f (x(t), u(t), t) x(t)] dt
(1)
1
x
t
f
t
f
x
0
t
f
t
0
t
f
.minimun jerk
t
f
t
0
t
f
x
t
f
t
f
x
0
x(t) = f (x(t), u(t), t) x(t
0
) given t [t
0
, t
f
]
u
J = (x(t
f
), t
f
) +
t
f
t
0
L(x(t), u(t), t) dt
J
J
A
= (x(t
f
), t
f
) +
t
f
t
0
L(x(t), u(t), t) dt +
t
f
t
0
T
(t) [f (x(t), u(t), t) x(t)] dt
(1)
1
x
t
f
t
f
x
0
t
f
t
0
t
f
.minimun jerk
t
f
t
0
t
f
x
t
f
t
f
x
0
x(t) = f (x(t), u(t), t) x(t
0
) given t [t
0
, t
f
]
u
J = (x(t
f
), t
f
) +
t
f
t
0
L(x(t), u(t), t) dt
J
J
A
= (x(t
f
), t
f
) +
t
f
t
0
L(x(t), u(t), t) dt +
t
f
t
0
T
(t) [f (x(t), u(t), t) x(t)] dt
(1)
1
Define a Hamiltonian
t
f
t
0
L(x(t), u(t), t) dt +
t
f
t
0
T
(t) [f (x(t), u(t), t) x(t)] dt
(1)
H = H(x(t), u(t), t) = L(x(t), u(t), t) +
T
(t)f (x(t), u(t), t)
T
(t) x(t)
J = (x(t
f
), t
f
)
T
(t
f
) x(t
f
)+
T
(t
0
) x(t
0
)+
t
f
t
0
H(x(t), u(t), t) +
T
x(t)
dt
(2)
J J
J =
t=t
f
+ [
T
x]
t=t
0
+
t
f
t
0
H
x
+
x +
H
u
u
dt
(3)
J
(t) x(u(1 : t))
T
(t
f
) =
x(t
f
)
,
T
(t) =
H(t)
x(t)
=
L
x
T
(t)
f
x
t
f
J =
T
(t
0
)x(t
0
) +
t
f
t
0
H
u
udt
x(t
0
) = 0 x(0)
u
H
u
= 0 , t [t
0
, t
f
]
x(t) = f (x(t), u(t), t)
T
(t) =
L
x
T
(t)
f
x
(4)
T
(t
f
) =
x(t
f
)
(5)
H
u
= 0 (6)
x
0
given
x u
x
two point boundary-value problem
2
H = H(x(t), u(t), t) = L(x(t), u(t), t) +
T
(t)f (x(t), u(t), t)
T
(t) x(t)
J = (x(t
f
), t
f
)
T
(t
f
) x(t
f
)+
T
(t
0
) x(t
0
)+
t
f
t
0
H(x(t), u(t), t) +
T
x(t)
dt
(2)
J J
J =
t=t
f
+ [
T
x]
t=t
0
+
t
f
t
0
H
x
+
x +
H
u
u
dt
(3)
J
(t) x(u(1 : t))
T
(t
f
) =
x(t
f
)
,
T
(t) =
H(t)
x(t)
=
L
x
T
(t)
f
x
t
f
J =
T
(t
0
)x(t
0
) +
t
f
t
0
H
u
udt
x(t
0
) = 0 x(0)
u
H
u
= 0 , t [t
0
, t
f
]
x(t) = f (x(t), u(t), t)
T
(t) =
L
x
T
(t)
f
x
(4)
T
(t
f
) =
x(t
f
)
(5)
H
u
= 0 (6)
x
0
given
x u
x
two point boundary-value problem
2
H = H(x(t), u(t), t) = L(x(t), u(t), t) +
T
(t)f (x(t), u(t), t)
T
(t) x(t)
J = (x(t
f
), t
f
)
T
(t
f
) x(t
f
)+
T
(t
0
) x(t
0
)+
t
f
t
0
H(x(t), u(t), t) +
T
x(t)
dt
(2)
J J
J =
t=t
f
+ [
T
x]
t=t
0
+
t
f
t
0
H
x
+
x +
H
u
u
dt
(3)
J
(t) x(u(1 : t))
T
(t
f
) =
x(t
f
)
,
T
(t) =
H(t)
x(t)
=
L
x
T
(t)
f
x
t
f
J =
T
(t
0
)x(t
0
) +
t
f
t
0
H
u
udt
x(t
0
) = 0 x(0)
u
H
u
= 0 , t [t
0
, t
f
]
x(t) = f (x(t), u(t), t)
T
(t) =
L
x
T
(t)
f
x
(4)
T
(t
f
) =
x(t
f
)
(5)
H
u
= 0 (6)
x
0
given
x u
x
two point boundary-value problem
2
H = H(x(t), u(t), t) = L(x(t), u(t), t) +
T
(t)f (x(t), u(t), t)
T
(t) x(t)
J = (x(t
f
), t
f
)
T
(t
f
) x(t
f
)+
T
(t
0
) x(t
0
)+
t
f
t
0
H(x(t), u(t), t) +
T
x(t)
dt
(2)
J J
J =
t=t
f
+ [
T
x]
t=t
0
+
t
f
t
0
H
x
+
x +
H
u
u
dt
(3)
J
(t) x(u(1 : t))
T
(t
f
) =
x(t
f
)
,
T
(t) =
H(t)
x(t)
=
L
x
T
(t)
f
x
t
f
J =
T
(t
0
)x(t
0
) +
t
f
t
0
H
u
udt
x(t
0
) = 0 x(0)
u
H
u
= 0 , t [t
0
, t
f
]
x(t) = f (x(t), u(t), t)
T
(t) =
L
x
T
(t)
f
x
(4)
T
(t
f
) =
x(t
f
)
(5)
H
u
= 0 (6)
x
0
given
x u
x
two point boundary-value problem
2
T
(t) x(t)
J = (x(t
f
), t
f
)
T
(t
f
) x(t
f
)+
T
(t
0
) x(t
0
)+
t
f
t
0
H(x(t), u(t), t) +
T
x(t)
dt
(2)
J J
J =
t=t
f
+ [
T
x]
t=t
0
+
t
f
t
0
H
x
+
x +
H
u
u
dt
(3)
J
(t) x(u(1 : t))
T
(t
f
) =
x(t
f
)
,
T
(t) =
H(t)
x(t)
=
L
x
T
(t)
f
x
t
f
J =
T
(t
0
)x(t
0
) +
t
f
t
0
H
u
udt
x(t
0
) = 0 x(0)
u
H
u
= 0 , t [t
0
, t
f
]
x(t) = f (x(t), u(t), t)
T
(t) =
L
x
T
(t)
f
x
(4)
T
(t
f
) =
x(t
f
)
(5)
H
u
= 0 (6)
x
0
given
x u
x
two point boundary-value problem
2
J =
t=t
f
+ [
T
x]
t=t
0
+
t
f
t
0
H
x
+
x +
H
u
u
dt
On the extremal path both terms zero out, meaning that H(t) = constant
5
Continuous Time LQR
Given x(0), t
f
and a linear system:
Find a path that brings (some of) x close to zero without allowing it to
vary to much on the way and without too much control energy. I.e. find u
that minimizes
where S,Q and R are positive definite.
Note: this can easily be generalized to time varying systems and costs.
The Hamiltonian is
s diff. eq. is
One can show (see Bryson & Ho, sec. 5.2) that there exists a time
varying matrix S(t) that provides a linear relation between and x
Plugging this into the above state dynamics gives
i.e. is a linear state feedback. Similarly to the
discrete case, to know the control rule we simply need to find S(t).
Next we plug () into the above equation and after a bit of rearranging
get
S
is good for regulating the system for a long duration (i.e. forever).
Since this differential equation is quadratic, it may have more than one
solution. The desired solution is PSD. Starting from S=0 (instead of
S=S
f
) and numerically integrating until convergence (i.e. till )
will give the PSD solution (see Bryson & Ho, sec. 5.4).
We will see (in a future lecture) that the HJB equations show that
J=x
T
(t
0
)S(t
0
)x
T
(t
0
). (This is also true for the discrete case, were we used
the notation P instead of S).
9
t
f
given , x(0) & x(t
f
) partly or
fully given
Suppose x
k
(t
f
)
is given, then x
k
(t
f
) = 0 and therefore we do not require
in order to zero out the variation
Similarly, if x
k
(t
0
) is not given, then x
k
(t
0
) 0 and to zero out J we
require that
Sx +S x = Qx ASx
S +SA+A
T
S SBR
1
B
T
S +A
x = 0
x(t) = 0
S = SAA
T
S +SBR
1
B
T
S A
S(t
f
) = S
f
S
Riccati
S(t)
S S
S Matlab care t
f
S = 0 PSD S
Bryson&Ho p.
S 0
167-8
t
f
t
0
t
f
J
J =
x
T
t=t
f
+ [
T
x]
t=t
0
+
t
f
t
0
H
x
+
x +
H
u
u
dt
(13)
4
x
k
(t
f
)
x
k
(t
f
) = 0
x
k
(t
f
)
T
k
= 0
x
k
(t
0
) t
f
J = 0 x
k
(t
0
) = 0
k
(t
0
) = 0
J x
k
(t
0
)
H
u
= 0
controllable
x(t) = f (x(t), u(t), t) (14)
T
(t) =
H
x
=
L
x
T
(t)
f
x
(15)
T
k
(t
f
) =
x
k
(t
f
)
or x
k
(t
f
) given (16)
H
u
= 0 (17)
k
k
(0) = 0 or x
k
(0) given (18)
x
k
(t
f
)
x
k
(t
f
) = 0
x
k
(t
f
)
T
k
= 0
x
k
(t
0
) t
f
J = 0 x
k
(t
0
) = 0
k
(t
0
) = 0
J x
k
(t
0
)
H
u
= 0
controllable
x(t) = f (x(t), u(t), t) (14)
T
(t) =
H
x
=
L
x
T
(t)
f
x
(15)
T
k
(t
f
) =
x
k
(t
f
)
or x
k
(t
f
) given (16)
H
u
= 0 (17)
k
k
(0) = 0 or x
k
(0) given (18)
x
k
(t
f
)
T
k
= 0
x
k
(t
0
) t
f
J = 0 x
k
(t
0
) = 0
k
(t
0
) = 0
J x
k
(t
0
)
H
u
= 0
controllable
x(t) = f (x(t), u(t), t) (14)
T
(t) =
H
x
=
L
x
T
(t)
f
x
(15)
T
k
(t
f
) =
x
k
(t
f
)
or x
k
(t
f
) given (16)
H
u
= 0 (17)
k
k
(0) = 0 or x
k
(0) given (18)
Find a path x(t), starting at rest (zero velocity & acceleration) from x
0
at
time t
0
and ending at rest at x
f
at time t
f
so that the squared cumulative
change in acceleration (jerk) along the path is minimal.
We solve for the one dimensional (scalar position) case but solution
holds for the multidimensional case as well.
12
Minimum Jerk
minimum jerk
t
0
x
f
x
0
x(t)
x
f
t
f
x
0
L = u(t) = a [x, v, a]
= 0
1
2
t
f
t
0
u
2
(t)dt
f
1
= x = v
f
2
= v = a
f
3
= a = u
f
x
=
0 1 0
0 0 1
0 0 0
L
x
L
x
=
0
0
0
f
u
f
u
=
0
0
1
1
,
2
,
3
]
T
=
(t) =
L
x
T
(t)
f
x
= 0[
1
,
2
,
3
]
0 1 0
0 0 1
0 0 0
= [0,
1
,
2
]
1
= c
1
2
= c
1
t + c
2
3
=
1
2
c
1
t
2
c
2
t + c
3
6
minimum jerk
t
0
x
f
x
0
x(t)
x
f
t
f
x
0
u(t) = a [x, v, a]
J =
1
2
t
f
t
0
u
2
(t)dt
= 0 L =
1
2
u
2
f
1
= x = v
f
2
= v = a
f
3
= a = u
f
x
=
0 1 0
0 0 1
0 0 0
L
x
L
x
=
0
0
0
f
u
f
u
=
0
0
1
1
,
2
,
3
]
T
=
(t) =
L
x
T
(t)
f
x
= 0[
1
,
2
,
3
]
0 1 0
0 0 1
0 0 0
= [0,
1
,
2
]
1
= c
1
2
= c
1
t + c
2
3
=
1
2
c
1
t
2
c
2
t + c
3
6
minimum jerk
t
0
x
f
x
0
x(t)
x
f
t
f
x
0
u(t) = a [x, v, a]
J =
1
2
t
f
t
0
u
2
(t)dt
= 0 L =
1
2
u
2
f
1
= x = v
f
2
= v = a
f
3
= a = u
f
x
=
0 1 0
0 0 1
0 0 0
L
x
L
x
=
0
0
0
f
u
f
u
=
0
0
1
1
,
2
,
3
]
T
=
(t) =
L
x
T
(t)
f
x
= 0[
1
,
2
,
3
]
0 1 0
0 0 1
0 0 0
= [0,
1
,
2
]
1
= c
1
2
= c
1
t + c
2
3
=
1
2
c
1
t
2
c
2
t + c
3
6
and (remembering )
so, by we get
13
x
k
(t
f
)
x
k
(t
f
) = 0
x
k
(t
f
)
T
k
= 0
x
k
(t
0
) t
f
J = 0 x
k
(t
0
) = 0
k
(t
0
) = 0
J x
k
(t
0
)
H
u
= 0
controllable
x(t) = f (x(t), u(t), t) (14)
T
(t) =
H
x
=
L
x
T
(t)
f
x
(15)
T
k
(t
f
) =
x
k
(t
f
)
or x
k
(t
f
) given (16)
H
u
= 0 (17)
k
k
(0) = 0 or x
k
(0) given (18)
minimum jerk
t
0
x
f
x
0
x(t)
x
f
t
f
x
0
u(t) = a [x, v, a]
J =
1
2
t
f
t
0
u
2
(t)dt
= 0 L =
1
2
u
2
f
1
= x = v
f
2
= v = a
f
3
= a = u
f
x
=
0 1 0
0 0 1
0 0 0
L
x
L
x
=
0
0
0
f
u
f
u
=
0
0
1
1
,
2
,
3
]
T
=
(t) =
L
x
T
(t)
f
x
= 0[
1
,
2
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k
(t
f
)
T
k
= 0
x
k
(t
0
) t
f
J = 0 x
k
(t
0
) = 0
k
(t
0
) = 0
J x
k
(t
0
)
H
u
= 0
controllable
x(t) = f (x(t), u(t), t) (14)
T
(t) =
H
x
=
L
x
T
(t)
f
x
(15)
T
k
(t
f
) =
x
k
(t
f
)
or x
k
(t
f
) given (16)
H
u
= 0 (17)
k
k
(0) = 0 or x
k
(0) given (18)
minimum jerk
t
0
x
f
x
0
x(t)
x
f
t
f
x
0
u(t) = a [x, v, a]
J =
1
2
t
f
t
0
u
2
(t)dt
= 0 L =
1
2
u
2
f
1
= x = v
f
2
= v = a
f
3
= a = u
f
x
=
0 1 0
0 0 1
0 0 0
L
x
L
x
=
0
0
0
f
u
f
u
=
0
0
1
T
(t) =
L
x
T
(t)
f
x
= 0 [
1
,
2
,
3
]
0 1 0
0 0 1
0 0 0
1
,
2
,
3
]
T
= [0,
1
,
2
]
6
minimum jerk
t
0
x
f
x
0
x(t)
x
f
t
f
x
0
u(t) = a [x, v, a]
J =
1
2
t
f
t
0
u
2
(t)dt
= 0 L =
1
2
u
2
f
1
= x = v
f
2
= v = a
f
3
= a = u
f
x
=
0 1 0
0 0 1
0 0 0
L
x
L
x
=
0
0
0
f
u
f
u
=
0
0
1
T
(t) =
L
x
T
(t)
f
x
= 0 [
1
,
2
,
3
]
0 1 0
0 0 1
0 0 0
1
,
2
,
3
]
T
= [0,
1
,
2
]
6
minimum jerk
t
0
x
f
x
0
x(t)
x
f
t
f
x
0
u(t) = a [x, v, a]
J =
1
2
t
f
t
0
u
2
(t)dt
= 0 L =
1
2
u
2
f
1
= x = v
f
2
= v = a
f
3
= a = u
f
x
=
0 1 0
0 0 1
0 0 0
L
x
L
x
=
0
0
0
f
u
f
u
=
0
0
1
1
,
2
,
3
]
T
=
(t) =
L
x
T
(t)
f
x
= 0[
1
,
2
,
3
]
0 1 0
0 0 1
0 0 0
= [0,
1
,
2
]
1
= c
1
2
= c
1
t + c
2
3
=
1
2
c
1
t
2
c
2
t + c
3
6
The Hamiltonian ( H = L+
T
f ) is
so
14
minimum jerk
t
0
x
f
x
0
x(t)
x
f
t
f
x
0
u(t) = a [x, v, a]
J =
1
2
t
f
t
0
u
2
(t)dt
= 0 L =
1
2
u
2
f
1
= x = v
f
2
= v = a
f
3
= a = u
f
x
=
0 1 0
0 0 1
0 0 0
L
x
L
x
=
0
0
0
f
u
f
u
=
0
0
1
1
,
2
,
3
]
T
=
(t) =
L
x
T
(t)
f
x
= 0[
1
,
2
,
3
]
0 1 0
0 0 1
0 0 0
= [0,
1
,
2
]
1
= c
1
2
= c
1
t + c
2
3
=
1
2
c
1
t
2
c
2
t + c
3
6
[
1
,
2
,
3
]
T
= [0,
1
,
2
]
1
= c
1
2
= c
1
t + c
2
3
=
1
2
c
1
t
2
c
2
t + c
3
H = u
2
(t) +
T
f
=
1
2
u
2
(t) +
1
v +
2
a +
3
u
H
u
= 0
0 = u +
3
u =
1
2
c
1
t
2
+ c
2
t c
3
a = u
a =
1
6
c
1
t
3
+
1
2
c
2
t
2
c
3
t + c
4
v = a
v =
1
24
c
1
t
4
+
1
6
c
2
t
3
1
2
c
3
t
2
+ c
4
t + c
5
x = v
x =
1
120
c
1
t
5
+
1
24
c
2
t
4
1
6
c
3
t
3
+
1
2
c
4
t
2
+ c
5
t + c
6
c
6
= x
0
c
4
= c
5
= 0 x(0) = x
0
v(0) = a(0) = 0
a =
1
6
c
1
t
3
+
1
2
c
2
t
2
c
3
t
v =
1
24
c
1
t
4
+
1
6
c
2
t
3
1
2
c
3
t
2
x =
1
120
c
1
t
5
+
1
24
c
2
t
4
1
6
c
3
t
3
+ x
0
t
f
x(t
f
) = x
f
v(t
f
) = a(t
f
) = 0
0
0
x
f
x
0
1
6
t
3
f
1
2
t
2
f
t
f
1
24
t
4
f
1
6
t
3
f
1
2
t
2
f
1
120
t
5
f
1
24
t
4
f
1
6
t
3
f
c
1
c
2
c
3
1
= c
1
2
= c
1
t + c
2
3
=
1
2
c
1
t
2
c
2
t + c
3
H = u
2
(t) +
T
f
=
1
2
u
2
(t) +
1
v +
2
a +
3
u
H
u
= 0
0 = u +
3
u =
1
2
c
1
t
2
c
2
t + c
3
a = u
a =
1
6
c
1
t
3
1
2
c
2
t
2
+ c
3
t + c
4
v = a
v =
1
24
c
1
t
4
1
6
c
2
t
3
+
1
2
c
3
t
2
+ c
4
t + c
5
x = v
x =
1
120
c
1
t
5
1
24
c
2
t
4
+
1
6
c
3
t
3
+
1
2
c
4
t
2
+ c
5
t + c
6
c
6
= x
0
c
4
= c
5
= 0 x(0) = x
0
v(0) = a(0) = 0
a =
1
6
c
1
t
3
1
2
c
2
t
2
+ c
3
t
v =
1
24
c
1
t
4
1
6
c
2
t
3
+
1
2
c
3
t
2
x =
1
120
c
1
t
5
1
24
c
2
t
4
+
1
6
c
3
t
3
+ x
0
t
f
x(t
f
) = x
f
v(t
f
) = a(t
f
) = 0
0
0
x
f
x
0
1
6
t
3
f
1
2
t
2
f
t
f
1
24
t
4
f
1
6
t
3
f
1
2
t
2
f
1
120
t
5
f
1
24
t
4
f
1
6
t
3
f
c
1
c
2
c
3
f L
t
dH
dt
=
d
dt
_
L(x(t), u(t)) +
T
(t)f (x(t), u(t))
L
x
f +
L
u
u +
T
f +
T
_
_
f
x
x
..
=f
+
f
u
u
_
_
=
H
u
u +
_
H
x
+
T
_
f
H = 0
LQR
x(t) = Ax(t) +Bu(t) (7)
u
J =
1
2
_
x
T
S
f
x
_
t=t
f
+
1
2
_
t
f
t
0
_
xQx +u
T
Ru
_
positive denite S
f
, Q, R t
f
x(t
0
)
H =
1
2
xQx +
1
2
u
T
Ru +
T
(Ax +Bu)
(t
f
) = S
f
x(t
f
)
= Qx A
T
(8)
0 = Ru +B
T
u = R
1
B
T
(9)
x
3
1
= c
1
2
= c
1
t + c
2
3
=
1
2
c
1
t
2
c
2
t + c
3
H = u
2
(t) +
T
f
=
1
2
u
2
(t) +
1
v +
2
a +
3
u
H
u
= 0
0 = u +
3
u =
1
2
c
1
t
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
t
2
f
t
f
1
24
t
4
f
1
6
t
3
f
1
2
t
2
f
1
120
t
5
f
1
24
t
4
f
1
6
t
3
f
c
1
c
2
c
3
Resulting in
where
16
c
3
= (x
f
x
0
)
60
t
3
f
c
2
= (x
f
x
0
)
360
t
4
f
c
1
= (x
f
x
0
)
720
t
5
f
x
x(t) = x
0
+ (x
f
x
0
)(6
5
15
4
+ 10
3
)
=
t
t
f
10 20 30 40 50 60 70 80 90 100
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
x(t)
10 20 30 40 50 60 70 80 90 100
2
4
6
8
10
12
14
16
18
x 10
!3
v(t)
10 20 30 40 50 60 70 80 90
!5
!4
!3
!2
!1
0
1
2
3
4
5
x 10
!4
a(t)
10 20 30 40 50 60 70 80 90
!2
!1
0
1
2
3
4
5
x 10
!5
u(t)
c
3
= (x
f
x
0
)
60
t
3
f
c
2
= (x
f
x
0
)
360
t
4
f
c
1
= (x
f
x
0
)
720
t
5
f
x
x(t) = x
0
+ (x
f
x
0
)(6
5
15
4
+ 10
3
)
=
t
t
f
10 20 30 40 50 60 70 80 90 100
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
x(t)
10 20 30 40 50 60 70 80 90 100
2
4
6
8
10
12
14
16
18
x 10
!3
v(t)
10 20 30 40 50 60 70 80 90
!5
!4
!3
!2
!1
0
1
2
3
4
5
x 10
!4
a(t)
10 20 30 40 50 60 70 80 90
!2
!1
0
1
2
3
4
5
x 10
!5
u(t)
c
3
= (x
f
x
0
)
60
t
3
f
c
2
= (x
f
x
0
)
360
t
4
f
c
1
= (x
f
x
0
)
720
t
5
f
x
x(t) = x
0
+ (x
f
x
0
)(6
5
15
4
+ 10
3
)
=
t
t
f
10 20 30 40 50 60 70 80 90 100
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
x(t)
10 20 30 40 50 60 70 80 90 100
2
4
6
8
10
12
14
16
18
x 10
!3
v(t)
10 20 30 40 50 60 70 80 90
!5
!4
!3
!2
!1
0
1
2
3
4
5
x 10
!4
a(t)
10 20 30 40 50 60 70 80 90
!2
!1
0
1
2
3
4
5
x 10
!5
u(t)
1
= c
1
2
= c
1
t + c
2
3
=
1
2
c
1
t
2
c
2
t + c
3
H = u
2
(t) +
T
f
=
1
2
u
2
(t) +
1
v +
2
a +
3
u
H
u
= 0
0 = u +
3
u =
1
2
c
1
t
2
+ c
2
t c
3
a = u
a =
1
6
c
1
t
3
+
1
2
c
2
t
2
c
3
t + c
4
v = a
v =
1
24
c
1
t
4
+
1
6
c
2
t
3
1
2
c
3
t
2
+ c
4
t + c
5
x = v
x =
1
120
c
1
t
5
+
1
24
c
2
t
4
1
6
c
3
t
3
+
1
2
c
4
t
2
+ c
5
t + c
6
c
6
= x
0
c
4
= c
5
= 0 x(0) = x
0
v(0) = a(0) = 0
a =
1
6
c
1
t
3
+
1
2
c
2
t
2
c
3
t
v =
1
24
c
1
t
4
+
1
6
c
2
t
3
1
2
c
3
t
2
x =
1
120
c
1
t
5
+
1
24
c
2
t
4
1
6
c
3
t
3
+ x
0
t
f
x(t
f
) = x
f
v(t
f
) = a(t
f
) = 0
0
0
x
f
x
0
1
6
t
3
f
1
2
t
2
f
t
f
1
24
t
4
f
1
6
t
3
f
1
2
t
2
f
1
120
t
5
f
1
24
t
4
f
1
6
t
3
f
c
1
c
2
c
3
17
c
3
= (x
f
x
0
)
60
t
3
f
c
2
= (x
f
x
0
)
360
t
4
f
c
1
= (x
f
x
0
)
720
t
5
f
x
x(t) = x
0
+ (x
f
x
0
)(6
5
15
4
+ 10
3
)
=
t
t
f
10 20 30 40 50 60 70 80 90 100
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
x(t)
10 20 30 40 50 60 70 80 90 100
2
4
6
8
10
12
14
16
18
x 10
!3
v(t)
10 20 30 40 50 60 70 80 90
!5
!4
!3
!2
!1
0
1
2
3
4
5
x 10
!4
a(t)
10 20 30 40 50 60 70 80 90
!2
!1
0
1
2
3
4
5
x 10
!5
u(t)
When t
f
is not constrained it becomes a parameter of the variation
problem and affects the cost of the solution. All the previous optimality
conditions still apply and an extra condition is added:
Proof sketch (see Bryson & Ho, sec 2.7 for real proof):
Note that the same result is reached without the assumption on x not
varying.
19
That is
20
Minimum Time Problems
E.g. given fixed amount of fuel, reach the destination with an empty tank
(while obeying some optimality criterions) . N(x,u,t) would be the fuel
consumption and c the given fuel amount.
It is clear that
The cost is
25
Solution:
The Hamiltonian is
we know that it is a constant because L and f are not explicit functions
of time (see previous slide).
This means that under this control scheme the sine of (t) is linear.
One can then use the given boundary conditions to find H,c
1
,c
2
,
solve x
1
and show that the optimal path is an ark of a circle whose center is at
, its radius is p/2 and obeys
27
L = x
1
, = 0
u =
f
1
= x
1
= tan
x
1
(0) = 0 , x
1
(a) = 0
t
f
= a
p =
a
0
1
cos
dt
p < a
J =
a
0
x
1
dt
f
2
= x
2
=
1
cos
, x
2
(0) = 0 , x
2
(a) = p
H = L +
T
f = x
1
+
1
tan +
2
cos
= const (20)
f L H =
1
=
H
x
1
= 1
2
=
H
x
2
= 0
1
= t + c
1
2
= c
2
H
u
=
H
=
1
cos
2
+
2
sin
cos
2
= 0
1
=
2
sin = c
2
sin
...
29
Some Other Variation Variants