Compute a feedback gain and compare the guarantees of the three mathematical views.
Return later
Full HJB, Riccati and Pontryagin derivations are after the main route.
For the temperature thread: predict → calculate → reveal and check → change one condition. Complete the core calculation before reading the research extensions.
Lecture 9 · Optimal Control & Planning3 / 55
Act 1
It is the same problem
Q1. Control theory writes different symbols. Is it solving anything different?
ACT 1It is the same problemLecture 9
Discrete-time optimal control — the problem, stated
Q1 Same problem?Q2 LQR feedback?Q3 HJB meaning?Q4 Two views?
Choose a control to minimise an accumulated cost subject to deterministic dynamics:
Read the third clause carefully, because it is the whole lecture in one symbol:
uk=γk(xk),γk a permissible control strategy at stage k
What we seek is not a sequence of numbers u0,…,uK−1 but a ruleγk from state to control. Control theory insists on this from its very first slide, for the same reason Lecture 7 wanted a policy rather than a plan: a rule is still valid from wherever the system actually lands.
Lecture 9 · Optimal Control & Planning5 / 55
ACT 1It is the same problemLecture 9
The same 2×2, one level downLecture 7 set this out as two tables — here it is drawn whole
The course cube puts Lectures 7 and 9 in one cell: single agent, dynamic, model-based. Zoom into that cell and two finer coordinates appear — how large the action set is, and whether time ticks or flows. Lineage A is the finite column; lineage B is the infinite column, and deleting the model is a single vertical arrow that acts on both at once.
Lecture 7 read this grid across the columns, to say what separates it from today. Read it down the rows instead and it says something Lecture 7 could not yet: the model axis is one move, made twice — and the empty cells are outside our syllabus, not empty research fields.
Lecture 9 · Optimal Control & Planning6 / 55
ACT 1It is the same problemLecture 9
Dynamic programming, in control's notation
Define the cost-to-go from any state x at any time k:
Bellman's principle of optimalityquoted as the source deck quotes it
An optimal policy has the property that whatever the initial state and initial decision are, the remaining decisions must constitute an optimal policy with regard to the state resulting from the first decision.
Applied directly, it gives the recursion — and it is Lecture 7's, letter for letter:
V(k,x)=uk∈Ukmin{gk(x,uk)+V(k+1,fk(x,uk))}
Each uk∗ is read off as the argument attaining the right-hand side — what the source deck calls a single-shot optimisation. That phrase is worth keeping: a problem that unfolds over time has been reduced to one static optimisation performed once per instant. We meet the move again in Act 2 and again in Act 4.
Lecture 9 · Optimal Control & Planning7 / 55
ACT 1It is the same problemLecture 9
Where the expectation went
Lecture 7 — the Bellman backup
V(s)=amaxs′∑T(s,a,s′)[R+γV(s′)]
a distribution over successors,
a finite set of actions to enumerate,
reward, and max.
Lecture 9 — the DP recursion
V(k,x)=umin{gk(x,u)+V(k+1,fk(x,u))}
one deterministic successor,
a continuum of controls,
cost, and min.
Two of those three differences are cosmetic. The expectation ∑s′P[⋯] collapses to a single point because the dynamics are deterministic — put the noise back and it returns unchanged. Cost versus reward is a sign.
Solve backward in time; optimal sub-plans compose into an optimal plan. The logic is identical.
Lecture 9 · Optimal Control & Planning8 / 55
ACT 1It is the same problemLecture 9
One-step control — spend effort now to reduce the final error
Let x1=x0+u, x0=2, and minimize J(u)=u2+x12. There are no input constraints.
J(u)=u2+(2+u)2=2(u+1)2+2.
control
final state
effort cost
final-state cost
total
0
2
0
4
4
−1
1
1
1
2
−2
0
4
0
4
The optimum is u∗=−1. Reaching zero immediately costs too much effort. For any initial state, the same calculation gives the feedback ruleu∗(x)=−x/2.
Lecture 9 · Optimal Control & Planning9 / 55
ACT 1It is the same problemLecture 9
Temperature thread — derive a feedback commandshared teaching example · predict before revealing the calculation
For a measured temperature error x, minimize the known one-step cost c(u)=(x+u)2+u2. Allow a signed command for heating or cooling in this unconstrained version.
Predict: As the room gets colder, should the heating command increase? Find a rule valid for any x.
Calculate and check.dc/du=2(x+u)+2u=0 gives u∗(x)=−x/2. At x=−2, the command is 1. The rule is feedback: it recomputes the action from the current state.
This is a finite, one-step LQ problem. Its gain 1/2 need not equal the gain of an infinite-horizon problem.
Lecture 9 · Optimal Control & Planning10 / 55
ACT 1It is the same problemLecture 9
Try it — the measured error differs from the planned errorwork independently · reveal only after writing an answer
A previous prediction suggested the next error would be −1, so a precomputed command was 0.5. The next measurement instead gives x = −1.5. Using the same one-step objective, calculate the feedback command.
Check your answer.u∗=−(−1.5)/2=0.75. Reusing 0.5 ignores the new state measurement. Feedback revises the decision; it does not require the previous prediction to have been correct.
Distinguish an action sequence computed once from a state-to-action rule used after each measurement.
Lecture 9 · Optimal Control & Planning11 / 55
ACT 1It is the same problemLecture 9
The key computational difference — optimize over a continuum
In Lecture 7 the inner maxa was a loop: try each of the finitely many actions, keep the best. Here Uk is a continuum, so the inner minimisation
u∈Ukmina function of ugk(x,u)+V(k+1,fk(x,u))
is not a loop at all. It is an optimisation problem — Lecture 1's template, nested inside every backup, once per state and once per time step.
So the continuous action space is not a nuisance detail; it is the structural fact that makes this a different tradition. Everything that follows is a way of coping with it: first solve a quadratic problem explicitly (Act 2), then interpret the smooth Bellman condition (Act 3), or characterise its solution along one trajectory rather than everywhere (Act 4).
Same problem, same principle — but the backup now contains an optimisation, not a loop.
Lecture 9 · Optimal Control & Planning12 / 55
ACT 1It is the same problemLecture 9
Check — the same problem, other clothes
Optimal control minimises a cost ∫c(x,u)dt subject to dynamics x˙=f(x,u). Read as an MDP, what plays the role of the reward?
State is state, control is action, dynamics are the transition, and cost is negative reward. Operations research maximised a return; control theory minimised a cost; both are solving the same object. Keeping the translation table in view is what makes the second half of this course two parallel stories rather than two unrelated ones.
Lecture 9 · Optimal Control & Planning13 / 55
Act 2
Compute linear-quadratic feedback
Q2. Linear dynamics, quadratic cost: a useful case whose value function can be represented by a matrix.
ACT 2Compute linear-quadratic feedbackLecture 9
LQR — quadratic cost, linear feedback
Use a finite horizon, linear dynamics and unconstrained controls. Assume Q,Qf⪰0 and R≻0.
x˙=Ax+Bu,J=∫0T(x⊤Qx+u⊤Ru)dt+x(T)⊤Qfx(T).
The optimal value and feedback law take the form
V(t,x)=x⊤P(t)x,u∗(t,x)=−K(t)x,K(t)=R−1B⊤P(t).
Object
How to read it
P(t)
Future cost attached to the current state; compute backward from P(T)=Qf.
K(t)
Feedback gain: turn the measured state into a control command.
The Riccati equation computes P. First verify a scalar feedback law by ordinary calculus; the full matrix derivation follows the HJB discussion in the appendix.
Lecture 9 · Optimal Control & Planning15 / 55
ACT 2Compute linear-quadratic feedbackLecture 9
Read the gain with numbers — a scalar infinite-horizon example
Let x˙=u and J=∫0∞(x2+u2)dt. Consider stabilizing controls with x(t)→0.
Complete a square: since d(x2)/dt=2xu,
x2+u2=(u+x)2−dtd(x2).
Integrating gives a lower bound that we can attain:
J=x(0)2+∫0∞(u+x)2dt≥x(0)2.
Choose u=−x. The square is zero, so this control attains the bound. Starting from x(0)=2, the state is x(t)=2e−t and the optimal cost is 4.
The gain is 1: error 2 gives command −2, and error 0.5 gives command −0.5. This infinite-horizon continuous-time problem differs from the earlier one-step heater problem.
Lecture 9 · Optimal Control & Planning16 / 55
ACT 2Compute linear-quadratic feedbackLecture 9
Conditions behind the tidy answer
Can we control unstable motion?
For xt+1=2xt+0ut, x0=1, and state cost xt2, every control has infinite cost.
Stabilizable means every unstable mode can be controlled. Full controllability is stronger than necessary.
Does the cost see unstable motion?
Detectable means an unstable mode cannot remain invisible to the state penalty Q.
Together with Q⪰0, R≻0, this gives the standard stabilizing infinite-horizon LQR result.
Positive R makes the unconstrained minimization strictly convex. If R is singular, a minimum may still exist, but the displayed inverse formula does not apply. Input constraints also change the solution.
Lecture 9 · Optimal Control & Planning17 / 55
ACT 2Compute linear-quadratic feedbackLecture 9
LQR, runa double integrator — position and velocity as the state, force as the input
A=[0010], B=[01] — a mass you can push. Turn the dials and read the gain. The Riccati integration on the right flattens onto the algebraic solution, which is drawn as a dashed line from the closed form k1=q/r, k2=(2qr+1)/r. Cheap control (R small) buys speed with a violent input; expensive control is gentle and slow. There is no tuning here — the dials are the objective.
Lecture 9 · Optimal Control & Planning18 / 55
ACT 2Compute linear-quadratic feedbackLecture 9
Why LQR is the cornerstone
Globally optimal, and linear. For the stated unconstrained LQ problem, the Riccati solution is globally optimal. Computing that matrix usually requires numerical integration or an algebraic solver.
A useful local approximation. Linearise any smooth problem about a trajectory, take a quadratic approximation of the cost, solve the resulting LQR, re-linearise, repeat: that is iLQR / DDP, and it is the backbone of trajectory optimisation and of model-based planning in Lecture 11. (Jacobson & Mayne, 1970)
The target the data-driven world reaches for. In Lecture 10, DDPG's learned actor μθ(s) occupies exactly the place of this gain K — for a system whose A and B are unknown.
Hold u=−Kx in view: it is a known-model feedback law to compare with a learned actor. Policy-gradient methods optimize a chosen policy class from experience; they do not automatically recover this LQR optimum.
Lecture 9 · Optimal Control & Planning19 / 55
ACT 2Compute linear-quadratic feedbackLecture 9
Check — why LQR is the exception that matters
For linear dynamics and a quadratic cost, the optimal controller is u=−Kx, with K from the Riccati equation. Why does this single special case deserve a whole act?
Almost nothing is truly linear-quadratic. What LQR gives is a solvable local approximation: linearise the dynamics and take a quadratic expansion of the cost around the current trajectory, solve exactly, step, and repeat. That is iLQR, and it is how the closed form earns its place — as the inner loop of methods for problems that are not LQ at all.
Lecture 9 · Optimal Control & Planning20 / 55
Act 3
Interpret continuous-time Bellman reasoning
Q3. Let the time step shrink to nothing. What does the Bellman equation become?
The boundary condition is the terminal cost. In Lecture 7 the recursion was seeded at V(K,⋅)=gK; here it is seeded at t=T. Same seed, same backward direction.
The claim, checkedshrink Δt on a discrete backup and watch it land on the PDE
A scalar problem whose HJB solution is known exactly: x˙=x+u, cost ∫02(x2+u2)dt, so V(t,x)=P(t)x2 with P solving a Riccati ODE. The discrete backup of Act 1 is run on the Euler-discretised system at step Δt and its Pk plotted against the exact curve. Halve Δt and the error halves — first order, exactly as an Euler step should be.
Find a continuously differentiable V satisfying the PDE and terminal condition, and an admissible control attaining its minimum: the verification argument proves optimality — and the optimal control falls out of a static, pointwise minimisation:
u∗(t)=u∈Uargmin{∂xVf(t,x,u)+g(t,x,u)}
Feedback, everywhere
V is a field over the whole state space, so the rule it generates is credible from any state the system actually reaches — not only the one you predicted.
And it extends to stochastic dynamics with one extra term, 21tr(σσ⊤∂xxV).
"Sufficient" is a strong word and it is earned: a solution of the PDE is a certificate that every other admissible trajectory costs at least as much. The four-line verification argument is Backup 2, and it is the only place in this lecture where something is proved optimal rather than merely derived.
HJB is a nonlinear PDE over the entire state space.
Three prices, and each is a limitation we will spend the rest of the course working around:
It needs the model.f and g appear explicitly inside the minimisation. Delete them and there is no equation left to solve — which is Lecture 10.
It assumes V is differentiable. Often it is not; the honest fix is a weaker notion of solution (viscosity solutions), which buys existence at the cost of the clean formula. (Crandall & Lions, 1983)
It does not survive dimension. A value field over x∈Rn is exponentially large — the same curse Lecture 7's table faced, now with the table replaced by a continuum.
So HJB is the characterisation, rarely the computation. LQR is a particularly useful solvable case: a quadratic value function closes the equation. Other special problems also admit explicit solutions.
Check — what happens to Bellman in continuous time
Shrink the time step Δt→0 in the discrete Bellman equation. What do you get?
The recursion becomes a PDE. HJB is the Bellman equation with the discrete step taken to its limit, and it inherits both the strength — a sufficient condition for global optimality — and the weakness, since solving a PDE over a high-dimensional state space is exactly as hard as the curse of dimensionality suggests. The earlier LQR example avoids a state-space grid because its value has a quadratic form. The next section studies conditions along one trajectory instead.
Lecture 9 · Optimal Control & Planning26 / 55
Act 4
The other view
Q4. HJB carries a value field over every state. Is there a way in that follows only one trajectory?
ACT 4The other viewLecture 9
Adjoin the dynamics — the Hamiltonian and the costate
Q1 Same problem?Q2 LQR feedback?Q3 HJB meaning?Q4 Two views?
HJB is the Eulerian view: stand still and watch a field V(t,x) over all states. There is a Lagrangian view: ride the optimal trajectory and enforce the dynamics as a constraint along it.
This is Lecture 1's Lagrangian move, applied once per instant. Adjoin x˙=f with a multiplier λ(t) — the costate — and collect the terms into the Hamiltonian:
H(t,x,u,λ)=g(t,x,u)+λ⊤f(t,x,u)
One multiplier per instant, and a whole function λ(⋅) instead of a vector. The constraint set of Lecture 1 has become the dynamics themselves.
Lecture 9 · Optimal Control & Planning28 / 55
ACT 4The other viewLecture 9
The necessary conditions
For a smooth, fixed-horizon problem with free terminal state and no state constraints, the normal minimum principle gives these necessary conditions:
Read the shape of it. The state runs forward from x(0)=x0; the costate runs backward from λ(T); and they are coupled. This is a two-point boundary-value problem, not an initial-value problem — you cannot simply integrate.
And the last condition is the familiar move again: dynamic optimisation reduced to a static minimisation of H, freshly at each instant.
Lecture 9 · Optimal Control & Planning29 / 55
ACT 4The other viewLecture 9
What the costate actually is
Under the smooth optimal-control assumptions, the costate equals the value gradient along an optimal trajectory:
λ(t)=∂x∂V(t,x∗(t)).
View
What it carries
HJB
The value function over time and state; its gradient is available wherever the smooth solution is known.
Pontryagin
State and costate along one candidate trajectory, with endpoint conditions.
For the scalar quadratic value V(t,x)=P(t)x2, the costate is λ=2P(t)x. At the infinite-horizon solution P=1, a small state change Δx changes the value by approximately 2xΔx.
The costate measures sensitivity to the state. It is not automatically the gradient with respect to a policy's parameters. A Pontryagin candidate still needs the stated optimality checks.
Lecture 9 · Optimal Control & Planning30 / 55
ACT 4The other viewLecture 9
What does a costate measure? Use the same scalar example
For x˙=u and V(x)=x2, the costate is λ=Vx=2x.
At x=2, λ=4: increasing the state by 0.01 raises optimal future cost by approximately 4(0.01)=0.04. The exact change is 2.012−22=0.0401.
H=x2+u2+λu,Hu=2u+λ=0.
Thus u=−λ/2=−x, the same feedback law as before.
A costate is a marginal future cost. Pontryagin carries this sensitivity along a trajectory instead of solving for the whole value field.
Lecture 9 · Optimal Control & Planning31 / 55
ACT 4The other viewLecture 9
Shooting — two views, one optimumguess the costate, integrate, and see whether it lands
The same problem the HJB widget solved: x˙=x+u, ∫02(x2+u2)dt. Guess λ(0), integrate the coupled equations forward, and check whether λ(2)=0 as the transversality condition demands. Exactly one guess lands — and it is λ∗(0)=2P(0)x0, the value gradient from the other method. The dashed trace is a control that does not minimise H pointwise — and its Hamiltonian, conserved to fourteen digits when the principle is obeyed, drifts.
Lecture 9 · Optimal Control & Planning32 / 55
ACT 4The other viewLecture 9
One scalar system, three views of the same answerteaching comparison · continuous-time infinite-horizon LQR
Use x˙=u, cost ∫0∞(x2+u2)dt, and the stabilizing infinite-horizon solution.
View
Calculation
Answer
HJB
Try V(x)=Px2: 0=minu(x2+u2+2Pxu)
u=−Px, then 1−P2=0
LQR / Riccati
A=0,B=1,Q=R=1 gives 1−P2=0
choose stabilizing P=1
Pontryagin
H=x2+u2+λu, Hu=0
u=−λ/2; along this solution λ=2x
Thus all three are consistent with u=−x, x(t)=x0e−t and V(x0)=x02. At x0=2, the total cost is 4.
Agreement here comes from the LQ structure and the stabilizing solution. Pontryagin's conditions alone do not certify an arbitrary nonlinear candidate as globally optimal. Compare the mathematical guarantees as well as the answer.
Lecture 9 · Optimal Control & Planning33 / 55
ACT 4The other viewLecture 9
HJB versus Pontryagin — distinguish what each certifies
HJB (dynamic programming)
Pontryagin (minimum principle)
view
Eulerian — a value fieldV(t,x)
Lagrangian — one trajectoryx∗(t)
logic
sufficient, over all (t,x)
necessary, along the optimum
output
a feedback law γ(t,x)
an open-loop u∗(t), from a costate ODE
mathematics
a nonlinear PDE
a two-point boundary-value ODE
stochastic
second-order HJB
stochastic maximum principles exist; beyond this lecture
cost
the curse of dimensionality
one trajectory; necessity alone does not certify a minimum
Feedback beats an open-loop plan for the reason Lecture 7 already gave: γ(t,x) is valid from any state you actually reach, while u∗(t) is valid only along the trajectory you predicted. But Pontryagin scales where HJB cannot, which motivates trajectory methods, alongside direct optimization approaches. Its machinery returns in Lecture 10 — REINFORCE is a trajectory view — and in Lecture 11, where a learned policy imitates an iLQR teacher.
Lecture 9 · Optimal Control & Planning34 / 55
ACT 4The other viewLecture 9
Check — the parallel about to be drawn
Lecture 8 deleted P and R from the MDP and got value-based RL. Lecture 10 deletes what from optimal control?
The two lineages lose their model in exactly the same way, one lecture apart. Delete P from dynamic programming and you must sample the expectation; delete f from optimal control and you can no longer differentiate through the rollout, so you must estimate the gradient from trajectories instead. Same deletion, two different repairs — and Lecture 11 gets the model back.
Lecture 9 · Optimal Control & Planning35 / 55
CLOSING
Closing
Both model-based origins are now on the table. Each one leaned entirely on knowing f.
CLOSINGLecture 9
Where we are — three tools, different guarantees
Lineage A · OR / Dynamic Programming
Lineage B · Control Theory
Model-based (origin)
MDP & Dynamic ProgrammingLecture 7
Optimal Control / PlanningLecture 9
Data-driven (extension)
Value-Based RLLecture 8
Policy-Based RLLecture 10
Three mathematical tools with different roles; numerical solutions still need checking:
what it gives
what it needs
LQR
linear feedback u=−Kx; compute the Riccati matrix
the stated unconstrained LQ model and horizon assumptions
HJB
a value over (t,x) and an optimal feedback law
dynamics, cost, terminal condition and a smooth admissible solution
Pontryagin
necessary conditions for candidate trajectories
f, g, and ∂xf
HJB can verify an admissible solution; LQR solves its special case; Pontryagin provides necessary conditions. All use the dynamics.
Lecture 9 · Optimal Control & Planning37 / 55
CLOSINGLecture 9
What we hand on
Lecture 9 leavesthe feedback law γ(x), and u=−Kx
Lecture 10 deletes fand learns a parameterised feedback controller from data
Lecture 10 follows the same teaching move as Lecture 8: keep the decision objective, but learn from experience when a complete model is unavailable. The linear gain K is one feedback policy. A network μθ(s) is a more general policy class trained using sampled performance; it is not guaranteed to recover the LQR solution or a global optimum.
A learned actor can avoid a fresh continuous action search at every step. The difficulty moves into training and evaluating that actor.
Lecture 9 · Optimal Control & Planning38 / 55
Bellman and optimal control study the same sequential decision structure.
HJB can verify a value function and feedback law; LQR solves a structured special case; Pontryagin supplies necessary conditions for candidate trajectories. Their guarantees and computational requirements differ.
Questions?
Two traditions, one destination. Bellman wrote the same equation twice — once as a sum over a table, once as a partial differential equation — and LQR gives a central case where the value field reduces to a matrix. Everything after this is what happens when you are no longer told f.
APPENDIX
Backup slides
Complete arguments, kept out of the narrative.
APPENDIXBackup slidesLecture 9
Reading guide — solve the same system using different mathematical toolsone main idea to explain, one comparison, one application
Why does the linear-quadratic special case admit a tractable controller?
Compare
HJB verification, Riccati/LQR and Pontryagin necessary conditions
Which method gives a value function, a gain, or candidate trajectory conditions?
Apply
One scalar system solved three ways, then the original control examples
Do the methods agree under the stated LQ assumptions?
The same small problem is the main comparison. HJB and Pontryagin derivations are advanced reading; their historical importance does not make every technical step a prerequisite for computing feedback.
Lecture 9 · Optimal Control & Planning42 / 55
APPENDIXBackup slidesLecture 9
Backup 1 — the HJB equation, derived in one step
Start from Bellman's optimality principle over a short interval δ:
V(t,x)=u∈Umin{g(t,x,u)δ+V(t+δ,x+f(t,x,u)δ)}+o(δ)
Taylor-expand the second term about (t,x):
V(t+δ,x+fδ)=V(t,x)+∂t∂Vδ+∂x∂Vf(t,x,u)δ+o(δ)
Substitute, cancel V(t,x) from both sides — it is free of u, so it passes through the minimum — divide by δ and let δ→0:
Compare Lecture 7's derivation of the Bellman optimality equation: identical, with δ→0 in place of a one-step sum. The minimising u at each (t,x) is the optimal feedback — a static pointwise minimisation embedded inside a PDE for V.
Lecture 9 · Optimal Control & Planning43 / 55
APPENDIXBackup slidesLecture 9
Backup 2 — why HJB is sufficient: the verification argument
Suppose V is continuously differentiable and satisfies HJB. Take any admissible γ∈Γ, with trajectory x, alongside an admissible minimizing candidate γ∗ with x∗, both at the same fixed terminal time T. Also require V(T,x)=q(T,x). Because the HJB right-hand side is a minimum over u, the arbitrary control can only do worse, while the minimising control attains it exactly:
Eliminate V(0,x0) between them and apply the boundary condition V(T,x)=q(T,x):
L(u)=∫0Tgdt+q(T,x(T))≥∫0Tg∗dt+q(T,x∗(T))=L(u∗)■
A solution of the PDE is therefore a certificate: no admissible strategy beats γ∗, from any initial state. This is exactly what Pontryagin's conditions do not give — they are stationarity conditions, satisfied by every extremal, optimal or not.
Lecture 9 · Optimal Control & Planning44 / 55
APPENDIXBackup slidesLecture 9
Backup 3 — LQR: the Riccati derivation, both times
Continuous time.x˙=Ax+Bu, running cost g=x⊤Qx+u⊤Ru. Guess V(t,x)=x⊤Ptx, so ∂xV=2Ptx and ∂tV=x⊤P˙tx. HJB reads
−x⊤P˙tx=umin{2x⊤Pt(Ax+Bu)+x⊤Qx+u⊤Ru}
Minimise over u: 2B⊤Ptx+2Ru=0⇒u∗=−R−1B⊤Ptx. Substitute back and match x⊤(⋅)x for all x:
−P˙t=A⊤Pt+PtA−PtBR−1B⊤Pt+Q
Infinite horizon: P˙→0, giving the algebraic Riccati equation A⊤P+PA−PBR−1B⊤P+Q=0 under the stabilizability and detectability assumptions above, with a unique PSD stabilizing solution, hence the constant gain K=R−1B⊤P and u∗=−Kx.
Discrete time. With xt+1=Axt+But and V(z)=z⊤Pz, the backup is z⊤Pz=minw{z⊤Qz+w⊤Rw+(Az+Bw)⊤P(Az+Bw)}, whose minimiser is w∗=−(R+B⊤PB)−1B⊤PAz. Substituting and matching for all z:
P=Q+A⊤PA−A⊤PB(R+B⊤PB)−1B⊤PA,K=(R+B⊤PB)−1B⊤PA
Under stabilizability and detectability, the ARE has a unique positive-semidefinite stabilizing solution. Started from P1=Q, the recursion converges to it — value iteration, on a matrix. This discrete form is the one a learned critic implicitly targets in Lecture 10.
Lecture 9 · Optimal Control & Planning45 / 55
APPENDIXBackup slidesLecture 9
Backup 4 — Euler–Lagrange to the minimum principle
Adjoin the dynamics with a costate λ(t) and form H=g+λ⊤f:
Jˉ=∫0T[H(t,x,u,λ)−λ⊤x˙]dt+q(x(T))
Perturb the optimal control, u∗→u∗+ϵp(t), and require dϵdJˉϵ=0=0 for every admissible p. Integrating by parts and collecting terms gives
x˙∗=∂λ∂H=f,λ˙∗=−∂x∂H,λ(T)=∂x∂q,∂u∂H=0
From Euler–Lagrange to Pontryagin. Stationarity, ∂uH=0, presumes u is interior to U. Pontryagin replaces it with the global condition u∗=argminu∈UH(t,x∗,u,λ∗), which remains valid on the boundary of U — so it covers saturated actuators and bang-bang controls, where the derivative never vanishes.
A conserved quantity. Along a trajectory dtdH=∂u∂Hu˙+∂t∂H; for a time-invariant problem the second term vanishes and along a smooth interior extremal the first vanishes because Hu=0. Thus H is constant there; constancy alone does not prove optimality or that the minimum principle holds — the invariant the Act 4 widget plots. The minimum principle is also the standard way to state equilibrium conditions for dynamic games, which is how IE579 uses it.
Lecture 9 · Optimal Control & Planning46 / 55
APPENDIXBackup slidesLecture 9
Same problem, different dialect
The fixed point of the whole lecture, in one line:
Control theory and dynamic programming are two dialects for one dynamic optimum.
Where Lecture 7 had a stochastic transition over a finite set of states, control theory studies a system — usually continuous, often deterministic — driven by a control:
The goal is identical to Lecture 7's: not a plan, but a feedback lawu=γ(t,x) — the best control at every state and every time. The differences are of tradition, not of substance:
sum → integral; reward and max→ cost and min; a backup → a PDE.
Lecture 9 · Optimal Control & Planning47 / 55
APPENDIXBackup slidesLecture 9
One wall Lecture 8 left, and where it actually landsthe continuous-argmax problem — a meeting point, not the premise
Lecture 8 ended at a wall: with a continuum of actions, maxa′Q(s′,a′) cannot be found by enumerating a finite action list. A generic action maximum may require a costly numerical optimization.
That wall is not this lecture's starting point — we begin from Lecture 7, not Lecture 8. But it is one of the seams where the two lineages meet, and it is worth naming now because it recurs three times today:
where
the same inner problem
what happens to it
Act 1 · the DP backup
minu∈U{g+V(f(x,u))} over a continuum
it becomes a nested Lecture-1 problem
Act 2 · LQR
the identical min, with g quadratic and f linear
solved in closed form, one line of algebra
Act 4 · Pontryagin
minu∈UH at each instant
reduced to a static minimisation
Control theory has lived with the continuous argmin since 1956, and its three answers are today's acts. Lecture 10's answer — learn a network that outputs the minimiser — is the fourth, and it is a descendant of the third.
Lecture 9 · Optimal Control & Planning48 / 55
APPENDIXBackup slidesLecture 9
The translation table — Lecture 7 in continuous time
Every object of dynamic programming has a control-theoretic twin. Keep this in sight all lecture.
Lecture 7 (OR / dynamic programming)
Lecture 9 (control)
The shift
transition T(s,a,s′)
dynamics x˙=f(t,x,u)
probabilistic → differential
reward R, maximise
cost g, minimise
a sign, and a culture
value V(s), Q(s,a)
cost-to-go V(t,x)
state → state and time
policy π(s)
feedback law u=γ(t,x), u=−Kx
a rule, now continuous-valued
Bellman optimality (sum, max)
HJB equation (PDE, min)
a backup → a PDE
value iteration
the Riccati recursion
the same sweep, on a matrix
policy iteration / LP
Riccati / Pontryagin
a solver, not a sampler
Read it as one claim: HJB is the Bellman optimality equation made infinitesimal. Lecture 7's intuition transfers wholesale; only the calculus changes. And keep the last two rows in view — that is the seam where, in Lecture 10, samples will replace the solver.
Lecture 9 · Optimal Control & Planning49 / 55
EXTENSION
Derivations — HJB and Riccati in detail
Read after completing the main route.
EXTENSIONDerivations — HJB and Riccati in detailLecture 9
Shrink the step — and a backup becomes a PDE
Apply the principle of optimality over a short interval δ, then let δ→0:
V(t,x)=u∈Umin{g(t,x,u)δ+V(t+δ,x+f(t,x,u)δ)}+o(δ)
Taylor-expand the second term, cancel V(t,x) from both sides, divide by δ and take the limit. Assuming V is continuously differentiable, what survives is the Hamilton–Jacobi–Bellman equation:
This is the Bellman optimality equation. It has become a nonlinear PDE for V.
The full three-line derivation is Backup 1. Compare it with Lecture 7's: identical, with δ→0 where Lecture 7 had a one-step sum.
Lecture 9 · Optimal Control & Planning51 / 55
EXTENSIONDerivations — HJB and Riccati in detailLecture 9
The Riccati equation, and a gain that stops moving
Substitute u∗ back and match x⊤(⋅)x for all x. What is left is an ODE in the matrix Pt alone:
−P˙t=A⊤Pt+PtA−PtBR−1B⊤Pt+Q,PT=Qf
the Riccati differential equation, integrated backwards in time — a backward sweep, exactly like Lecture 7's.
For infinite-horizon LQR, standard sufficient assumptions are stabilizability of (A,B) and detectability of (Q1/2,A), with R≻0. The stabilizing Riccati solution gives a stationary value and gain:
And so the optimal controller is a matrix: u∗=−Kx, K=R−1B⊤P.
The discrete-time problem xt+1=Axt+But, J=∑(x⊤Qx+u⊤Ru) runs the identical argument and lands on P=Q+A⊤PA−A⊤PB(R+B⊤PB)−1B⊤PA with K=(R+B⊤PB)−1B⊤PA. Backup 3 carries both derivations in full.
Lecture 9 · Optimal Control & Planning52 / 55
EXTENSIONDerivations — HJB and Riccati in detailLecture 9
The Riccati recursion is value iteration
The single sharpest bridge between Lecture 7 and Lecture 9, and it comes free with the discrete-time form.
Pk+1=Q+A⊤PkA−A⊤PkB(R+B⊤PkB)−1B⊤PkA,P1=Q
Lecture 7
Lecture 9
Vk+1←maxaE[R+γVk]
Pk+1← the Riccati map
Vk is a table, one entry per state
Pk is an n×nmatrix
converges to the unique fixed point V∗
converges to the unique PSD solution of the ARE
a sweep touches every state
a matrix recursion represents values over a continuum of states
Value iteration, with the value function carried in closed form instead of enumerated. The uniqueness of the positive-semidefinite P plays the role of the uniqueness of the Bellman fixed point, and — the source deck's own remark — infinite-horizon LQR is just steady-state finite-horizon LQR. One backward sweep, run to convergence.
Lecture 9 · Optimal Control & Planning53 / 55
EXTENSIONDerivations — HJB and Riccati in detailLecture 9