Optimization of Dynamic Systems
Why dynamic optimization is different¶
In static optimization, the model returns quantities for one design condition. In dynamic optimization, the model generates trajectories over time. Objectives and constraints may depend on the entire trajectory rather than on one scalar state.
Optimization of a dynamic system: design decisions enter the model, whose time histories determine performance and feasibility.
General formulation¶
A dynamic optimization problem can be written as
The objective combines a terminal term , such as final error or energy, and an integral term , such as accumulated tracking error, fatigue, energy, or control effort.
Path and boundary constraints¶
Path constraints must hold throughout the time interval:
Examples include actuator, displacement, temperature, contact-force, power, and stress limits. A violation may occur between sampled times, so the discretization must be fine enough to detect it.
Boundary constraints apply at the initial or final time, for example
Simulation-based optimization¶
A common workflow is to select design variables, simulate the dynamic model, compute objectives and constraints from the resulting trajectories, and return them to the optimizer. This works naturally when control is parameterized by a few variables. Optimizing an entire control trajectory requires specialized optimal-control transcription methods.
A small CCD formulation¶
For
let , , , and be decisions and use . One possible objective is
Possible constraints include , , and bounds on , , , and . This is already a CCD problem because plant and controller variables are optimized together.
Activity 3.6: Discrete Adjoint Sensitivities for Simulation-Based Optimization¶
Activity 3.6: Discrete Adjoint Sensitivities for Simulation-Based Optimization
Consider the nonlinear time-marching model
with
The design variables are
Minimize
where
Derive the direct sensitivity recursion for
Determine the computational complexity of forming the complete gradient using direct sensitivities.
Introduce a discrete adjoint sequence and derive its backward recursion.
Derive
Implement direct sensitivity, adjoint sensitivity, forward finite difference, central finite difference, and complex-step gradients.
Perform a directional-derivative test using a random normalized direction :
Compare gradient errors for
Compare computational cost as increases from 100 to .
Explain why the adjoint method is especially attractive when the number of design variables is large and the number of scalar outputs is small.
Use an optimization solver to minimize subject to