Dynamics (MIT 16.07) - Lecture 21: Optimization Crash Course
Overview
Zac Manchester introduces optimization as the foundation for system identification, where model parameters are fit to measured data, and connects root finding, dynamics, and minimization through derivative-based methods. He develops Newton's method and Hessian tests for unconstrained problems, then derives equality-constrained optimality conditions using Lagrange multipliers and the optimization Lagrangian.
Key takeaways
- System identification fits physical model parameters such as mass, length, and inertia by minimizing the mismatch between measured trajectories and model predictions.
- Newton's method finds a root by solving a local linearized problem, and near a solution its quadratic convergence can roughly double the number of correct digits per iteration.
- Backward Euler is an implicit time-stepping method that can be implemented by solving a residual equation with Newton's method; in the pendulum example it introduces artificial damping.
- A zero gradient is necessary but not sufficient for a minimum: Hessian curvature distinguishes minima, maxima, and saddle points through its eigenvalues.
- For equality-constrained minimization, the objective gradient at an optimum is a combination of constraint normals, expressed by ∇f + Jc^Tλ = 0 alongside c(x) = 0.
Chapters
- The prior lecture covered the three-body problem, effective potential, Lagrange points, halo orbits, and low-energy trajectory design.
- Zac Manchester frames system identification as fitting model parameters such as mass, length, and inertia to measured system data.
- The lecture's optimization crash course prepares for least-squares fitting of observed trajectories against model predictions.
- For a scalar function f: R^n → R, ∂f/∂x is a 1-by-n row vector so it maps an input perturbation δx to a scalar change.
- For a vector function g: R^m → R^n, ∂g/∂y is an n-by-m Jacobian, with matrix multiplication preserving the multivariable chain rule.
- Manchester writes ∇f as the column-vector gradient and ∇²f as the n-by-n Hessian used in second-order Taylor expansions.
- Root finding seeks x* such that f(x*) = 0; when f is a continuous-time dynamics function, the root is an equilibrium.
- For a discrete-time update x(k+1) = f(x(k)), an equilibrium appears as a fixed point satisfying f(x*) = x*.
- The continuous-time root and discrete-time fixed-point formulations describe closely related stationary states.
- A simple way to find a stable equilibrium is to simulate the dynamics forward and let the state converge.
- This approach requires an initial state inside the equilibrium's basin of attraction, and it may converge slowly.
- Weak dissipation can make convergence take a long time, while an unstable equilibrium generally cannot be found by forward simulation.
- Newton's method approximates f near the current x with f(x) + (∂f/∂x)δx and chooses δx to make that linear model zero.
- The update is x ← x − (∂f/∂x)⁻¹f(x), repeated until the residual converges.
- In dynamics terms, the method linearizes the system and uses the local Jacobian to calculate a correction.
- Backward Euler uses x(k+1) = x(k) + h f(x(k+1)), evaluating the dynamics at the unknown future state.
- Manchester defines a residual r(x(k+1), x(k)) = x(k+1) − x(k) − h f(x(k+1)) and solves r = 0 with Newton's method.
- A pendulum simulation shows backward Euler can be solved by both Newton iteration and fixed-point iteration, with matching results in the example.
- The pendulum example shows backward Euler's artificial damping: undamped oscillations shrink numerically, unlike the energy growth associated with forward Euler.
- Newton's method converges much faster than fixed-point iteration in the example, reducing the residual to near zero in roughly three steps.
- Near a solution, Newton's method has quadratic convergence, so the number of accurate digits can roughly double per iteration.
- The lecture connects optimization to dynamics by treating stationary points of an objective as equilibria of gradient-related dynamics.
- For a smooth unconstrained objective f: R^n → R, an interior minimum must satisfy ∇f(x) = 0.
- Applying Newton's method to the gradient uses the Hessian as the Jacobian and gives δx = −(∇²f)⁻¹∇f.
- This step can be understood as fitting a local quadratic approximation to the objective and minimizing that quadratic.
- A one-dimensional objective with two local minima shows that Newton's method's destination depends on the starting point.
- Starting in different basins leads to different local minima, while a start near a stationary maximum can converge uphill to that maximum.
- Newton's method solves for a zero gradient, so it does not distinguish minima from maxima or saddle points by itself.
- The condition ∇f = 0 is first-order necessary for a smooth local minimum, but is not sufficient.
- In one dimension, positive second derivative indicates a local minimum and negative second derivative indicates a local maximum.
- In multiple dimensions, positive Hessian eigenvalues indicate a local minimum, negative eigenvalues indicate a maximum, and mixed signs indicate a saddle.
- A positive-definite Hessian produces a descent-oriented Newton step locally; negative curvature can reverse the step and send it uphill.
- For a twice-differentiable function, a positive-semidefinite Hessian throughout the domain characterizes convexity; positive curvature throughout corresponds to strong convexity.
- Convex objectives are valuable because local minima are global minima, although practical Newton methods may still require safeguards.
- Adding αI to the Hessian is a regularization strategy that can make the curvature matrix positive definite and move the update toward gradient descent.
- The constrained problem minimizes scalar f(x) subject to vector constraints c(x) = 0, where c: R^n → R^m.
- At a constrained optimum, the objective gradient must vanish along directions that remain feasible, while the constraints themselves must be satisfied.
- Examples from dynamics include unit-norm quaternion constraints and orthogonality constraints on rotation matrices.
- Keeping constraints explicit can reveal joint loads and support modular models of complex articulated systems.
- For a smooth equality constraint, the feasible directions lie along the constraint surface, so the objective gradient at an optimum must be normal to that surface.
- The normal condition is expressed as ∇f + Jc(x)^T λ = 0, with λ containing one multiplier per constraint.
- In the two-dimensional bowl example, the constrained minimum occurs where the objective gradient is parallel to the constraint normal.
- Manchester defines the optimization Lagrangian as L(x, λ) = f(x) + λ^T c(x), closely related to the Lagrangian used in dynamics.
- Setting the gradient of L with respect to x to zero gives the stationarity condition; setting its gradient with respect to λ to zero recovers c(x) = 0.
- Together, these first-order conditions form a root-finding problem that can be solved with Newton's method.
Transcript excerpt
0:00 So, what did we do last time? Uh this was our pre-Thanksgiving lecture that kind of capped off our orbit mechanics discussion and we talked about the threebody problem and kind of a bunch of things related to that including um let's see effective potential which is kind of this idea of going into a rotating frame that rotates with the primary planets. um and you get this term in the potential that kind of is basically a centrifugal term. Uh then we talked about equilibria in the circular circuit three body problem which are called lrangee points or libration points and we talked about halo orbits
0:52 which are these kind of very nonlinear kind of out of plane orbits around these uh lrangee points that are sort of quasi stable. We talked about stable and unstable manifolds that um approach and leave these halo orbits and kind of go all over the place in kind of very fractally chaotic ways that you can use to design um low energy uh trajectories. And then we talked a little bit about how kind of modern low energy trajectory kind of mission design works using these kind of techniques. really cool stuff. If you're into this, come talk to me. Lots of lots of cool things to talk about there. Um, okay. Any questions about that stuff? Cool.
1:40 So, we're now done with kind of the main, frankly, like the main topics of the course, which are like kind of, you know, the lrangeian stuff, rigid body stuff, and orbit mechanics stuff. Those are kind of the meat of the course that we like had to cover. So now we're kind of in this like I would say bonus time towards the end where we can do some slightly off thebeaten path things and
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
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, MIT Robotic Exploration Lab.