1
Linear Quadratic Regulator
Yat Wong
yw15g21@[Link]
√
1± 1+4ρ
Abstract—This paper explores the design and analysis of a where P = 2 .
Linear Quadratic Regulator (LQR) using both time-varying
and steady-state approaches. The optimal input, final states,
feedback gains, and elements of Pt are analysed. The results B. Task A.2
demonstrate that the behaviour of these parameters is similar
By substituting Equation (7) and the value of K into
for both methods. However, the time-varying approach achieves
a slightly lower cost value. Additionally, the effect of modifying Equation (1), the closed loop poles can be found as shown
R by changing ρ is examined. It is observed that a smaller R below.
results in less penalty on the control input, leading to larger
control inputs and faster state convergence. xk+1 = xk + Kxk
= (1 + K)xk
I. I NTRODUCTION λ=1+K
T HIS paper analyses two systems. System A is represented
by Equation (1) and (2) and the control objective is to
minimise the cost represented by Equattion (3). √
=1−
P
ρ+P
(8)
1± 1+4ρ
where P = 2 .
xk+1 = xk + uk (1)
yk = xk (2) C. Task A.3
∞
X When ρ = 0, λ = 0. Since, the close loop pole is within the
J= yt2 + ρu2t (3)
t=0
unit circle, the system is stable. When ρ = ∞, λ = 1. Since,
the close loop pole is touching the unit circle, the system is
System B is represented by Equation (4) and (5) and
margianlly stable.
the control objective is to minimise the cost represented by
Equattion (6).
xk+1 = Axk + Buk (4) III. PART B
yk = Cxk (5) A. Task B.1
N −1 N Figure 1 illustrate the optimal input, resulting states, feed-
X X
J =ρ u2t + yt2 (6) back gain K and elements of Pt as a function of time. For the
t=0 t=0 optimal input and resulting states, oscillations are observed at
the beginning. However, they settle down after approximately
II. PARTA 10 time steps, indicating that the system is controllable and
A. Task A.1 stable. Also, the feedback gain K and element of Pt remained
By comparing Equation (1), (2) and (3) to the standard form, constant in the early time step but changed more aggressively
it can be found that A = 1, B = 1, C = 1, Q = 1 and R = ρ. near the end of the time step to try to minimise the cost
By substituting the corresponding vlaue to the Riccati and reach the termianl values within the limited time steps.
equation, the value of P can be found as shown below. Moreover, only 6 unique elements of Pt are shown as Pt is
a symmetrical matrix and some elements overlap with each
P = Q + AT P A − AT P B(R + B T P B)−1 B T P A
other.
= 1 + P − P (ρ + P )−1 P
√
1 ± 1 + 4ρ B. Task B.2
=
2
Figure 2 illustrates the comparison of optimal input, re-
Similarly, K and u∗k can be found as shown below.
sulting states, feedback gain K and elements of Pt over time
K = −(R + B T P B)−1 B T P A using both time-varying and steady-state LQR solutions. The
= −(ρ + P )−1 P optimal input and state trajectories exhibit similar behaviour
−P in both methods. However, the feedback gain K remains
= constant in the steady-state LQR, while it varies over time
ρ+P
in the time-varying LQR. Upon closer inspection, the time-
u∗k = Kxk (7)
varying LQR solutions prove to be more optimal, as its LQR
−P cost is slightly lower at 19.375933688773262 compared to
= xk
ρ+P 19.375933688773266 for the steady-state LQR solution.
2
Fig. 2. The comparison of optimal input, resulting states, feedback gain K
and elements of Pt over time using both time-varying and steady-state LQR
solutions.
Fig. 1. The optimal input, resulting states, feedback gain K and elements of
Pt as a function of time.
C. Task B.3
Figure 3 illustrate the comparison of optimal input, states
over time using both time-varying and steady-state LQR with Fig. 3. The comparison of optimal input, resulting states over time using both
time-varying and steady-state LQR with various values of ρ
various values of ρ. The behavior of the optimal input and
state trajectories is similar when using both time-varying and
steady-state LQR. Regardless of the value of ρ, the system IV. C ONCLUSION
remains controllable and stable. Since R = ρ, a smaller ρ
value, such as 0.1, results in less penalty on the control input, For system A, a state feedback controller was successfully
leading to larger control inputs and faster state convergence. designed, and the closed-loop poles were determined. Extreme
Conversely, a higher ρ value increases the penalty on the cases were analyzed, showing that when ρ = 0, the system
control input, resulting in smaller control inputs and slower remains stable. When ρ = ∞, the system becomes marginally
state convergence. stable.
3
For system B, the analysis demonstrated that the system is
controllable and stable, as both the input and states converge
to zero as the time step increases. A comparison between
the time-varying LQR method and the steady-state LQR
method revealed that the behaviour of the optimal input, final
states, feedback gains, and elements of Pt are similar in both
cases. However, the time-varying LQR method proved to be
slightly better, with a lower LQR cost of 19.375933688773262
compared to 19.375933688773266 for the steady-state LQR.
Additionally, the effect of modifying R by adjusting ρ was
examined. It was observed that a smaller ρ results in less
penalty on the control input, leading to larger control inputs
and faster state convergence. Oppositely, a higher ρ value
increases the penalty on the control input, resulting in smaller
control inputs and slower state convergence.