0.4 Optimization and Discretization
Optimization provides a precise language for stating what may change, what should improve, and what conditions must remain satisfied. Discretization then converts continuous-time functions into finite vectors that numerical algorithms can manipulate.
Basic optimization language¶
Optimization problem structure¶
A constrained optimization problem can be written as

The principal parts of an optimization problem.
Core terms¶
Decision variables: Quantities the optimizer is allowed to change.
Objective function: The quantity being minimized or maximized.
Constraints: Conditions that a solution must satisfy.
Feasible point: A point that satisfies every constraint.
Feasible region: The set of all feasible points.
Optimal point: A feasible point with the best objective value, according to the stated problem.
Example optimization statement¶
A simple engineering design problem is
This statement specifies the quantities being chosen, the performance measure being improved, and the bounds that must hold.
How CCD builds on this structure¶
A CCD problem uses the same optimization language but adds dynamic-system structure. Its decision variables include plant and controller quantities, while its constraints often include state equations over time:
The objective may also depend on an entire trajectory rather than on a few static variables.
Discretization and sampled variables¶
Why discretization is needed¶
Many CCD problems are naturally continuous in time. Numerical optimizers, however, operate on finite-dimensional vectors rather than on arbitrary continuous functions. Continuous trajectories must therefore be approximated by samples or coefficients.
Time mesh¶
Divide a time interval into nodes:
The width of interval is
The mesh is uniform if every is equal and nonuniform otherwise.
Sampled states and controls¶
At each node, approximate the state and control by
If the control is scalar, its sampled trajectory becomes the finite vector

A continuous trajectory becomes a finite vector when sampled on a time mesh.
From differential equations to algebraic constraints¶
Discretization must also enforce the system dynamics. A simple forward-Euler approximation is
Substituting this approximation into
gives the algebraic relation
Higher-accuracy methods use different approximations, but the central idea remains: a continuous-time model becomes a finite set of algebraic equations.
Why this matters later¶
This conversion underlies direct shooting, multiple shooting, direct transcription, and collocation. It also introduces important numerical questions:
Is the mesh fine enough to represent the trajectory accurately?
Does the discrete objective approximate the intended continuous objective?
Do the discrete dynamics enforce the original ODE closely enough?
Does refining the mesh change the apparent optimum?
Activity 0.5: Discretized Minimum-Energy Control Solved by Linear Algebra¶
Activity 0.5: Discretized Minimum-Energy Control Solved by Linear Algebra
Consider the double-integrator system
Use a time horizon divided into four equal intervals of length . Assume the control is piecewise constant:
Use the exact zero-order-hold discrete dynamics
The terminal requirements are
and the discrete control-effort objective is
Propagate the dynamics symbolically and express the terminal state as
Write the terminal requirements as .
Show that the problem is a minimum-norm equality-constrained quadratic problem.
Using Lagrange multipliers, prove that
Compute all four optimal control values.
Compute the complete state trajectory at the five time nodes.
Verify the terminal conditions exactly.
Repeat the derivation for an arbitrary number of equal intervals.
Explain how the dimensions of , , and change with .
Compare the discrete solution with the continuous minimum-energy control obtained by calculus of variations or an optimal-control solver.