In electrical systems, there are three basic components: resistors, capacitors, and inductors. See Table 1 for their Laplace domain relationships. At an electrical node, $\sum V = 0$ by Kirchoff’s Voltage Law, and at an electrical junction, $\sum I_{in} = \sum I_{out}$ by Kirchoff’s Current Law.

In mechanical systems, there are also three basic components: dampers, springs, and masses. There are also rotational counterparts. See Table 1 for their Laplace domain relationships. At a massless node, $\sum F=0$ by Newton’s 2nd law. Because we consider dampers and springs are massless, the force at two ends of a damper or spring must be equal. In rotational systems, we can also have a gear train. Rotational impedances are reflected through gear trains by multiplying by $\left(\frac{N^2_{dest}}{N^2_{source}}\right)$.

Linearization is when a nonlinear system $f(\mathbf{x})$ is approximated by the first two terms of its Taylor series about a particular operating point.

$f(\mathbf{x}_0 + \delta \mathbf{x}) \approx f(\mathbf{x}_0) + \nabla_x|_{\mathbf{x}_0+\delta\mathbf{x}}\delta\mathbf{x}$

$f(\mathbf{x}) - f(\mathbf{x}_0) = \delta f(\mathbf{x}) \approx \nabla_x|_{\mathbf{x}_0+\delta\mathbf{x}} \delta\mathbf{x} \qquad (1)$

Equation 1 will hold so long as $\delta\mathbf{x}$ is small enough to be within the linear regime (i.e where the Taylor Series expansion is a good approximation). If $f$ is a multi-variable equation, then Equation 1 becomes

$\delta f(\mathbf{x}, \mathbf{u}, \dots) \approx \nabla_x|_{\mathbf{x}_0+\delta\mathbf{x}} \mathbf{\delta x} + \nabla_u|_{\mathbf{u}_0+\delta\mathbf{u}} \mathbf{\delta u} + \cdots$

The state variables of a system are the smallest set of linear independent system variables that can uniquely determine all the other system variables for all $t > 0$.

One can think of the state variables $\mathbf{x}$ as capturing the internal dynamics of the system. The dynamics are described by matrices $A$ (the state-evolution matrix) and $B$ (the input matrix)

$\frac{d^{}\mathbf{x}}{dt^{}} = A\mathbf{x} + B\mathbf{u}$

where $\mathbf{u}$ is the input to the system. Sometimes the states are not directly observable, but instead the sensor in Figure 2 only provides a linear combination of the states determined by the output matrix $C$ and the feedforward matrix $D$. Together, Equation 2 and Equation 3 are the state-space equations of the system.

$\begin{aligned} \frac{d^{}\mathbf{x}}{dt^{}} &= A\mathbf{x} + B\mathbf{u} \qquad (2)\\ \mathbf{y} &= C\mathbf{x} + D \mathbf{u} \qquad (3)\end{aligned}$

$\begin{aligned} s\mathbf{X}(s) - \mathbf{x}(0^-) &= A\mathbf{X}(s) + B\mathbf{U}(s)\\ &\implies \mathbf{X}(s) = (sI-A)^{-1}B\mathbf{U}(s) + \mathbf{x}(0^{-})\\ \mathbf{Y}(s) &= C\mathbf{X}(s) + D\mathbf{U}(s)\\ &\implies \mathbf{Y}(s) = (C\left( sI-A \right)^{-1}B+D)\mathbf{U}(s) + C(sI-A)^{-1}\mathbf{x}(0^-).\end{aligned}$

If the system is Single-Input, Single-Output (SISO) and the initial condition is $\mathbf{x}(0^-) = \boldsymbol{0}$, then

$H(s) = \frac{Y(s)}{U(s)} = C(sI-A)^{-1}B+D. \qquad (4)$

Equation 4 makes it very clear that the poles of the system are the same as the eigenvalues of the $A$ matrix.

$\sum_{k=0}^N a_k \frac{d^{k}y}{dt^{k}} = \sum_{k=0}^{N} b_k \frac{d^{k}u}{dt^{k}},$

$H(s) = \frac{Y(s)}{U(s)} = \frac{\sum_{k=0}^N b_k s^k}{\sum_{k=0}^{N}a_k s^k} = \frac{\sum_{k=0}^{N} \frac{b_k}{a_N}s^k}{s^N + \sum_{k=0}^{N-1} \frac{a_k}{a_N}s^k}.$

It is possible that $\exists M < N$ such that $\forall k \geq M, b_k=0$. In other words, the numerator can have fewer terms than the denominator. We now introduce an intermediary variable $X$ so

$\frac{Y(s)}{U(s)} = \frac{Y(s)}{X(s)}\frac{X(s)}{U(s)}.$

$Y(s) = \sum_{k=0}^{N} \frac{b_k}{a_N} s^k X(s) \qquad X(s) = \frac{U(s)}{s^N + \sum_{k=0}^{N-1}\frac{a_k}{a_N}s^k}.$

$y(t) = \sum_{k=0}^{N} \frac{b_k}{a_N} \frac{d^{k}x}{dt^{k}} \qquad \frac{d^{N}x}{dt^{N}} = u(t) - \sum_{k=0}^{N-1} \frac{a_k}{a_N} \frac{d^{k}x}{dt^{k}}.$

We can now choose our state-variables to be the derivatives $x, \frac{d^{}x}{dt^{}}, \cdots, \frac{d^{N-1}x}{dt^{N-1}}$, giving us the state-evolution equation

$\frac{d}{dt} \begin{bmatrix} x\\\frac{d^{}x}{dt^{}}\\ \vdots \\ \frac{d^{N-2}x}{dt^{N-2}} \\\frac{d^{N-1}x}{dt^{N-1}} \end{bmatrix} = \begin{bmatrix} 0 & 1 & 0 & 0 & \ldots\\ 0 & 0 & 1 & 0 & \ldots\\ 0 & 0 & \ddots & \ddots & \ddots\\ 0 & 0 & \ldots & 0 & 1\\ -\frac{a_0}{a_N} & -\frac{a_1}{a_N} & \ldots & -\frac{a_{N-2}}{a_N} & -\frac{a_{N-1}}{a_N} \end{bmatrix} \begin{bmatrix} x\\\frac{d^{}x}{dt^{}}\\ \vdots \\ \frac{d^{N-2}x}{dt^{N-2}} \\\frac{d^{N-1}x}{dt^{N-1}} \end{bmatrix} + \begin{bmatrix} 0 \\ 0 \\ \vdots \\ 0 \\ 1 \end{bmatrix} u(t). \qquad (5)$

Applying the state-variables to $y(t)$,

$\begin{aligned} y(t) &= \frac{b_N}{a_N}\left( u(t) - \sum_{k=0}^{N-1}\frac{a_k}{a_N} \frac{d^{k}x}{dt^{k}} \right) + \sum_{k=0}^{N-1} \frac{b_k}{a_N} \frac{d^{k}x}{dt^{k}}\\ y(t) &= \frac{b_N}{a_N}u(t) + \sum_{k=0}^{N-1} \left(\frac{b_k}{a_N} - \frac{b_Na_k}{a_N^2}\right) \frac{d^{k}x}{dt^{k}}\\ y(t) &= \frac{1}{a_N}\begin{bmatrix} b_0 - \frac{b_Na_0}{a_N} & b_1 - \frac{b_Na_1}{a_N} & \ldots & b_{N-1} - \frac{b_Na_{N-1}}{a_N} \end{bmatrix} \mathbf{x} + \frac{b_N}{a_N}u(t). \qquad (6)\end{aligned}$

Together, Equation 5, Equation 6 are known as **Phase Variable Form**. Notice that the characteristic polynomial of the $A$ matrix when it is in phase variable form is

$\Delta(s) = s^n + \sum_{i=0}^{N-1}\frac{a_i}{a_N}s^i.$

For transfer functions, the time domain solution for a particular input is given by $\mathcal{L}^{-1}\left\{ H(s) U(s) \right\}$. How do we do the same for state-space equations? Equation 2 is a inhomogenous, first-order vector ordinary differential equation. If it was a scalar homogenous ODE, then we know the solution would be $x(t)=x(0)e^{at}$, so for our vector case, let us first define

$e^{At} = \sum_{k=0}^{\infty} \frac{1}{k!} A^k$

using the Taylor Series expansion. With this definition, we can solve Equation 2 using integrating factors. If we let $e^{-At}$ be our integrating factor, then multiplying it to both sides of Equation 2 gives

$e^{-At}\frac{d^{}\mathbf{x}}{dt^{}} = e^{-At}A\mathbf{x} + e^{-At}B\mathbf{u}.$

$\frac{d}{dt}\left[ e^{-At}\mathbf{x} \right] = e^{-At}\frac{d^{}\mathbf{x}}{dt^{}} - A e^{-At}\mathbf{x}.$

$\frac{d}{dt}\left[ e^{-At}\mathbf{x} \right] = e^{-At}B\mathbf{u}.$

Integrating both sides from 0 to $t$,

$\begin{aligned} e^{-At}\mathbf{x}(t) - \mathbf{x}(0) = \int_{0}^{t}e^{-A\tau}B\mathbf{u}(\tau)d\tau\\ \therefore \mathbf{x}(t) = e^{At}\mathbf{x}(0) + \int_{0}^{t}e^{A(t-\tau)}B\mathbf{u}(\tau)d\tau \qquad (7)\end{aligned}$

$\mathbf{x}(t) = e^{At}\mathbf{x}(0)$

The zero-state response is how the system response to an input when its initial state is $\mathbf{x}(0) = \boldsymbol{0}$. It is the convolution of the input with $e^{At}B\mathbf{u}(t)u(t)$ where $u(t)$ is the unit step.

$\mathbf{x}(t) = \int_{0}^{t}e^{A(t-\tau)}B\mathbf{u}(\tau)d\tau$

A system is controllable if for any initial state $\mathbf{x}_0$, we can reach a new state $\mathbf{x}_f$ in finite time with no constraints on the input $\mathbf{u}$.

Let us assume that we have a controllable system and we want to reach the state $\mathbf{0}$ from $\mathbf{x}_0$, and we reach it at time $t_f$. Then using Equation 7,

$-\mathbf{x}_0 = \int_0^{t_f} e^{-A\tau}B\mathbf{u}(\tau)d\tau.$

$\begin{aligned} -\mathbf{x}_0 = \sum_{j=0}^{n-1}A^jB\int_0^{t_f}\alpha_j(\tau)\mathbf{u}(\tau)d\tau\\ \therefore \begin{bmatrix} B & AB & A^2 B & \ldots & A^{n-1}B \end{bmatrix} \begin{bmatrix} c_0 \\ c_1 \\ \vdots \\ c_{n-1} \end{bmatrix}\\ \text{where } c_i = \int_0^{t_f} \alpha_j(\tau)u(\tau)d\tau.\end{aligned}$

$\mathcal{C} = \begin{bmatrix} B & AB & A^2 B & \ldots & A^{n-1}B \end{bmatrix}.$

Notice that if $\mathcal{C}$ is invertible, then we can find the $\mathbf{c}$ which will recover $-\mathbf{x}_0$, but if it is not invertible, then we may not be able to do this.

If $\mathcal{C}$is invertible, then the system is controllable.

A system is observable if for any initial state $\mathbf{x}_0$, we can determine $\mathbf{x}_0$ from $u(t)$ and $y(t)$over a finite time interval.

$\mathcal{O} = \begin{bmatrix} C \\ CA \\ \\ \vdots \\ CA^{n-1} \end{bmatrix}.$

If $\mathcal{O}$is invertible, then the system is observable.

Sometimes systems have a time-delay in them. This is equivalent to placing a system before the plant with impulse response $\delta(t-T)$ since $x(t)*\delta(t-T) = x(t-T)$. In the Laplace domain, this is the same as the transfer function $e^{-sT}$ as shown in Figure 3.