Optimal control

1.0 1
1.0.
Optimal control
• “Classic” techniques are based on:
– Time-domain specifications (rise time, overshoot, steady-state error,
...)
– Frequency-domain specifications (phase and/or amplitude margin)
• “Iterative” process which (non univocal) solution is often determined by
trial and error
• Drawbacks:
–
–
–
–
Cannot be easily extended to MIMO systems
The control energy is not explicitly considered
The “optimal” solution cannot be determined
Cannot be applied to non-stationary (time-variant) systems
• “Modern” techniques are based on the definition of a performance
index (or objective functional) that must be minimized, for example:
Z ∞
e2(t)dt
PI =
0
• The performance of the system are the defined as optimal with respect to
the performance index.
• In general, different requirements (sometimes conflicting) are considered in
the definition of the performance index obtaining in this way compromise
solutions.
• Bibliografy:
– M. Tibaldi, Progetto di sistemi di controllo, Pitagora editrice, Bologna, 1995.
– D. S. Naidu, Optimal Control Systems, CRC Press, Boca Raton, FL,
2003
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 2
1.0.
Optimal control of a dynamic system
• Given the dynamic system
ẋ(t) = f(x(t), u(t), t),
xn×1, ur×1
(1)
f0(x(t), u(t), t)dt
{z
}
(2)
and the performance index
J :=
S(x(tf ), tf )
| {z }
Z
+
Cost of the final state
tf
| t0
Cost of the state trajectory in [t0 , tf ] or
“running cost”
with the boundary conditions
x(t0) = x0, while x(tf ) and tf are free
• Optimal control problem: determine the function u⋆(t), ∀t ∈ [t0, tf ] such
that the index J is minimized.
• Given the Hamiltonian function
H(x(t), u(t), λ, t) := f0(x(t), u(t), t) + λT (t)f(x(t), u(t), t)
where λn×1 is called co-state or vector of adjoined variables
necessary condition for finding a solution, i.e. the optimal solution u⋆(t),
is that, besides equation (1), the following system of differential equations
holds true
∂H T
λ̇(t) = −
co-state equation
∂x
∂H
= 0
control equation
∂u
with the (final) final boundary conditions
∂S
∂S
H+
− λT (t) δxf = 0
δtf +
∂t tf
∂x
tf
(3)
(4)
(5)
where δtf and δxf are arbitrary variations on tf and xf respectively.
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 3
1.0.
• Since δtf and δxf are not fixed the equation (5) can be rewritten as
∂S
H+
= 0
∂t tf
T
∂S
∂S
= 0 −→ λ(tf ) =
− λT (t)
∂x
∂x tf
tf
• Note that the solution of the system composed by the state and co-state
equations (1)-(3) needs both initial conditions on x (x(t0) = x0) and final
conditions on λ (λ(tf )). For this reason the problem is called two-point
boundary value problem. In general this aspect complicates the problem of the numerical integration of the differential equations composing
the system.
• If the final state xf (or the final time tf ) is not free but it is constrained,
the differential equations governing the problem are the same, but the
boundary conditions given by (5) change:
– if xf is fixed and tf is free, δxf = 0 and δtf 6= 0 and accordingly the
only constraint is
∂S
H+
=0
∂t tf
– if xf is free and tf is fixed, δxf 6= 0 and δtf = 0 and accordingly the
only constraint remains
T
∂S
λ(tf ) =
∂x tf
– if both xf and tf are given, δxf = 0 and δtf = 0, and therefore all the
final conditions that are necessary for solving the problem are provided
and there is no need for further constraints.
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 4
1.0.
Procedure for the solution of an optimal control problem
Given the plant
ẋ(t) = f(x(t), u(t), t)
the cost function
J := S(x(tf ), tf ) +
Z
tf
f0(x(t), u(t), t)dt
t0
and the boundary conditions, the solution of the optimal control problem is
based on the following steps:
1. Define the hamiltonian function
H(x(t), u(t), λ, t) := f0(x(t), u(t), t) + λT (t)f(x(t), u(t), t).
∂H
= 0 −→ u⋆(t) = h(x(t), λ(t), t).
∂u
3. By using the output of steps 1 and 2 find the optimal value of H⋆ =
H(x(t), h(x(t), λ(t), t), λ, t). and define the system of 2n differential
equations composed by the state and co-state equations
2. Minimize H with respect to u:
⋆
ẋ(t) = f(x(t), u (t), t)
⇆
∂H⋆ T
ẋ(t) =
∂λ
∂H⋆ T
λ̇(t) = −
.
∂x
4. Solve the system of differential equations with initial conditions x0 and
final conditions
∂S
∂S
H+
− λT (t) δxf = 0.
δtf +
∂t tf
∂x
tf
5. Substitute the solutions x⋆(t) and λ⋆(t) in the expression of the optimal
control H⋆ .
N.B:: The optimization with the initial performance index, i.e. a functional
compliant with the dynamics of the plant, is equivalent to the optimization of
the Hamiltonian H with respect to u(t). In this way, the initial problem of
optimization of a functional is translated into a more standard (and simple)
problem of optimization of a function.
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 5
1.0.
Example. Control with free final conditions
Let us consider a mass m in rectilinear motion, subject to a force f applied in the direction of the motion. At the initial time
instant t0 the position x(t0) = x10 and the
velocity x20 are known.
m
f
x
• By assuming u(t) = f (t)/m, the motion equation mẍ(t) = f , x(0) = x10,
ẋ(0) = x20 (t0 = 0), can be rewritten as
ẋ1(t) = x2(t)
x1(0) = x10
(6)
ẋ2(t) = u(t)
x2(0) = x20
• Specifications: determine the optimal control action u(t) ∈ [t0, tf ] such
that
– at final time instant tf = 2 the mass m is close enough to the origin;
– the control action (control energy) is limited enough.
• The performance can be defined as
Z tf
c2u2(t)dt,
J = c1x21(tf ) +
c1, c2 > 0
t0
where c1 and c2 are suitable constants defined to “quantify” the specifications. We assume c1 = c2 = 1/2 and x10 = 1 m, x20 = 2m/s.
• Solution: According to the procedure outlined in the previous slide:
1.
H(x(t), u(t), λ, t) = f0 (x(t), u(t), t) + λT (t)f(x(t), u(t), t)
1
= u2(t) + λ1(t)x2(t) + λ2(t)u(t)
2
2.
∂H
= 0 −→ u(t) + λ2(t) = 0 −→ u⋆(t) = −λ2(t)
∂u
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 6
1.0.
3. By substituting the expression of the optimal control, we obtain
1 2
λ2(t) + λ1(t)x2(t) − λ22(t)
2
1
= λ1(t)x2(t) − λ22(t)
2
and accordingly the state and co-state equations result
H(x(t), u⋆(t), λ, t) =
∂H
ẋ1(t) = + ∂λ
= x2(t)
1
∂H
= −λ2(t)
ẋ2(t) = + ∂λ
2
λ̇1(t) =
λ̇2(t) =
∂H
− ∂x
1
∂H
− ∂x2
(7)
= 0
= −λ1(t)
4. By solving the system of differential equations we obtain
C3 3 C4 2
t − t + C2 t + C1
6
2
C3 2
x2(t) =
t − C4 t + C2
2
λ1(t) = C3
x1(t) =
(8)
λ2(t) = −C3t + C4
where the unknown parameter Ci must be found by imposing the
(given) initial conditions
x1(0) = 1, x2(0) = 2
and the final conditions, that, since tf is fixed, can be deduced from
1 2
∂ 2 x1
T
= x1(2)
λ
(2)
=
1
∂S
∂x1 t=2
1 2
λ(tf ) =
−→
∂ 2 x1
∂x tf
λ2(2) =
=0
∂x2
t=2
By replacing the above conditions in (8), an algebraic system of 4
equations in the 4 unknowns Ci is obtained, and finally
C1 = 1, C2 = 2, C3 =
L. Biagiotti, Systems and Control Theory
15
30
, C4 = .
11
11
1. OPTIMAL CONTROL
1.0 7
1.0.
5. The final expression of the optimal control is therefore
30
15
u⋆(t) = −λ2(t) = t −
11
11
• In the figure, the evolution of the state variables and the control are shown
2
x (t)
1
1.5
1
0.5
x (t)
2
0
−0.5
−1
u(t)
−1.5
−2
−2.5
−3
0
0.5
1
t
1.5
2
Example. Control with given final constraints
By taking into account the same system of previous example, we want to design
an optimal regulator able to transfer the system’s state from x(0) = [1 2]T to
x(2) = [1 0]T with the minimum control energy.
• the model of the system is still (6)
• the performance index is
Z
tf
1 2
u (t)dt
2
t0
where the cost of the final state, which is fixed, is not present.
J=
• Solution: until step 4. the solution is identical to the previous case,
only the boundary conditions for the computation of the coefficients Ci
are different:
x1(0) = 1, x2(0) = 2, x1(2) = 1, x2(2) = 0.
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 8
1.0.
By considering these conditions in (7) the following coefficients values
descend
C1 = 1, C2 = 2, C3 = 3, C4 = 4.
Accordingly, the final expression of the optimal control is
u⋆(t) = −λ2(t) = 3t − 4
• In the figure the state variables and the control are shown
2
x (t)
1
1
0
x (t)
2
−1
u(t)
−2
−3
−4
0
0.5
1
t
1.5
2
Example. Control with partial final constraints
By taking into account the same system of previous example, we want to design
an optimal regulator such that the system’s state moves from x(0) = [1 2]T
to a final value characterized by x1(2) = 1 (while x2(2) is free), with the
minimum control energy.
• the system model is still (6)
• the performance index is
J=
Z
tf
t0
1 2
u (t)dt
2
where the cost of the final state is not present (note that in none of
previous examples the contribution of x2(2) appears in the expression of
the cost function and now x1(2) is fixed). As a consequence S = 0.
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 9
1.0.
• Solution: also in this case, the solution is the same of previous examples
until step 4. Only the boundary conditions for the computation of the
coefficients Ci changes:
x1(0) = 1, x2(0) = 2, x1(2) = 1
with an additional condition on the second component of λ:
∂S
λ2(2) =
= 0.
∂x2 t=2
By replacing the above conditions in (7) the following values of the coefficients descend
3
C1 = 1, C2 = 2, C3 = , C4 = 3.
2
The final expression of the optimal control is
u⋆(t) = −λ2(t) = 3t −
3
2
• In the figure the evolution of the state variables and the control are shown
2
x (t)
1
1.5
1
0.5
0
x2(t)
−0.5
−1
u(t)
−1.5
−2
−2.5
−3
0
0.5
1
t
1.5
2
• Note that the expression of the optimal control u⋆(t) only depends on time
and is not a function of the state x(t). As a consequence the controller
has a feed-forward structure.
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 10
1.0.
LQ Optimal Control
• The LQ (Linear - Quadratic) Optimal Control is a particular case of
optimal control defined in the case when
– the dynamic system is linear
– the performance index is defined by quadratic functions
• Let us consider the Linear Time-Variant (LTV) system
ẋ(t) = A(t)x(t) + B(t)u(t),
x(t0) = x0
with the performance index
1
1
J = xT (tf )Sf x(tf ) +
2
2
Z
tf
xT (t)Q(t)x(t) + uT (t)R(t)u(t)dt
t0
where matrices Sf , Q(t) are symmetric and positive semidefinite and R(t)
is symmetric and strictly positive definite:
Sf = STf ≥ 0,
Q(t) = Q(t)T ≥ 0,
R(t) = R(t)T > 0.
Usually the matrices Sf , Q(t) and R(t) are diagonal (the square value
of each component of x(tf ), x and u is considered in the performance
index).
• Since the aim of the control is to maintain the state x(t) close to zero,
the problem is called state regulation. This kind of situation occurs when
the plant is affected by external disturbances that perturb the state.
• Note that the final time tf < ∞ is not fixed; for this reason the control is
called finite time.
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 11
1.0.
• Solution: the solution to the problem of finite time optimal regulation of
the state can be achieved with the same procedure of previous examples:
1. Define the Hamiltonian function
1 T
1 T
T
H = x (t)Q(t)x(t)+ u (t)R(t)u(t)+λ (t) A(t)x(t)+B(t)u(t)
2
2
2. Minimize H with respect to u:
∂H
= 0 → R(t)u(t)+BT (t)λ(t) = 0 → u⋆(t) = −R−1(t)BT (t)λ(t)
∂u
3. Replace u⋆(t) in H to find its optimal value and write state and costate equations
∂H⋆ T
ẋ(t) =
→ ẋ(t) = A(t)x(t) + B(t)u⋆(t)
∂λ
∂H⋆ T
→ λ̇(t) = −Q(t)x(t) − AT (t)λ(t)
λ̇(t) = −
∂x
4. Solve the system of 2n differential equation with boundary conditions
x(t0) = 0
and
λ(tf ) =
∂S
∂x
T
= Sf x(tf )
(9)
tf
5. Replace the solutions of the differential equations, i.e. x⋆(t) and λ⋆(t),
in the expression of the optimal control obtained at step 2.
• It is worth noticing that the expression of the control is open-loop,
that is the control law does NOT depend on the system state x(t), but
it is designed on the basis of the knowledge of the system model. In
order to improve the robustness of the control with respect to parametric
errors and external disturbances a feedback control law, depending on the
internal state x(t), would be preferable. Note that if the optimal control
is implemented by means of state feedback (closed loop), what we obtain
is not a different control law but a a different implementation. The
optimal control law is unique!
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 12
1.0.
• The existence of a feedback implementation of the optimal control law is
guaranteed by the so-called Bellman optimality principle:
If the control law u⋆(t), defined in [t0, tf ], is optimal with respect to
a given problem with initial conditions (x0, t0) and the optimal state
trajectory is x⋆(t), then the same control law is optimal in [t, tf ]
with respect to the same problem with initial conditions [x⋆(t), t]
for any t ∈ [t0, tf ]. It follows that if u⋆(t) is the optimal control law
in [t0, tf ], it can be expressed at any time instant t as a function of
x⋆(t), that is u⋆(t) = u⋆[x⋆(t), t], ∀t ∈ [t0, tf ].
x(t)
x(t)
x⋆(t1)
⋆
x (t)
x⋆(t)
x(t0)
x(t0)
tf
t0
t
t0
t1
tf
t
The optimality principle does not provide any tool for determining the
control law as a function of the system state, but it states that a feedback
expression exists.
• In order to deduce an expression of the optimal control, which is a function
of x(t) rather than λ(t) as in
u⋆(t) = −R−1(t)BT (t)λ(t)
the starting point is the observation that in (9) the final value of vector
of adjoined variables is proportional to the final value of x. Therefore, we
assume a proportional relation
λ(t) = S(t)x(t)
(10)
in which
S(tf ) = Sf .
Compare equations (9) and (10).
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 13
1.0.
• From equation (10) it is possible to find the relationship between λ(t) and
x(t), by determining S(t).
Let us differentiate (10) with respect to the time by obtaining
λ̇(t) = Ṡ(t)x(t) + S(t)ẋ(t)
(11)
Then, we replace in (11) the expressions of state and co-state derivatives:
−u⋆ (t)=R−1(t)BT (t)λ(t)
}|
{
z
−1
T
ẋ(t) = A(t)x(t) − B(t) R (t)B (t)S(t)x(t)
λ̇(t) = −Q(t)x(t) − AT (t) S(t)x(t) .
| {z }
λ(t)
After the substitution, we obtain
−Q(t)x(t)−AT (t)S(t)x(t) = Ṡ(t)x(t)+S(t)A(t)x(t)−S(t)B(t)R−1(t)BT (t)S(t)x(t)
and finally, by collecting x(t),
h
i
T
−1
T
Ṡ(t)+S(t)A(t)+A (t)S(t)−S(t)B(t)R (t)B (t)S(t)+Q(t) x(t) = 0.
Since the above relation must be true ∀x(t), we deduce that S(t) must
be the solution of the differential equation
Ṡ(t)+S(t)A(t)+AT (t)S(t)−S(t)B(t)R−1(t)BT (t)S(t)+Q(t) = 0,
S(tf ) = Sf
called Differential Riccati Equation (DRE).
Note that, since the matrices Sf , Q(t) and R(t) are symmetric, also S(t)
is symmetric. As a consequence, the differential Riccati equation is a system of n(n + 1)/2 (and not n × n) ordinary differential equations of the
first order which are nonlinear and time-variant.
Moreover, the matrix S(t) is a time-variant matrix that depends on the
matrices of the plant A(t) B(t), on the matrices of the performance index
Q(t), R(t) and Sf but not on the initial state x(t0) of the system.
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 14
1.0.
• Form the solution of the Differential Riccati Equation S(t) it is possible
to write the expression of the optimal control law as a function of x(t):
u⋆(t) = −R−1 (t)BT (t)S(t)x(t) = −K(t)x(t)
where K(t) = R−1 (t)BT (t)S(t) is called Kalman gain.
• Controllability of the system: in order to implement the feedback
optimal control law no controllability conditions are required, since, by
considering a finite time horizon, the contributions of the uncontrollable
components of the state vector are finite quantities, even if they are unstable. On the contrary, if an infinite time horizon is considered, it is
necessary to impose some controllability conditions.
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 15
1.0.
Infinite time LQ Optimal Control
• Give the system
ẋ(t) = A(t)x(t) + B(t)u(t),
x(t0) = x0
(12)
the goal of the infinite time LQ control problem is minimizing the performance index
Z
1 ∞ T
J=
x (t)Q(t)x(t) + uT (t)R(t)u(t)dt
2 t0
with the usual conditions on Q(t) and R(t). Differently from finite time
case, the final cost does not appear in the performance index because of
the lack of practical sense.
• Note that in this case the final time tf is not specified, since it tends to
infinity. Accordingly, if a state component is uncontrollable and unstable,
the performance index will tend to infinity. Therefore it is necessary to
assume that the system (12) is completely controllable.
• Similarly to finite time case, the regulator is
u⋆(t) = −R−1(t)BT (t)Ŝ(t)x(t)
where
Ŝ(t) = lim {S(t)}
tf →∞
is a symmetric positive semi-definite matrix, solution of the Differential
Riccati Equation
˙ + Ŝ(t)A(t) + AT (t)Ŝ(t) − Ŝ(t)B(t)R−1(t)BT (t)Ŝ(t) + Q(t) = 0
Ŝ(t)
with the boundary condition
lim Ŝ(tf ) = 0.
tf →∞
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 16
1.0.
• If a time-invariant system is considered
ẋ(t) = Ax(t) + Bu(t),
x(t0) = x0
(13)
with the performance index
Z
1 ∞ T
x (t)Qx(t) + uT (t)Ru(t)dt
J=
2 t0
where the matrices Q = QT ≥ 0 and R = RT > 0 are constant, the
optimal control is given by
u⋆(t) = −R−1 BT S̄ x(t) = −K̄ x(t)
where S̄ is a n × n symmetric, positive semi-definite, constant matrix.
• Since it is constant, S̄ is the solution of the Algebraic Riccati Equation
(ARE)
dS̄
= 0 = −S̄A − AT S̄ + S̄BR−1BT S̄ − Q
dt
usually written as
S̄A + AT S̄ − S̄BR−1BT S̄ + Q = 0
• Despite the assumption of complete controllability of (12), and (13), the
closed-loop system
ẋ(t) = (A − B R−1 BT S̄) x(t)
may result unstable, in particular when the plant is unstable and the unstable states do not appear in the index J. In order to prevent this situation it
is sufficient to assume that, given the matrix Q = GT G, the pair (A, G)
is observable. This hypothesis guarantee that all the states, which may be
unstable, appears in the term xT (t)Qx(t) of the cost functional.
If the matrix (A, G) is completely observable, the matrix S̄ of the Riccati
coefficient is positive definite. The matrix G can be obtained by means of
the so-called Cholesky factorization of Q. In the Matlab environment G
= chol(Q).
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 17
1.0.
• Some authors consider the performance index J as a function of the output
of the system rather than of the state. In this case, given
ẋ(t) = A x(t) + B u(t),
y(t) = C x(t)
and
1
J=
2
Z
∞
t0
x(t0) = x0
yT (t)Qy(t) + uT (t)Ru(t) dt
(14)
with Q = QT ≥ 0 and R = RT > 0
the optimal control law is
u⋆(t) = −R−1 BT S̄ x(t) = −K̄ x(t)
where S̄ is the solution
T
S̄A + AT S̄ − S̄BR−1BT S̄ + C
QC} = 0
| {z
Q′
• The performance index in (14) can be rewritten as


Z ∞
1
xT (t) CT QC x(t) + uT (t)Ru(t) dt
J=
| {z }
2 t0
′
(15)
Q
and therefore the results previously found are still valid by considering
Q′ = CT QC in lieu of Q.
• If the system (that is the pair (A, B)) is stabilizable (i.e. the unstable state
subspace is contained in the reachable subspace) and (the pair (A, C)) is
detectable (i.e. the unobservable subspace is contained in the stable state
subspace) the ARE has a unique positive semi-definite solution S̄. If the
pair (A, C) if completely observable, the matrix S̄ is positive definite.
• In this case the control law u⋆(t) minimizes the performance index and
makes the controlled system asymptotically stable.
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL
1.0 18
1.0.
Continuous-time and discrete-time optimal control
Continuous-time systems
Discrete-time systems
ẋ(t) = A(t)x(t) + B(t)u(t),
x(t0 ) = x0
x(k + 1) = A(k)x(k) + B(k)u(k),
Goal of the LQ optimal control is to minimize the performance index
J =
1 T
1
x (tf )Sf x(tf ) +
2
2
Z t
f
T
T
x (t)Q(t)x(t) + u (t)R(t)u(t)dt
(16)
x(k0 ) = x0
Goal of the LQ optimal control is to minimize the performance index
t0
k −1
J =
f
1 X
1 T
T
T
x (k)Q(k)x(k) + u (k)R(k)u(k)
x (kf )Sf x(kf ) +
2
2 k=k
0
(17)
Solution:
By solving the differential Riccati equation:
By solving the difference Riccati equation:
T
Ṡ(t)+S(t)A(t)+A (t)S(t)−S(t)B(t)R
−1
T
(t)B (t)S(t)+Q(t) = 0,
S(tf ) = Sf
it descends the control law
T
S(k) = A (k)S(k + 1)[A(k) − B(k)K(k)] + Q(k) = 0,
it descends the control law
S(kf ) = Sf
⋆
u (t) = −K(k)x(k)
⋆
u (t) = −R
−1
T
(t)B (t)S(t)x(t) = −K(t)x(t)
where K(t) = [BT (k)S(k + 1)B(k) + R(k)]−1 BT (k)S(k + 1)A(k) is the Kalman
gain.
where K(t) = R−1 (t)BT (t)S(t) is the Kalman gain.
Infinite time case:
For time-invariant systems, if tf → ∞, the differential Riccati equations becomes an algebraic
equation (CARE - Continuous Algebraic Riccati Equation)
T
S̄A + A S̄ − S̄BR
−1
T
B S̄ + Q = 0
⋆
−1
T
B
T
T
S̄ = A {S̄ − S̄B[B S̄B + R]
−1
T
B S̄}A + Q
and the expression of the optimal control law is
and the expression of the optimal control law is
u (t) = −R
For time-invariant systems, if kf → ∞, the difference Riccati equations becomes an algebraic
equation (DARE - Discrete Algebraic Riccati Equation)
S̄ x(t) = −K̄ x(t)
⋆
T
u (k) = −[B S̄B + R]
−1
T
B
S̄ Ax(k) = −K̄ x(k)
Matlab commands:
• Solution of the (continuous-time) algebraic Riccati equation:
• Solution of the (discrete-time) algebraic Riccati equation:
[S,E,K] = care(A,B,Q,R)
[S,E,K] = dare(A,B,Q,R)
where S is the solution of the equation, E is the vector of closed-loop eigenvalues and
K is the Kalman gain matrix
where S is the solution of the equation, E is the vector of closed-loop eigenvalues and
K is the Kalman gain matrix
• Solution of the (continuous-time) LQ optimal control problem:
• Solution of the (discrete-time) LQ optimal control problem:
[K,S,E] = lqr(A,B,Q,R)
[K,S,E] = dlqr(A,B,Q,R)
where S is the solution of the equation, E is the vector of closed-loop eigenvalues and
K is the Kalman gain matrix
where S is the solution of the equation, E is the vector of closed-loop eigenvalues
and K is the Kalman gain matrix. The command dlqr must be not confused with
[K,S,E] = lqrd(A,B,Q,R,Ts) that allows to find the kalman gain K, minimizing
the performance index (16) and not (17), for the discrete-time system obtained by
discretizing the system (A, B, C, D) with sample period Ts .
L. Biagiotti, Systems and Control Theory
1. OPTIMAL CONTROL