Stanford AA203 Optimal and Learning-Based Control | Spring 2026 | Lecture 4: Indirect Methods
Overview
This lecture from Stanford's AA203 Optimal and Learning-Based Control course, taught by Stanford Online, delves into indirect methods for optimal control, building upon the fundamental theorem of calculus of variations. It explains how to derive necessary optimality conditions, exemplified by finding the shortest path between two points, and then extends these methods to handle free boundary conditions and system dynamics constraints using Lagrangians and costate variables. The lecture concludes by outlining the derivation of optimality conditions for optimal control problems with unbounded controls, introducing the Hamiltonian and its application to a particle dynamics example.
Key takeaways
- Indirect methods for optimal control transform infinite-dimensional optimization problems into solving differential equations derived from necessary optimality conditions.
- The Euler equation, derived from the calculus of variations, is a key tool for finding optimal paths, exemplified by the shortest path problem yielding a straight line.
- Generalized boundary conditions are crucial for determining integration constants when final states or times are not fixed, derived from variations in the Hamiltonian.
- The Hamiltonian formulation (H = g + p^T*f) provides a systematic way to derive optimality conditions (x_dot, p_dot, dH/du=0) for optimal control problems.
- The example of a particle controlled by acceleration demonstrates how to apply the Hamiltonian method, solve the resulting differential equations, and use boundary conditions to find the optimal control and trajectory.
Chapters
- Recap of the roadmap, focusing on open-loop optimal control methods.
- Indirect methods define necessary optimality conditions for infinite-dimensional optimization problems.
- Key concept: extending finite-dimensional optimization to functionals (functions of functions).
- The variation of the cost functional J must vanish at an optimal solution x*.
- This condition is analogous to the gradient being zero in finite-dimensional optimization.
- This theorem provides necessary but not always sufficient conditions for optimality.
- Focus on a simplified problem where the state trajectory is directly controlled.
- Derivation of the Euler equation as an actionable optimality condition.
- The Euler equation is a second-order nonlinear ODE with split boundary conditions.
- Defining the functional J as the integral of ds, representing path length.
- Approximating ds using Pythagorean theorem: ds = sqrt(dt^2 + dx^2).
- Functional J = integral(sqrt(1 + x_dot^2)) dt.
- Calculating partial derivatives of g(x, x_dot) = sqrt(1 + x_dot^2).
- g_x = 0, g_x_dot = x_dot / sqrt(1 + x_dot^2).
- The Euler equation simplifies to d/dt(g_x_dot) = 0.
- The derived Euler equation is x_double_dot = 0.
- Integrating twice yields x(t) = c1*t + c2, the equation of a line.
- This proves that a straight line is a candidate for the shortest path.
- Transitioning from calculus of variations to actual optimal control problems.
- Relaxing assumptions on fixed boundary conditions (final time and state).
- Need for more sophisticated boundary conditions to determine constants of integration.
- A general boundary condition equation involving variations in xf and tf.
- Specific cases arise depending on whether xf and tf are fixed or free.
- Example: If tf is fixed and xf is free, then dg/dx_dot(tf) = 0.
- Problem: Find shortest path from x(0)=1 to a free x(tf) at fixed tf=5.
- Euler equation still yields x(t) = c1*t + c2.
- Initial condition x(0)=1 implies c2=1, so x(t) = c1*t + 1.
- Case: tf fixed, xf free. Additional condition: dg/dx_dot(tf) = 0.
- dg/dx_dot = x_dot / sqrt(1 + x_dot^2).
- Setting dg/dx_dot(tf) = 0 implies x_dot(tf) = 0.
- x(t) = c1*t + 1, so x_dot(t) = c1.
- x_dot(tf) = 0 implies c1 = 0.
- Solution: x(t) = 1, a constant path.
- Considering constraints that link the function (states) with its derivative (controls).
- Introducing w = (x, u) and an augmented integrand g(a) = g + p^T * f.
- This is analogous to using Lagrange multipliers in finite-dimensional optimization.
- Defining the Hamiltonian H = g(x, u, t) + p^T * f(x, u, t).
- Optimality conditions involve Euler-Lagrange equations on the Hamiltonian.
- Conditions: x_dot = dH/dp, p_dot = -dH/dx, dH/du = 0.
- Objective: Minimize J = integral(g(x, u, t)) dt + terminal_cost(x(tf), tf).
- System dynamics: x_dot = f(x, u, t).
- Focus on deriving necessary optimality conditions without control bounds.
- Define Hamiltonian H = g(x, u, t) + p^T * f(x, u, t).
- Conditions: x_dot = dH/dp, p_dot = -dH/dx, dH/du = 0.
- Boundary conditions depend on whether x(tf) and tf are fixed or free.
Transcript excerpt
0:05 So as usual, let's start from our classic roadmap just to have an exact point of where we are right now. So over the last week or so, we started approaching this quadrant of the roadmap. Specifically, we started looking at open loop methods for optimal control. Last Monday, we started looking at indirect methods for optimal control. And we'll spend also today in this box over here and Monday. Then next week Wednesday we'll move to direct methods for open loop optimal control. And then we'll move towards closed loop methods in the following weeks. And I just want to make sure that we have the key takeaways in place. And specifically, when on Monday we introduced indirect methods, we essentially said that indirect methods
0:55 are a way of defining necessary optimality conditions for optimal control problems in their infinite dimensional optimization case. And specifically, again, what I mean by infinite dimensional is that we want to optimize with over functionals, which are in and of itself, loosely speaking, defined as functions over functions. So we want to find the optimal control u star of t that optimizes a given functional that is given to us. And again, u of t is a continuous signal in the sense that it is defined between some time t0 and tf. And again, loosely speaking, it represents
1:42 to optimizing the full control signal over time. And in order to derive these necessary optimality conditions, we had to extend basically everything we know from the domain of finite dimensional optimization. And essentially derived a key result, which is the fundamental theorem of calculus of variation. So these slides are not the ones you will find online. These are just some selected slides from Monday just to recap. And the key result is this fundamental theorem of calculus
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Stanford Online.