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-Space Representation

Why state space?

Single differential equations and transfer functions are useful, but state-space representation is more general and more natural for CCD. It handles:

The general nonlinear continuous-time state-space model is

x˙(t)=f(x(t),u(t),d(t),t),y(t)=h(x(t),u(t),d(t),t).\dot{\mathbf{x}}(t)=\mathbf{f}(\mathbf{x}(t),\mathbf{u}(t),\mathbf{d}(t),t), \qquad \mathbf{y}(t)=\mathbf{h}(\mathbf{x}(t),\mathbf{u}(t),\mathbf{d}(t),t).

For a linear time-invariant (LTI) system, this becomes

x˙(t)=Ax(t)+Bu(t)+Ed(t),y(t)=Cx(t)+Du(t)+Fd(t).\dot{\mathbf{x}}(t)=A\mathbf{x}(t)+B\mathbf{u}(t)+E\mathbf{d}(t), \qquad \mathbf{y}(t)=C\mathbf{x}(t)+D\mathbf{u}(t)+F\mathbf{d}(t).
Inputs and disturbances entering a dynamic state equation, with internal state x and measured output y.

The state-space viewpoint separates internal dynamic variables from control inputs, disturbances, and measured outputs.

When the model does not start in this form

The explicit state-space forms in (1) and (2) assume that every derivative x˙(t)\dot{\mathbf{x}}(t) can be written directly as a function of the states, inputs, and disturbances. That assumption is convenient, but it is not automatic. As introduced in the previous section, coupling two energy domains through multidisciplinary analysis, or activating a path constraint on stress, position, or actuator force, can introduce an algebraic variable γ(t)\boldsymbol\gamma(t) tied to the states and inputs through an algebraic equation rather than a differential one, producing an index-1 differential-algebraic equation (DAE) instead of a plain ODE.

Getting from a DAE to the state-space form used in this chapter requires eliminating γ(t)\boldsymbol\gamma(t) — solving the algebraic constraint for γ(t)\boldsymbol\gamma(t) in terms of ξ(t)\boldsymbol\xi(t) and u(t)\mathbf u(t), then substituting the result back into the differential equation. For an index-1 DAE this elimination is always possible in principle, but it can be algebraically involved, and it must be redone whenever the constraint that generated γ(t)\boldsymbol\gamma(t) changes (for example, when a different inequality constraint becomes the active one). Some numerical and optimization methods used later in this course work with the DAE directly rather than performing this elimination, which is one reason the distinction between an ODE model and a DAE model matters beyond bookkeeping.

Converting the mass–spring–damper model

Start from (4) and define

x1=x,x2=x˙.x_1=x, \qquad x_2=\dot{x}.

Then

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

Therefore,

[x˙1x˙2]=[01k/mc/m][x1x2]+[01/m]u+[01/m]d.\begin{bmatrix}\dot{x}_1\\\dot{x}_2\end{bmatrix} = \begin{bmatrix}0&1\\-k/m&-c/m\end{bmatrix} \begin{bmatrix}x_1\\x_2\end{bmatrix} + \begin{bmatrix}0\\1/m\end{bmatrix}u + \begin{bmatrix}0\\1/m\end{bmatrix}d.

If the output is displacement only,

y=[10][x1x2].y=\begin{bmatrix}1&0\end{bmatrix} \begin{bmatrix}x_1\\x_2\end{bmatrix}.

If the output includes displacement and velocity, then y=[x1  x2]T\mathbf{y}=[x_1\;x_2]^T and C=IC=I.

The plant design variables mm, cc, and kk appear directly in the system and input matrices. This is why state-space models are so useful for CCD: changing design variables changes the matrices.

Example: a DC motor

Let θ\theta be shaft angle, ω=θ˙\omega=\dot{\theta} shaft speed, and ii armature current. A basic armature-controlled DC motor model is

Jω˙+bω=KtiτL,Li˙+Ri=vKeω,J\dot{\omega}+b\omega=K_t i-\tau_L, \qquad L\dot{i}+Ri=v-K_e\omega,

where JJ is inertia, bb is viscous friction, LL is inductance, RR is resistance, KtK_t and KeK_e are motor constants, vv is applied voltage, and τL\tau_L is load torque.

With x=[θ  ω  i]T\mathbf{x}=[\theta\;\omega\;i]^T,

x˙=[0100b/JKt/J0Ke/LR/L]x+[001/L]v+[01/J0]τL.\dot{\mathbf{x}}= \begin{bmatrix} 0&1&0\\ 0&-b/J&K_t/J\\ 0&-K_e/L&-R/L \end{bmatrix}\mathbf{x} + \begin{bmatrix}0\\0\\1/L\end{bmatrix}v + \begin{bmatrix}0\\-1/J\\0\end{bmatrix}\tau_L.

This model naturally combines mechanical and electrical physics.

Linearization

Many real systems are nonlinear. Control design is often performed around an operating point using a linearized model. If

x˙=f(x,u),\dot{\mathbf{x}}=\mathbf{f}(\mathbf{x},\mathbf{u}),

and (x0,u0)(\mathbf{x}_0,\mathbf{u}_0) is an equilibrium or operating point, a first-order Taylor expansion gives

δx˙=Aδx+Bδu,\delta\dot{\mathbf{x}}=A\,\delta\mathbf{x}+B\,\delta\mathbf{u},

where

A=fx(x0,u0),B=fu(x0,u0).A=\left.\frac{\partial\mathbf{f}}{\partial\mathbf{x}}\right|_{(\mathbf{x}_0,\mathbf{u}_0)}, \qquad B=\left.\frac{\partial\mathbf{f}}{\partial\mathbf{u}}\right|_{(\mathbf{x}_0,\mathbf{u}_0)}.

Linearization matters in CCD because plant design variables can change both the operating point and the local dynamics.

Activity 2.2: Nonlinear Pendulum Modeling, Linearization, and Local Feedback

Activity 2.3: Exact State Transition of a Mass–Spring–Damper System