Given an arbitrary system, we can use various methods to describe it such as Transfer Function, Differential Equations and State Space Model. Here we mainly foucos on State Space Model and solve following questions,

  • What is State Space Model?
  • How to contruct the State Space Model of a specified plant?
  • How to convert State Space Model to other description methods like Transfer Function?

What is State Space Model?

State space model (SSM) refers to a class of probabilistic graphical model (Koller and Friedman, 2009) that describes the probabilistic dependence between the latent state variable and the observed measurement. The state or the measurement can be either continuous or discrete.

Continuous Time System

Here we only discuss the simple case that the system is linear and time-invariant with pp inputs, qq outputs and nn state variables. The SSM of the plant is written in the following form,

x˙(t)=Ax(t)+Bu(t)y(t)=Cx(t)+Du(t)\dot{x}(t) = Ax(t) + Bu(t) \\ y(t) = Cx(t) + Du(t)

where,

  • x()x(\cdot) is called the “state vector”, x(t)Rnx(t) \in \mathbb{R}^n;
  • y()y(\cdot ) is called the “output vector”, y(t)Rqy(t)\in \mathbb {R} ^{q};
  • u()u(\cdot ) is called the “input (or control) vector”, u(t)Rpu(t)\in \mathbb {R} ^{p};
  • A(){A(\cdot )} is the “state (or system) matrix”, A()=n×nA(\cdot )=n\times n,
  • B(){B(\cdot )} is the “input matrix”, B()=n×p{B (\cdot )=n\times p},
  • C(){C(\cdot )} is the “output matrix”, C()=q×n{C (\cdot )=q\times n},
  • D(){D(\cdot )} is the “feedthrough (or feedforward) matrix” (in cases where the system model does not have a direct feedthrough, D(){D(\cdot )} is the zero matrix), dim[D()]=q×p{\displaystyle \operatorname {dim} [\mathbf {D} (\cdot )]=q\times p},
  • x˙(t)=ddtx(t)\dot{x}(t) = \frac{d}{dt}x(t)

Discrete Time System

In discrete time system, we define similar equations in the following form,

x(t+1)=Ax(t)+Bu(t)y(t)=Cx(t)+Du(t)x(t+1) = Ax(t) + Bu(t) \\ y(t) = Cx(t) + Du(t)

What’s the meaning of such parameters?

Matrices A,B,C,DA, B, C, D have its own features and by analyzing them we can understand characteristic features of the plant. \

For example, matrix AA represents the stability of the system. If and only if all eigenvalues of AA have neagtive or zero real part and all Jordan blocks corresponding to eigenvalues with zero real part are 1×11 \times 1, the plant is Lyapunov Stable.

More detals about it will be discussed in next posts.

How to construct a SSM of a specified plant?

Consider the classic mass-spring-damper system as shown below. Two motors apply forces F1F_1 and F2F_2 to the mass m1m_1 and m2m_2 respectively, resulting translations x1x_1 and x2x_2,

Construct differential equations

By analyzing the system, we get its differential equations in the following form,

m2x¨2+d(x˙2x˙1)+k(x2x1)=F2m1x¨1+d(x˙1x˙2)+k(x1x2)=F1m_2 \ddot{x}_2 + d(\dot{x}_2 - \dot{x}_1) + k(x_2 - x_1) = F_2 \\ m_1 \ddot{x}_1 + d(\dot{x}_1 - \dot{x}_2) + k(x_1 - x_2) = F_1

Define state vecotr x(t)x(t)

Definitions of x(t)x(t) are not unique. Using different defitions bring different matrices A,B,C,DA, B, C, D.

Here we define,

X=[x1(t)x2(t)x3(t)x4(t)]=[x1x˙1x2x˙2],X˙=[x˙1(t)x˙2(t)x˙3(t)x˙4(t)]=[x2(t)x¨1x4(t)x¨2]X = \begin{bmatrix} x_1(t) \\ x_2(t) \\ x_3(t) \\ x_4(t) \end{bmatrix} = \begin{bmatrix} x_1 \\ \dot{x}_1 \\ x_2 \\ \dot{x}_2 \end{bmatrix}, \quad \dot{X} = \begin{bmatrix} \dot{x}_1(t) \\ \dot{x}_2(t) \\ \dot{x}_3(t) \\ \dot{x}_4(t) \end{bmatrix} = \begin{bmatrix} x_2(t) \\ \ddot{x}_1 \\ x_4(t) \\ \ddot{x}_2 \end{bmatrix}

Sort out differential equations

from differential equations we get,

x¨2=1m2[F2d(x˙2x˙1)k(x2x1)]x¨1=1m1[F1d(x˙1x˙2)k(x1x2)]\ddot{x}_2 = \frac{1}{m_2} [F_2 - d(\dot{x}_2 - \dot{x}_1) - k(x_2 - x_1)] \\ \ddot{x}_1 = \frac{1}{m_1} [F_1 - d(\dot{x}_1 - \dot{x}_2) - k(x_1 - x_2)]

Turn into matrix form

Hence we get,

X˙(t)=[0100km1dm1km1dm10001km2dm2km2dm2]X(t)+[001m100001m2]U(t)Y(t)=[10000010]X(t)+[0000]U(t)\dot{X}(t) = \begin{bmatrix} 0 & 1 & 0 & 0 \\ -\frac{k}{m_1} & -\frac{d}{m_1} & \frac{k}{m_1} & \frac{d}{m_1} \\ 0 & 0 & 0 & 1 \\ \frac{k}{m_2} & \frac{d}{m_2} & -\frac{k}{m_2} & -\frac{d}{m_2} \end{bmatrix} X(t) + \begin{bmatrix} 0 & 0 \\ \frac{1}{m_1} & 0 \\ 0 & 0 \\ 0 & \frac{1}{m_2} \end{bmatrix} U(t) \\ Y(t) = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} X(t) + \begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix} U(t)

Note that U(t)=[F1F2]U(t) = [F_1 \quad F_2]^\top

How to convert SSM to transfer function?

For a specified plant, we have various SSM since we can define different state vectors. However, there only exists an unique transfer function G(s)G(s). Besides, if we get a SSM of a plant, we can easily find its tranfer function through the following equation,

Continuous Time System

G(s)=C(sIA)1B+DG(s) = C(sI-A)^{-1}B+D

Discrete Time System

G(z)=C(zIA)1B+DG(z) = C(zI-A)^{-1}B+D