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.

0.3 Differential Equations and State-Space Models

Dynamic systems are modeled with differential equations because their rates of change depend on current states, inputs, time, and physical parameters. CCD uses these equations both to predict system behavior and to constrain the optimization problem.

Ordinary differential equations

What is a differential equation?

A differential equation relates a function to one or more of its derivatives. A first-order ordinary differential equation (ODE) can be written

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

while a second-order ODE can be written

x¨=g(x,x˙,u,t).\ddot{x}=g(x,\dot{x},u,t).

The derivative order refers to the highest derivative appearing in the equation.

Mass–spring–damper example

A standard engineering model is

mx¨+cx˙+kx=u(t),m\ddot{x}+c\dot{x}+kx=u(t),

where

In a CCD problem, mm, cc, and kk could be plant design variables, while u(t)u(t) or the parameters of a feedback law could be control design variables.

Initial conditions

The differential equation alone does not determine a unique trajectory. A second-order initial-value problem normally also requires displacement and velocity at the initial time:

x(0)=x0,x˙(0)=v0.x(0)=x_0, \qquad \dot{x}(0)=v_0.

Converting a higher-order ODE to first-order form

First-order state-space form is central to simulation, control, and optimal control. Define

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

The first state equation is

x˙1=x2.\dot{x}_1=x_2.

Solving the original mass–spring–damper equation for acceleration gives

x¨=kmxcmx˙+1mu,\ddot{x}=-\frac{k}{m}x-\frac{c}{m}\dot{x}+\frac{1}{m}u,

so the second state equation is

x˙2=kmx1cmx2+1mu.\dot{x}_2=-\frac{k}{m}x_1-\frac{c}{m}x_2+\frac{1}{m}u.
A mass-spring-damper equation is converted into two coupled first-order state equations.

Second-order engineering models are commonly rewritten as systems of first-order state equations.

Example: state conversion

Collect the two states in a vector:

x=[x1x2]=[xx˙].\mathbf{x}= \begin{bmatrix} x_1\\x_2 \end{bmatrix} = \begin{bmatrix} x\\\dot{x} \end{bmatrix}.

The dynamics can then be written compactly as

x˙=[x2kmx1cmx2+1mu].\dot{\mathbf{x}}= \begin{bmatrix} x_2\\ -\dfrac{k}{m}x_1-\dfrac{c}{m}x_2+\dfrac{1}{m}u \end{bmatrix}.

This representation reappears in Chapter 2 and in later optimal-control formulations.

Introductory state-space notation

Nonlinear state-space form

A general nonlinear dynamic system is often written

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

where

Linear state-space form

For a linear time-invariant system,

x˙=Ax+Bu,y=Cx+Du.\dot{\mathbf{x}}=A\mathbf{x}+B\mathbf{u}, \qquad \mathbf{y}=C\mathbf{x}+D\mathbf{u}.

The matrices have compatible dimensions:

MatrixRole
AAState or system matrix
BBInput matrix
CCOutput matrix
DDDirect-feedthrough matrix

State-space notation is compact, supports multiple states and inputs, and works naturally with vector and matrix operations. It is therefore widely used in control theory and CCD.

Activity 0.4: Exact State-Space Response of a Forced Dynamic System