Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

State Trajectories and Dynamic Equality Constraints

Time-dependent decisions

Dynamic optimization involves functions of time. The state and control trajectories are

x(t)Rnx,u(t)Rnu,t[t0,tf].\mathbf{x}(t)\in\mathbb{R}^{n_x}, \qquad \mathbf{u}(t)\in\mathbb{R}^{n_u}, \qquad t\in[t_0,t_f].
State and control trajectories plotted over a common time interval.

State and control trajectories must evolve consistently with the system dynamics and constraints.

Trajectories matter because comfort, energy, tracking, stress, and control effort depend on behavior over an interval—not merely one instant. Initial and terminal conditions may be fixed or constrained:

x(t0)=x0,x(tf)Xf.\mathbf{x}(t_0)=\mathbf{x}_0, \qquad \mathbf{x}(t_f)\in\mathcal{X}_f.

The final time may itself be fixed or optimized.

Dynamics as equality constraints

The dynamics enforce physical laws. A general continuous-time model is

x˙(t)=f(x(t),u(t),xp,xc,d(t),t).\dot{\mathbf{x}}(t)= \mathbf{f}(\mathbf{x}(t),\mathbf{u}(t),\mathbf{x}_p,\mathbf{x}_c,\mathbf{d}(t),t).

This is an equality constraint restricting the feasible trajectory set.

Candidate trajectories entering a dynamics residual, with only trajectories satisfying the equality admitted as feasible.

The optimizer must search among trajectories that satisfy the physical model.

In residual form,

x˙(t)f(x(t),u(t),xp,xc,d(t),t)=0,t[t0,tf].\dot{\mathbf{x}}(t)- \mathbf{f}(\mathbf{x}(t),\mathbf{u}(t),\mathbf{x}_p,\mathbf{x}_c,\mathbf{d}(t),t)=\mathbf{0}, \qquad t\in[t_0,t_f].

Mass–spring–damper example

Let xp=[m,c,k]T\mathbf{x}_p=[m,c,k]^T, x1=xx_1=x, and x2=x˙x_2=\dot{x}. Then

x˙1=x2,x˙2=kmx1cmx2+1mu.\dot{x}_1=x_2, \qquad \dot{x}_2=-\frac{k}{m}x_1-\frac{c}{m}x_2+\frac{1}{m}u.

These equations define the feasible state trajectories for any candidate plant and control input.

Other equality constraints

CCD formulations may also contain algebraic equalities for kinematic loop closure, geometric compatibility, steady-state equations, periodicity, and actuator or sensor calibration. The equality set can therefore be larger than the state equations alone.

Differential-algebraic form

When the dynamics contain algebraic equalities in addition to the state derivatives, the model is a differential-algebraic equation (DAE) rather than a plain ODE. In semi-explicit form,

x˙(t)=f(x(t),γ(t),u(t),xp,xc,t),0=fa(x(t),γ(t),u(t),xp,xc,t),\dot{\mathbf{x}}(t)=\mathbf{f}(\mathbf{x}(t),\boldsymbol{\gamma}(t),\mathbf{u}(t),\mathbf{x}_p,\mathbf{x}_c,t), \qquad \mathbf{0}=\mathbf{f}_a(\mathbf{x}(t),\boldsymbol{\gamma}(t),\mathbf{u}(t),\mathbf{x}_p,\mathbf{x}_c,t),

where γ(t)\boldsymbol{\gamma}(t) is an algebraic variable: a quantity that must satisfy the algebraic constraint fa()=0\mathbf{f}_a(\cdot)=\mathbf{0} at every instant but has no derivative of its own appearing in the model. Solving the algebraic equation in Eq. (6) for γ(t)\boldsymbol{\gamma}(t) requires that the Jacobian fa/γ\partial\mathbf{f}_a/\partial\boldsymbol{\gamma} be nonsingular; a DAE with this property is called index-1, where the index counts how many times the algebraic equations must be differentiated before the system reduces to an ordinary differential equation. Index-1 DAEs are the most tractable case and the one nearly all CCD dynamic-optimization software targets.

Algebraic variables arise naturally in CCD. Kinematic loop closure and geometric compatibility, mentioned above, are two sources; another is a path inequality constraint that becomes active during part of the trajectory. Every time an inequality constraint is pinned to its bound, one degree of freedom is lost: a state variable must become dependent on the others through the newly active algebraic equation. In actively controlled systems, the control input is the natural candidate to absorb this loss—an actuator command that saturates, for instance, stops behaving as a free trajectory and becomes an algebraic variable determined by the active bound—while the state variables continue to evolve according to the underlying physics. Each additional active inequality constraint can raise the DAE index and make the numerical solution correspondingly harder.

Activity 4.1: Formulating Actuator Dynamics, Rate Limits, and Energy Limits