SPL 09 Introduction To Optimal Control
SPL 09 Introduction To Optimal Control
Unggul Wasiwitono
Outline
2 Calculus of Variations
1 The design of a controller for the control of a process consists of providing a control signal, the
input, which will make the plant behave in a desired fashion.
2 In classical control the performance specifications are given in terms of desired time domain
and frequency domain measures, such as
1 step response specifications (overshoot, rise time, settling time),
2 frequency response specifications (bandwidth, resonance frequency, resonance damping) and
3 relative stability in terms of phase and gain margins.
1 The design of a controller for the control of a process consists of providing a control signal, the
input, which will make the plant behave in a desired fashion.
2 In classical control the performance specifications are given in terms of desired time domain
and frequency domain measures, such as
1 step response specifications (overshoot, rise time, settling time),
2 frequency response specifications (bandwidth, resonance frequency, resonance damping) and
3 relative stability in terms of phase and gain margins.
3 The above performance specifications are conflicting in the sense that they lead to
impossible or conflicting requirements for the controller parameters.
1 The design of a controller for the control of a process consists of providing a control signal, the
input, which will make the plant behave in a desired fashion.
2 In classical control the performance specifications are given in terms of desired time domain
and frequency domain measures, such as
1 step response specifications (overshoot, rise time, settling time),
2 frequency response specifications (bandwidth, resonance frequency, resonance damping) and
3 relative stability in terms of phase and gain margins.
3 The above performance specifications are conflicting in the sense that they lead to
impossible or conflicting requirements for the controller parameters.
4 Optimal control is an approach to control systems design that seeks the best possible control
with respect to a performance metric.
5 State feedback control methods we discussed do not consider constraints on states, control
inputs, etc.
the state vector has the value x0 at the initial time, i.e.
x (t0 ) = x0
Find a control u (t) , t ∈ [t0 , T ] that steers the system from an initial state x0 to a target set
and minimizes the cost
Z T
J (u) = M (x (T ) , T ) + L (x (t) , u (t)) dt (2)
t0
Calculus of Variations
where s is the arc-length along the wire and v is the instantaneous speed of the bead.
6 we have to minimise:
12
a
1 + y 02
Z
1
J (y) = √ dx
2g 0 y
with y (0) = 0 and y (a) = b
a 12
1 + y 02
Z
1
J (y) = √ dx
2g 0 y
Calculus of variations deals with optimisation problems of the type described above.
The task is to determine that specific value of the vector x (t) which minimizes J in time.
2 The function F is usually called a loss function and J is called an optimization index or a
performance index.
3 In order to find the required time functions it is necessary to know the boundary conditions for
these functions.
4 Usually the initial condition is known or specified, x (t0 ) = x0 , and At the final time there are
several possibilities:
1 t1 is fixed and and x (t1 ) is fixed
2 t1 is fixed and and x (t1 ) is free
3 t1 is free and and x (t1 ) is fixed
4 x (t) must satisfy certain constraint conditions at the final time.
because for the optimal solution, x (t) = x∗ (t), the variation δJ must be zero.
and
∂f (x∗ , ẋ∗ , t)
=0 (7)
∂ ẋ
Equation (6) is called the Euler-Lagrange equation and the boundary condition (7) is called a
natural boundary condition.
1 The Euler-Lagrange equation is a very general result which forms an excellent basis for optimal
control.
2 However, two important modifications are necessary.
1 Constraints to be met by the optimal x(t) must be introduced.
2 A control input must be added.
3 Consider the simplified optimal control problem, as follows
1 The system dynamics are assumed to be time-invariant (no explicit dependence of f on t)
2 The terminal time T will be assumed fixed
3 Initial consitions: x (0) = x0 fixed
Performace index: J (u) = M (x (T )) + T L (x (t) , u (t)) dt
R
4
0
5 Problem: Find u∗ (t) , 0 ≤ t ≤ T which minimizes J (u)
where all partial derivatives are evaluated on the optimal trajectory (x∗ (t) , u∗ (t))
5 Ignoring higher order terms gives the first variation of performance index as:
Z T
∂M ∂L ∂L
δJ = (δx)T + (δx)T + (δu)T dt
∂x T 0 ∂x ∂u
5 Ignoring higher order terms gives the first variation of performance index as:
Z T
∂M ∂L ∂L
δJ = (δx)T + (δx)T + (δu)T dt
∂x T 0 ∂x ∂u
4 Expanding
" n m
#
Z T X ∂fi X ∂fi d
∆Φi = pi (t) fi (x, u) + δxi + δuj − ẋi (t) − (δxi ) + · · · dt
0 i=1
∂xi i=1
∂uj dt
Z T
− pi (t) (fi (x, u) − ẋi (t)) dt
0
or
" n m
#
Z T X ∂fi X ∂fi d
δΦi = pi (t) δxi + δuj − (δxi ) dt
0 i=1
∂xi i=1
∂uj dt
hence
" n m
#
Z T X ∂fi Z T
X ∂fi
δΦi = pi (t) δxi + δuj dt + ṗi (t) δxi (t) dt − pi (T ) δxi (T )
0 i=1
∂xi i=1
∂uj 0
n n n
! m n
!
Z T Z T
X X X ∂fi X X ∂fi
δΦi = δxi pi (t) dt + δuj pi (t) dt
i=1 0 i=1 i=1
∂x i 0 j=1 i=1
∂u j
Z T
+ (δxi (t))T ṗi (t) dt − (δxi (T ))T pi (T )
0
6 Thus
n n n
!
Z T
X ∂M
T
X ∂L X ∂fi
δJ + δΦi = (δx) + δxi + pi (t) dt
i=1
∂x T 0 i=1 ∂xi i=1
∂xi
Z TX m n
! Z T
∂L X ∂fi
+ δuj + pi (t) dt + (δxi (t))T ṗi (t) dt − (δxi (T ))T pi (T )
0 j=1
∂uj i=1
∂u j 0
8 The expression for the variation can be simplified considerably by introducing the
Hamiltonean function
n
X
H (x, u) = L (x, u) + pT f (x, u) = L (x, u) + pi (t) fi (x, u)
i=1
U. Wasiwitono [Linear System Control] - Introduction to Optimal Control
22 / 37
What is Optimal Control? Calculus of Variations Linear Quadratic Regulator MATLAB for Control Law Design and Evaluation
9 Note that
n
∂H (x, u) ∂L X ∂fi
= + pi (t)
∂xi ∂xi i=1
∂x i
and
n
∂H (x, u) ∂L X ∂fi
= + pi (t)
∂uj ∂uj i=1
∂u j
10 Now, we have the Lagrange variables at our disposal and we make the choice:
∂H ∂M (T )
ṗ (t) = − p (T ) =
∂x ∂x
which form the “co-state” of the system. With this choice we need
Z T
∂H
δJ = (δu)T dt = 0
0 ∂u
From a computational
point of view it is easier to
use a quadratic perfor-
mance index of the form
Z ∞
2
(r (t) − y (t)) dt
0
1 The specific problem of determining the optimal control of a linear time-invariant (LTI) system
with a quadratic performance index.
2 The plant dynamics are described by the standard state-space equations:
−BR−1 B T
ẋ A x
=
ṗ −Q −AT p
= Ṗ x + P Ax − P BR−1 B T p = Ṗ x + P Ax − P BR−1 B T P x
for t ∈ [0 T ]
2 Since this must hold for all state-trajectories given any x(0) = x0 , it is necessary that:
−Ṗ = AT P + P A − P BR−1 B T P + Q
for t ∈ [0 T ]
3 This is a differential matrix equation (Riccati equation)
U. Wasiwitono [Linear System Control] - Introduction to Optimal Control
31 / 37
What is Optimal Control? Calculus of Variations Linear Quadratic Regulator MATLAB for Control Law Design and Evaluation