Part 6 - Space-state representation (2)

Posted on Nov 9, 2023
(Last updated: May 26, 2024)

Introduction

In this part we’ll see how we can go from a given space-state representation to the systems transfer function and vice-versa.

From space-state to transfer function

Given this space-state representation: $$ \begin{cases} \dot{x} & = Ax + Bu & (1) \\ y & = Cx + Du & (2) \end{cases} $$

We want to find $G_{uy}(s) = \dfrac{Y(s)}{U(s)}$

Let’s Laplace our equation system: $$ \begin{cases} sX(s) & = AX(s) + BU(s) & (1) \\ Y(s) & = CX(s) + DU(S) & (2) \end{cases} $$

From $(1)$ we can find that: $$ sX(s) - AX(S) = BU(s) \ | \ \text{To factor out X(s) we need to do a little matrix trick} \\ X(s)(sI - A) = BU(S) \\ X(s) = (sI - A)^{-1})B\ U(s) $$

If we substitute this into $(2)$: $$ Y(s) = C((sI - A)^{-1} B) U(s) + D U(s) \\ \boxed{G_{uy}(s) = C(sI - A)^{-1}B + D} $$

Example

From our feather-mass example, we found that: $$ A = \begin{bmatrix} 0 & 1 \\ -\dfrac{k}{m} & -\dfrac{b}{m} \end{bmatrix} \quad B = \begin{bmatrix} 0 \\ \dfrac{1}{m} \end{bmatrix} \quad C = \begin{bmatrix} 1 & 0 \end{bmatrix} \quad D = \begin{bmatrix} 0 \end{bmatrix} $$

We therefore get: $$ \begin{bmatrix} 1 & 0 \end{bmatrix} \left( \begin{bmatrix} s & 0 \\ 0 & s \end{bmatrix} - \begin{bmatrix} 0 & 1 \\ -\dfrac{k}{m} & -\dfrac{b}{m} \end{bmatrix}\right)^{-1} \begin{bmatrix} 0 \\ \dfrac{1}{m} \end{bmatrix} $$

$$ \begin{bmatrix} 1 & 0 \end{bmatrix} \left( \begin{bmatrix} s & -1 \\ \dfrac{k}{m} & s+\dfrac{b}{m} \end{bmatrix}\right)^{-1} \begin{bmatrix} 0 \\ \dfrac{1}{m} \end{bmatrix} $$

$$ \begin{bmatrix} 1 & 0 \end{bmatrix} \left( \dfrac{1}{s^2 + \dfrac{bs}{m} + \dfrac{k}{m}} \begin{bmatrix} s + \dfrac{b}{m} & 1 \\ -\dfrac{k}{m} & s \end{bmatrix}\right) \begin{bmatrix} 0 \\ \dfrac{1}{m} \end{bmatrix} $$

$$ \dfrac{1}{s^2 + \dfrac{bs}{m} + \dfrac{k}{m}} \begin{bmatrix} s + \dfrac{b}{m} & 1 \end{bmatrix} \begin{bmatrix} 0 \\ \dfrac{1}{m} \end{bmatrix} $$

$$ \dfrac{1}{m(s^2 + \dfrac{bs}{m} + \dfrac{k}{m})} $$

$$ \boxed{\dfrac{1}{ms^2 + bs + k}} $$

From transfer function to space-state representation

Given: $$ G(s) = \dfrac{a}{s^3 + bs^2 + cs + d} = \dfrac{Y(s)}{U(s)} $$

Which means: $$ s^3 Y(s) + bs^2 Y(s) + cs Y(s) + d Y(s) = a U(s) $$

Inverse-Laplace yields: $$ y^{(3)}(t) + b \ddot{y}(t) + c \dot{y}(t) + dy(t) = a u(t) $$

Introduce state variables, $x_1 = y, x_2 = \dot{y}, x_3 = \ddot{y}$.

This means: $$ \begin{cases} \dot{x_1} = x_2 \\ \dot{x_2} = x_3 \\ \dot{x_3} = au(t) - bx_3 - cx_2 - dx_1 \\ \end{cases} $$

Which yields: $$ \boxed{ \begin{cases} \dot{x} & = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ -d & -c & -b \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} + \begin{bmatrix} 0 \\ 0 \\ a \end{bmatrix} u \\ y = x_1 \end{cases}} $$