Part 5 - Space-state representation (1)

Introduction

In this part we’ll see how we can represent systems using matrix notation, also called space-state representation. Along with how we linearize non-linear systems.

State variables

If we use the spring-mass system from last time, with FdF_d as input signal and yy as output signal.

We obtained the following differential equation:

y¨=1m(Fdby˙ky)\ddot{y} = \dfrac{1}{m}(F_d - b\dot{y} - ky)

If we want to represent this system using a set of first-order differential equations instead, we can do the following:

Let x1=y(t)x_1 = y(t) and x2=y˙(t)x_2 = \dot{y}(t).

Then we can write:

{x1˙=x2x2˙=1m(Fdby˙ky)\begin{cases} \dot{x_1} = x_2 \newline \dot{x_2} = \dfrac{1}{m}(F_d - b\dot{y} - ky) \end{cases}

Let’s now call the input signal, FdF_d, for uu.

{x1˙=x2x2˙=1m(uby˙ky)\begin{cases} \dot{x_1} = x_2 \newline \dot{x_2} = \dfrac{1}{m}(u - b\dot{y} - ky) \end{cases}

In matrix notation we can write it as:

[x1˙x2˙]=[01kmbm][x1x2]+[01m]u\begin{bmatrix} \dot{x_1} \newline \dot{x_2} \end{bmatrix} = \begin{bmatrix} 0 & 1 \newline -\dfrac{k}{m} & -\dfrac{b}{m} \newline \end{bmatrix} \begin{bmatrix} x_1 \newline x_2 \end{bmatrix} + \begin{bmatrix} 0 \newline \dfrac{1}{m} \end{bmatrix} u

We say that A=[01kmbm]A = \begin{bmatrix} 0 & 1 \newline -\dfrac{k}{m} & -\dfrac{b}{m} \newline \end{bmatrix} is the system matrix.

Therefore, we can finally write it as:

{x˙=Ax+Buy=x1\begin{cases} \dot{x} = Ax + Bu \newline y = x_1 \end{cases}

Linearization

Is a quite simple concept is the first order Taylor expansion around a point. Let’s take a look for functions of one variable.

We want to linearize around the point x=x0x = x_0:

f(x)f(x0)+f(x0)(xx0)f(x) \approx f(x_0) + f^\prime(x_0)(x - x_0)

In Control theory, the linearized function is quite often not the interest itself. Rather we want to understand how much this linear approximation deviates from the desired value.

So we say that:

Δf=f(x)f(x0)=f(x0)(xx0)=f(x0)Δx\Delta f = f(x) - f(x_0) = f^\prime(x_0)(x - x_0) = \boxed{f^\prime(x_0)\Delta x}

For functions of 2 (or more variables), around point (x0,y0)(x_0, y_0):

f(x,y)f(x0,y0)+fx(x0,y0)Δx+fy(x0,y0)Δyf(x, y) \approx f(x_0, y_0) + \dfrac{\partial f}{\partial x} \biggr\rvert_{(x_0, y_0)} \Delta x + \dfrac{\partial f}{\partial y} \biggr\rvert_{(x_0, y_0)} \Delta y

Which means:

Δf(x,y)=fx(x0,y0)Δx+fy(x0,y0)Δy\Delta f(x, y) = \dfrac{\partial f}{\partial x} \biggr\rvert_{(x_0, y_0)} \Delta x + \dfrac{\partial f}{\partial y} \biggr\rvert_{(x_0, y_0)} \Delta y
Example 1 (Tank system)

From the last part, we had a tank system which we described with a differential equation. Say that we have a point of equilibrium, (q0,h0)(q_0, h_0) meaning that h=0h = 0.

This gives us that h˙(q0,h0)=f(q0,h0)=0\dot{h}(q_0, h_0) = f(q_0, h_0) = 0

q0=a2gh0q_0 = a \sqrt{2g} \cdot \sqrt{h_0}a2g=q0h0a \sqrt{2g} = \dfrac{q_0}{\sqrt{h_0}}

We’ll use this later on, but let’s first linearize what we had.

fqin(q0,h0)=1A\dfrac{\partial f}{\partial q_{in}} \biggr\rvert_{(q_0, h_0)} = \dfrac{1}{A}fh1(q0,h0)==q02Ah0\dfrac{\partial f}{\partial h_{1}} \biggr\rvert_{(q_0, h_0)} = \ldots = -\dfrac{q_0}{2Ah_0}

This means that:

Δf(qin,h1)1AΔqq02Ah0Δh\Delta f(q_{in}, h_1) \approx \dfrac{1}{A} \Delta q - \dfrac{q_0}{2Ah_0} \Delta h

Which is the same as:

Δh˙1AΔqq02Ah0Δh\Delta \dot{h} \approx \dfrac{1}{A} \Delta q - \dfrac{q_0}{2Ah_0} \Delta h

If we now take the Laplace transform:

sΔH(s)=1AΔQ(s)q02Ah0ΔH(s)s \Delta H(s) = \dfrac{1}{A} \Delta Q(s) - \dfrac{q_0}{2Ah_0} \Delta H(s)(s+q02Ah0)ΔH(s)=1AΔQ(s)(s + \dfrac{q_0}{2Ah_0}) \Delta H(s) = \dfrac{1}{A} \Delta Q(s)

Let’s now find the transfer function from qinh1q_{in}\to h_1

Gqh(s)=ΔH(s)ΔQ(s)=1As+q02Ah0G_{qh}(s) = \dfrac{\Delta H(s)}{\Delta Q(s)} = \dfrac{\dfrac{1}{A}}{s + \dfrac{q_0}{2Ah_0}}

We can rewrite it as:

Gqh(s)=2h0s2Ah0+q0 2Ah0G_{qh}(s) = \dfrac{2h_0}{s2Ah_0 + q_0} \ | \cdot 2Ah_0Gqh(s)=2h0q0s2Ah0q0+1 ÷q0G_{qh}(s) = \dfrac{\dfrac{2h_0}{q_0}}{s\dfrac{2Ah_0}{q_0} + 1} \ | \div q_0

Let K=2h0q0K = \dfrac{2h_0}{q_0} and T=2Ah0q0T = \dfrac{2Ah_0}{q_0}

Gqh(s)=K1+sT ÷q0G_{qh}(s) = \dfrac{K}{1 + sT} \ | \div q_0