, ,

[SOLVED] Cs4610/cs5335: homework 3

$25

File Name: Cs4610_cs5335__homework_3.zip
File Size: 235.5 KB

5/5 - (1 vote)

PA Q1: In this question, you must implement a finite horizon discrete
time LQR for the damped mass system described in class and illustrated
in the course slides. The time horizon, T, and the A and B matrices that
encode the system dynamics are already encoded in hw3.m and you don’t
need to change them. Also, the QT, Q, and R cost matrices as well as the
initial state, x0, are already encoded in hw3.m. What you need to do is to
implement two functions: FH DT Riccati and getControl as described
in Q1.m. FH DT Riccati should do the Riccati equation recursion. It
should return a cell array, P seq , where each cell is a 4 × 4 P matrix and
the cell index is the same as the time index ( P seq{i} denotes the 4 × 4 P
matrix at time i). getControl should calculate the control action when
the system is in state x at time i.
1
PA Q2: Exactly the same as Q1 except that you should now implement
a receeding horizon controller. Whereas in Q1 you were to find the optimal control for a fixed time horizon T, now you must execute a receeding
horizon controller where you calculate a control action at each time step by
optimizing over the next T time steps.
PA Q3: In this question, we are going to use the LQR framework in a new
way. As we have studied it so far, LQR can generate large control inputs
that can change quickly. For example, the control output calculated in Q1
and Q2 is very large on the first few time steps. It is sometimes desirable
to find a trajectory that minimizes the change in control input rather than
the magnitude of the control input itself. It turns out that we can use LQR
to calculate these sorts of control policies as well. Suppose that we want to
minimize a cost function of the form:
J(X, U) = x
T
TQT xT +
T
X−1
t=1
x
T
t Qxt + u
T
t Rut + ∆u
T
t Rˆ∆ut
,
where the last term in the summation imposes a cost on change in control
input. We can achieve this behavior by defining a new system:

xt+1
ut+1 !
=

A B
0 I
! xt
ut
!
+

B
I
!
∆ut
with cost function
J(X, U) =
xT
uT
!T
QT 0
0 0 ! xT
uT
!
+
T
X−1
t=1
xt
ut
!T
Q 0
0 R
! xt
ut
!
+ ∆u
T
t Rˆ∆ut
.
You should ask yourself the following questions: what is the new state vector representation? What are the new “A” and “B” matrices? Use this
new representation to calculate the optimal trajectory in this scenario. You
need to create three functions in Q3.m: FH DT Riccati, getControl,
and getSyntheticDynamics. However, FH DT Riccati and getControl should be exactly the same functions as you created in Q1.m. The
only new function is getSyntheticDynamics. This takes the underlying
2
parameters of the system as input and produces as output the new modified
parameters.
PA Q4: This question is completely written – no programming required!
The standard LQR formulation finds an optimal solution to the linear system,
xt+1 = Axt + But
,
with a quadratic cost function,
J(u1:T −1) = x
T
TQfx
T +
T
X−1
t=1
x
T
t Qxt + u
T
t Rut
.
But sometimes we want to find an optimal solution to this problem (same
cost function):
xt+1 = Axt + But + c,
where c is an additional constant term that makes the system dynamics
affine instead of linear. It turns out that we can solve the affine version of
the LQR problem by defining the following matrices:
A¯ =

A c − BR−1
r
0 1 !
, B¯ =

B
0
!
,

f =

Qf qf
q
T
f
η
!
, Q¯ =

Q q
q
T η
!
,
where η is an arbitrary constant, and vectors:
x¯t =

xt
1
!
, u¯t = ut + R
−1
r.
1) Substitute the matrices above into A¯x¯t + B¯u¯t
in order to show that this
parameterization solves the affine problem.
2) Substitute into:

T
TQ¯
fx¯
T +
T
X−1
t=1

T
t Q¯x¯t + ¯u
T
t Ru¯t
to find the cost function that is optimized for.
3
3) Give an example of an affine system that could be controlled using this
method.
4) If we redefine A¯ as:
A¯ =

A c
0 1 !
,
then how should we redefine ¯ut so that the system dynamics are still xt+1 =
Axt + But + c? What is the effect of this reparameterization on the cost
function?
4

Shopping Cart
[SOLVED] Cs4610/cs5335: homework 3[SOLVED] Cs4610/cs5335: homework 3
$25