 #jsDisabledContent { display:none; } My Account | Register | Help Flag as Inappropriate This article will be permanently flagged as inappropriate and made unaccessible to everyone. Are you certain this article is inappropriate?          Excessive Violence          Sexual Content          Political / Social Email this Article Email Address:

# State Space Model

Article Id: WHEBN0028319193
Reproduction Date:

 Title: State Space Model Author: World Heritage Encyclopedia Language: English Subject: Stochastic optimization Collection: Publisher: World Heritage Encyclopedia Publication Date:

### State Space Model

In control engineering, a state space representation is a mathematical model of a physical system as a set of input, output and state variables related by first-order differential equations. To abstract from the number of inputs, outputs and states, the variables are expressed as vectors. Additionally, if the dynamical system is linear and time invariant, the differential and algebraic equations may be written in matrix form. The state space representation (also known as the "time-domain approach") provides a convenient and compact way to model and analyze systems with multiple inputs and outputs. With $p$ inputs and $q$ outputs, we would otherwise have to write down $q \times p$ Laplace transforms to encode all the information about a system. Unlike the frequency domain approach, the use of the state space representation is not limited to systems with linear components and zero initial conditions. "State space" refers to the space whose axes are the state variables. The state of the system can be represented as a vector within that space.

## State variables

The internal state variables are the smallest possible subset of system variables that can represent the entire state of the system at any given time. The minimum number of state variables required to represent a given system, $n$, is usually equal to the order of the system's defining differential equation. If the system is represented in transfer function form, the minimum number of state variables is equal to the order of the transfer function's denominator after it has been reduced to a proper fraction. It is important to understand that converting a state space realization to a transfer function form may lose some internal information about the system, and may provide a description of a system which is stable, when the state-space realization is unstable at certain points. In electric circuits, the number of state variables is often, though not always, the same as the number of energy storage elements in the circuit such as capacitors and inductors. The state variables defined must be linearly independent; no state variable can be written as a linear combination of the other state variables or the system will not be able to be solved.

## Linear systems

The most general state-space representation of a linear system with $p$ inputs, $q$ outputs and $n$ state variables is written in the following form :

$\dot\left\{\mathbf\left\{x\right\}\right\}\left(t\right) = A\left(t\right) \mathbf\left\{x\right\}\left(t\right) + B\left(t\right) \mathbf\left\{u\right\}\left(t\right)$
$\mathbf\left\{y\right\}\left(t\right) = C\left(t\right) \mathbf\left\{x\right\}\left(t\right) + D\left(t\right) \mathbf\left\{u\right\}\left(t\right)$

where:

$\mathbf\left\{x\right\}\left(\cdot\right)$ is called the "state vector",  $\mathbf\left\{x\right\}\left(t\right) \in \mathbb\left\{R\right\}^n$;
$\mathbf\left\{y\right\}\left(\cdot\right)$ is called the "output vector",  $\mathbf\left\{y\right\}\left(t\right) \in \mathbb\left\{R\right\}^q$;
$\mathbf\left\{u\right\}\left(\cdot\right)$ is called the "input (or control) vector",  $\mathbf\left\{u\right\}\left(t\right) \in \mathbb\left\{R\right\}^p$;
$A\left(\cdot\right)$ is the "state (or system) matrix",  $\operatorname\left\{dim\right\}\left[A\left(\cdot\right)\right] = n \times n$,
$B\left(\cdot\right)$ is the "input matrix",  $\operatorname\left\{dim\right\}\left[B\left(\cdot\right)\right] = n \times p$,
$C\left(\cdot\right)$ is the "output matrix",  $\operatorname\left\{dim\right\}\left[C\left(\cdot\right)\right] = q \times n$,
$D\left(\cdot\right)$ is the "feedthrough (or feedforward) matrix" (in cases where the system model does not have a direct feedthrough, $D\left(\cdot\right)$ is the zero matrix),  $\operatorname\left\{dim\right\}\left[D\left(\cdot\right)\right] = q \times p$,
.

In this general formulation, all matrices are allowed to be time-variant (i.e. their elements can depend on time); however, in the common LTI case, matrices will be time invariant. The time variable $t$ can be continuous (e.g. $t \in \mathbb\left\{R\right\}$) or discrete (e.g. $t \in \mathbb\left\{Z\right\}$). In the latter case, the time variable $k$ is usually used instead of $t$. Hybrid systems allow for time domains that have both continuous and discrete parts. Depending on the assumptions taken, the state-space model representation can assume the following forms:

 System type State-space model Continuous time-invariant $\dot\left\{\mathbf\left\{x\right\}\right\}\left(t\right) = A \mathbf\left\{x\right\}\left(t\right) + B \mathbf\left\{u\right\}\left(t\right)$$\mathbf\left\{y\right\}\left(t\right) = C \mathbf\left\{x\right\}\left(t\right) + D \mathbf\left\{u\right\}\left(t\right)$ Continuous time-variant $\dot\left\{\mathbf\left\{x\right\}\right\}\left(t\right) = \mathbf\left\{A\right\}\left(t\right) \mathbf\left\{x\right\}\left(t\right) + \mathbf\left\{B\right\}\left(t\right) \mathbf\left\{u\right\}\left(t\right)$$\mathbf\left\{y\right\}\left(t\right) = \mathbf\left\{C\right\}\left(t\right) \mathbf\left\{x\right\}\left(t\right) + \mathbf\left\{D\right\}\left(t\right) \mathbf\left\{u\right\}\left(t\right)$ Explicit discrete time-invariant $\mathbf\left\{x\right\}\left(k+1\right) = A \mathbf\left\{x\right\}\left(k\right) + B \mathbf\left\{u\right\}\left(k\right)$$\mathbf\left\{y\right\}\left(k\right) = C \mathbf\left\{x\right\}\left(k\right) + D \mathbf\left\{u\right\}\left(k\right)$ Explicit discrete time-variant $\mathbf\left\{x\right\}\left(k+1\right) = \mathbf\left\{A\right\}\left(k\right) \mathbf\left\{x\right\}\left(k\right) + \mathbf\left\{B\right\}\left(k\right) \mathbf\left\{u\right\}\left(k\right)$$\mathbf\left\{y\right\}\left(k\right) = \mathbf\left\{C\right\}\left(k\right) \mathbf\left\{x\right\}\left(k\right) + \mathbf\left\{D\right\}\left(k\right) \mathbf\left\{u\right\}\left(k\right)$ Laplace domain ofcontinuous time-invariant $s \mathbf\left\{X\right\}\left(s\right) = A \mathbf\left\{X\right\}\left(s\right) + B \mathbf\left\{U\right\}\left(s\right)$$\mathbf\left\{Y\right\}\left(s\right) = C \mathbf\left\{X\right\}\left(s\right) + D \mathbf\left\{U\right\}\left(s\right)$ Z-domain ofdiscrete time-invariant $z \mathbf\left\{X\right\}\left(z\right) = A \mathbf\left\{X\right\}\left(z\right) + B \mathbf\left\{U\right\}\left(z\right)$$\mathbf\left\{Y\right\}\left(z\right) = C \mathbf\left\{X\right\}\left(z\right) + D \mathbf\left\{U\right\}\left(z\right)$

### Example: Continuous-time LTI case

Stability and natural response characteristics of a continuous-time LTI system (i.e., linear with matrices that are constant with respect to time) can be studied from the eigenvalues of the matrix A. The stability of a time-invariant state-space model can be determined by looking at the system's transfer function in factored form. It will then look something like this:

$\textbf\left\{G\right\}\left(s\right) = k \frac\left\{ \left(s - z_\left\{1\right\}\right)\left(s - z_\left\{2\right\}\right)\left(s - z_\left\{3\right\}\right)$
                             }{ (s - p_{1})(s - p_{2})(s - p_{3})(s - p_{4})
}. \,


The denominator of the transfer function is equal to the characteristic polynomial found by taking the determinant of $sI - A$,

$\mathbf\left\{\lambda\right\}\left(s\right) = |sI - A|. \,$

The roots of this polynomial (the eigenvalues) are the system transfer function's poles (i.e., the singularities where the transfer function's magnitude is unbounded). These poles can be used to analyze whether the system is asymptotically stable or marginally stable. An alternative approach to determining stability, which does not involve calculating eigenvalues, is to analyze the system's Lyapunov stability.

The zeros found in the numerator of $\textbf\left\{G\right\}\left(s\right)$ can similarly be used to determine whether the system is minimum phase.

The system may still be input–output stable (see BIBO stable) even though it is not internally stable. This may be the case if unstable poles are canceled out by zeros (i.e., if those singularities in the transfer function are removable).

### Controllability

Main article: Controllability

Thus, state controllability condition implies that it is possible – by admissible inputs – to steer the states from any initial value to any final value within some finite time window. A continuous time-invariant linear state-space model is controllable if and only if

$\operatorname\left\{rank\right\}\begin\left\{bmatrix\right\}B& AB& A^\left\{2\right\}B& ...& A^\left\{n-1\right\}B\end\left\{bmatrix\right\} = n. \,$

Where rank is the number of linearly independent rows in a matrix.

### Observability

Main article: Observability

Observability is a measure for how well internal states of a system can be inferred by knowledge of its external outputs. The observability and controllability of a system are mathematical duals (i.e., as controllability provides that an input is available that brings any initial state to any desired final state, observability provides that knowing an output trajectory provides enough information to predict the initial state of the system).

A continuous time-invariant linear state-space model is observable if and only if

$\operatorname\left\{rank\right\}\begin\left\{bmatrix\right\}C\\ CA\\ ...\\ CA^\left\{n-1\right\}\end\left\{bmatrix\right\} = n. \,$

### Transfer function

The "transfer function" of a continuous time-invariant linear state-space model can be derived in the following way:

First, taking the Laplace transform of

$\dot\left\{\mathbf\left\{x\right\}\right\}\left(t\right) = A \mathbf\left\{x\right\}\left(t\right) + B \mathbf\left\{u\right\}\left(t\right)$

yields

$s\mathbf\left\{X\right\}\left(s\right) = A \mathbf\left\{X\right\}\left(s\right) + B \mathbf\left\{U\right\}\left(s\right). \,$

Next, we simplify for $\mathbf\left\{X\right\}\left(s\right)$, giving

$\left(s\mathbf\left\{I\right\} - A\right)\mathbf\left\{X\right\}\left(s\right) = B\mathbf\left\{U\right\}\left(s\right), \,$

and thus

$\mathbf\left\{X\right\}\left(s\right) = \left(s\mathbf\left\{I\right\} - A\right)^\left\{-1\right\}B\mathbf\left\{U\right\}\left(s\right). \,$

Substituting for $\mathbf\left\{X\right\}\left(s\right)$ in the output equation

$\mathbf\left\{Y\right\}\left(s\right) = C\mathbf\left\{X\right\}\left(s\right) + D\mathbf\left\{U\right\}\left(s\right),$ giving
$\mathbf\left\{Y\right\}\left(s\right) = C\left(\left(s\mathbf\left\{I\right\} - A\right)^\left\{-1\right\}B\mathbf\left\{U\right\}\left(s\right)\right) + D\mathbf\left\{U\right\}\left(s\right). \,$

Because the transfer function $\mathbf\left\{G\right\}\left(s\right)$ is defined as the ratio of the output to the input of a system, we take

$\mathbf\left\{G\right\}\left(s\right) = \mathbf\left\{Y\right\}\left(s\right) / \mathbf\left\{U\right\}\left(s\right)$

and substitute the previous expression for $\mathbf\left\{Y\right\}\left(s\right)$ with respect to $\mathbf\left\{U\right\}\left(s\right)$, giving

$\mathbf\left\{G\right\}\left(s\right) = C\left(s\mathbf\left\{I\right\} - A\right)^\left\{-1\right\}B + D. \,$

Clearly $\mathbf\left\{G\right\}\left(s\right)$ must have $q$ by $p$ dimensionality, and thus has a total of $qp$ elements. So for every input there are $q$ transfer functions with one for each output. This is why the state-space representation can easily be the preferred choice for multiple-input, multiple-output (MIMO) systems.

### Canonical realizations

Main article: Realization (systems)

Any given transfer function which is strictly proper can easily be transferred into state-space by the following approach (this example is for a 4-dimensional, single-input, single-output system):

Given a transfer function, expand it to reveal all coefficients in both the numerator and denominator. This should result in the following form:

$\textbf\left\{G\right\}\left(s\right) = \frac\left\{n_\left\{1\right\}s^\left\{3\right\} + n_\left\{2\right\}s^\left\{2\right\} + n_\left\{3\right\}s + n_\left\{4\right\}\right\}\left\{s^\left\{4\right\} + d_\left\{1\right\}s^\left\{3\right\} + d_\left\{2\right\}s^\left\{2\right\} + d_\left\{3\right\}s + d_\left\{4\right\}\right\}.\,$

The coefficients can now be inserted directly into the state-space model by the following approach:

$\dot\left\{\textbf\left\{x\right\}\right\}\left(t\right) = \begin\left\{bmatrix\right\}$
                              -d_{1}& -d_{2}& -d_{3}& -d_{4}\\
1&      0&      0&      0\\
0&      1&      0&      0\\
0&      0&      1&      0
\end{bmatrix}\textbf{x}(t) +
\begin{bmatrix} 1\\ 0\\ 0\\ 0\\ \end{bmatrix}\textbf{u}(t)

$\textbf\left\{y\right\}\left(t\right) = \begin\left\{bmatrix\right\} n_\left\{1\right\}& n_\left\{2\right\}& n_\left\{3\right\}& n_\left\{4\right\} \end\left\{bmatrix\right\}\textbf\left\{x\right\}\left(t\right). \,$

This state-space realization is called controllable canonical form because the resulting model is guaranteed to be controllable (i.e., because the control enters a chain of integrators, it has the ability to move every state).

The transfer function coefficients can also be used to construct another type of canonical form

$\dot\left\{\textbf\left\{x\right\}\right\}\left(t\right) = \begin\left\{bmatrix\right\}$
                              -d_{1}&   1&  0&  0\\
-d_{2}&   0&  1&  0\\
-d_{3}&   0&  0&  1\\
-d_{4}&   0&  0&  0
\end{bmatrix}\textbf{x}(t) +
\begin{bmatrix} n_{1}\\ n_{2}\\ n_{3}\\ n_{4} \end{bmatrix}\textbf{u}(t)

$\textbf\left\{y\right\}\left(t\right) = \begin\left\{bmatrix\right\} 1& 0& 0& 0 \end\left\{bmatrix\right\}\textbf\left\{x\right\}\left(t\right). \,$

This state-space realization is called observable canonical form because the resulting model is guaranteed to be observable (i.e., because the output exits from a chain of integrators, every state has an effect on the output).

### Proper transfer functions

Transfer functions which are only proper (and not strictly proper) can also be realised quite easily. The trick here is to separate the transfer function into two parts: a strictly proper part and a constant.

$\textbf\left\{G\right\}\left(s\right) = \textbf\left\{G\right\}_\left\{SP\right\}\left(s\right) + \textbf\left\{G\right\}\left(\infty\right). \,$

The strictly proper transfer function can then be transformed into a canonical state space realization using techniques shown above. The state space realization of the constant is trivially $\textbf\left\{y\right\}\left(t\right) = \textbf\left\{G\right\}\left(\infty\right)\textbf\left\{u\right\}\left(t\right)$. Together we then get a state space realization with matrices A,B and C determined by the strictly proper part, and matrix D determined by the constant.

Here is an example to clear things up a bit:

$\textbf\left\{G\right\}\left(s\right) = \frac\left\{s^\left\{2\right\} + 3s + 3\right\}\left\{s^\left\{2\right\} + 2s + 1\right\}$
                     = \frac{s + 2}{s^{2} + 2s + 1} + 1


which yields the following controllable realization

$\dot\left\{\textbf\left\{x\right\}\right\}\left(t\right) = \begin\left\{bmatrix\right\}$
                              -2& -1\\
1&      0\\
\end{bmatrix}\textbf{x}(t) +
\begin{bmatrix} 1\\ 0\end{bmatrix}\textbf{u}(t)

$\textbf\left\{y\right\}\left(t\right) = \begin\left\{bmatrix\right\} 1& 2\end\left\{bmatrix\right\}\textbf\left\{x\right\}\left(t\right) + \begin\left\{bmatrix\right\} 1\end\left\{bmatrix\right\}\textbf\left\{u\right\}\left(t\right)$

Notice how the output also depends directly on the input. This is due to the $\textbf\left\{G\right\}\left(\infty\right)$ constant in the transfer function.

### Feedback

A common method for feedback is to multiply the output by a matrix K and setting this as the input to the system: $\mathbf\left\{u\right\}\left(t\right) = K \mathbf\left\{y\right\}\left(t\right)$. Since the values of K are unrestricted the values can easily be negated for negative feedback. The presence of a negative sign (the common notation) is merely a notational one and its absence has no impact on the end results.

$\dot\left\{\mathbf\left\{x\right\}\right\}\left(t\right) = A \mathbf\left\{x\right\}\left(t\right) + B \mathbf\left\{u\right\}\left(t\right)$
$\mathbf\left\{y\right\}\left(t\right) = C \mathbf\left\{x\right\}\left(t\right) + D \mathbf\left\{u\right\}\left(t\right)$

becomes

$\dot\left\{\mathbf\left\{x\right\}\right\}\left(t\right) = A \mathbf\left\{x\right\}\left(t\right) + B K \mathbf\left\{y\right\}\left(t\right)$
$\mathbf\left\{y\right\}\left(t\right) = C \mathbf\left\{x\right\}\left(t\right) + D K \mathbf\left\{y\right\}\left(t\right)$

solving the output equation for $\mathbf\left\{y\right\}\left(t\right)$ and substituting in the state equation results in

$\dot\left\{\mathbf\left\{x\right\}\right\}\left(t\right) = \left\left(A + B K \left\left(I - D K\right\right)^\left\{-1\right\} C \right\right) \mathbf\left\{x\right\}\left(t\right)$
$\mathbf\left\{y\right\}\left(t\right) = \left\left(I - D K\right\right)^\left\{-1\right\} C \mathbf\left\{x\right\}\left(t\right)$

The advantage of this is that the eigenvalues of A can be controlled by setting K appropriately through eigendecomposition of $\left\left(A + B K \left\left(I - D K\right\right)^\left\{-1\right\} C \right\right)$. This assumes that the closed-loop system is controllable or that the unstable eigenvalues of A can be made stable through appropriate choice of K.

#### Example

For a strictly proper system D equals zero. Another fairly common situation is when all states are outputs, i.e. y = x, which yields C = I, the Identity matrix. This would then result in the simpler equations

$\dot\left\{\mathbf\left\{x\right\}\right\}\left(t\right) = \left\left(A + B K \right\right) \mathbf\left\{x\right\}\left(t\right)$
$\mathbf\left\{y\right\}\left(t\right) = \mathbf\left\{x\right\}\left(t\right)$

This reduces the necessary eigendecomposition to just $A + B K$.

### Feedback with setpoint (reference) input

In addition to feedback, an input, $r\left(t\right)$, can be added such that $\mathbf\left\{u\right\}\left(t\right) = -K \mathbf\left\{y\right\}\left(t\right) + \mathbf\left\{r\right\}\left(t\right)$.

$\dot\left\{\mathbf\left\{x\right\}\right\}\left(t\right) = A \mathbf\left\{x\right\}\left(t\right) + B \mathbf\left\{u\right\}\left(t\right)$
$\mathbf\left\{y\right\}\left(t\right) = C \mathbf\left\{x\right\}\left(t\right) + D \mathbf\left\{u\right\}\left(t\right)$

becomes

$\dot\left\{\mathbf\left\{x\right\}\right\}\left(t\right) = A \mathbf\left\{x\right\}\left(t\right) - B K \mathbf\left\{y\right\}\left(t\right) + B \mathbf\left\{r\right\}\left(t\right)$
$\mathbf\left\{y\right\}\left(t\right) = C \mathbf\left\{x\right\}\left(t\right) - D K \mathbf\left\{y\right\}\left(t\right) + D \mathbf\left\{r\right\}\left(t\right)$

solving the output equation for $\mathbf\left\{y\right\}\left(t\right)$ and substituting in the state equation results in

$\dot\left\{\mathbf\left\{x\right\}\right\}\left(t\right) = \left\left(A - B K \left\left(I + D K\right\right)^\left\{-1\right\} C \right\right) \mathbf\left\{x\right\}\left(t\right) + B \left\left(I - K \left\left(I + D K\right\right)^\left\{-1\right\}D \right\right) \mathbf\left\{r\right\}\left(t\right)$
$\mathbf\left\{y\right\}\left(t\right) = \left\left(I + D K\right\right)^\left\{-1\right\} C \mathbf\left\{x\right\}\left(t\right) + \left\left(I + D K\right\right)^\left\{-1\right\} D \mathbf\left\{r\right\}\left(t\right)$

One fairly common simplification to this system is removing D, which reduces the equations to

$\dot\left\{\mathbf\left\{x\right\}\right\}\left(t\right) = \left\left(A - B K C \right\right) \mathbf\left\{x\right\}\left(t\right) + B \mathbf\left\{r\right\}\left(t\right)$
$\mathbf\left\{y\right\}\left(t\right) = C \mathbf\left\{x\right\}\left(t\right)$

### Moving object example

A classical linear system is that of one-dimensional movement of an object. The Newton's laws of motion for an object moving horizontally on a plane and attached to a wall with a spring

$m \ddot\left\{y\right\}\left(t\right) = u\left(t\right) - k_1\dot\left\{y\right\}\left(t\right) - k_2 y\left(t\right)$

where

• $y\left(t\right)$ is position; $\dot y\left(t\right)$ is velocity; $\ddot\left\{y\right\}\left(t\right)$ is acceleration
• $u\left(t\right)$ is an applied force
• $k_1$ is the viscous friction coefficient
• $k_2$ is the spring constant
• $m$ is the mass of the object

The state equation would then become

$\left\left[ \begin\left\{matrix\right\} \mathbf\left\{\dot\left\{x_1\right\}\right\}\left(t\right) \\ \mathbf\left\{\dot\left\{x_2\right\}\right\}\left(t\right) \end\left\{matrix\right\} \right\right] = \left\left[ \begin\left\{matrix\right\} 0 & 1 \\ -\frac\left\{k_2\right\}\left\{m\right\} & -\frac\left\{k_1\right\}\left\{m\right\} \end\left\{matrix\right\} \right\right] \left\left[ \begin\left\{matrix\right\} \mathbf\left\{x_1\right\}\left(t\right) \\ \mathbf\left\{x_2\right\}\left(t\right) \end\left\{matrix\right\} \right\right] + \left\left[ \begin\left\{matrix\right\} 0 \\ \frac\left\{1\right\}\left\{m\right\} \end\left\{matrix\right\} \right\right] \mathbf\left\{u\right\}\left(t\right)$
$\mathbf\left\{y\right\}\left(t\right) = \left\left[ \begin\left\{matrix\right\} 1 & 0 \end\left\{matrix\right\} \right\right] \left\left[ \begin\left\{matrix\right\} \mathbf\left\{x_1\right\}\left(t\right) \\ \mathbf\left\{x_2\right\}\left(t\right) \end\left\{matrix\right\} \right\right]$

where

• $x_1\left(t\right)$ represents the position of the object
• $x_2\left(t\right) = \dot\left\{x_1\right\}\left(t\right)$ is the velocity of the object
• $\dot\left\{x_2\right\}\left(t\right) = \ddot\left\{x_1\right\}\left(t\right)$ is the acceleration of the object
• the output $\mathbf\left\{y\right\}\left(t\right)$ is the position of the object

The controllability test is then

$\left\left[ \begin\left\{matrix\right\} B & AB \end\left\{matrix\right\} \right\right] = \left\left[ \begin\left\{matrix\right\} \left\left[ \begin\left\{matrix\right\} 0 \\ \frac\left\{1\right\}\left\{m\right\} \end\left\{matrix\right\} \right\right] & \left\left[ \begin\left\{matrix\right\} 0 & 1 \\ -\frac\left\{k_2\right\}\left\{m\right\} & -\frac\left\{k_1\right\}\left\{m\right\} \end\left\{matrix\right\} \right\right] \left\left[ \begin\left\{matrix\right\} 0 \\ \frac\left\{1\right\}\left\{m\right\} \end\left\{matrix\right\} \right\right] \end\left\{matrix\right\} \right\right] = \left\left[ \begin\left\{matrix\right\} 0 & \frac\left\{1\right\}\left\{m\right\} \\ \frac\left\{1\right\}\left\{m\right\} & -\frac\left\{k_1\right\}\left\{m^2\right\} \end\left\{matrix\right\} \right\right]$

which has full rank for all $k_1$ and $m$.

The observability test is then

$\left\left[ \begin\left\{matrix\right\} C \\ CA \end\left\{matrix\right\} \right\right] = \left\left[ \begin\left\{matrix\right\} \left\left[ \begin\left\{matrix\right\} 1 & 0 \end\left\{matrix\right\} \right\right] \\ \left\left[ \begin\left\{matrix\right\} 1 & 0 \end\left\{matrix\right\} \right\right] \left\left[ \begin\left\{matrix\right\} 0 & 1 \\ -\frac\left\{k_2\right\}\left\{m\right\} & -\frac\left\{k_1\right\}\left\{m\right\} \end\left\{matrix\right\} \right\right] \end\left\{matrix\right\} \right\right] = \left\left[ \begin\left\{matrix\right\} 1 & 0 \\ 0 & 1 \end\left\{matrix\right\} \right\right]$

which also has full rank. Therefore, this system is both controllable and observable.

## Nonlinear systems

The more general form of a state space model can be written as two functions.

$\mathbf\left\{\dot\left\{x\right\}\right\}\left(t\right) = \mathbf\left\{f\right\}\left(t, x\left(t\right), u\left(t\right)\right)$
$\mathbf\left\{y\right\}\left(t\right) = \mathbf\left\{h\right\}\left(t, x\left(t\right), u\left(t\right)\right)$

The first is the state equation and the latter is the output equation. If the function $f\left(\cdot,\cdot,\cdot\right)$ is a linear combination of states and inputs then the equations can be written in matrix notation like above. The $u\left(t\right)$ argument to the functions can be dropped if the system is unforced (i.e., it has no inputs).

### Pendulum example

A classic nonlinear system is a simple unforced pendulum

$ml^2\ddot\theta\left(t\right)= mg\sin\theta\left(t\right)l - kl\dot\theta\left(t\right)$

where

• $\theta\left(t\right)$ is the angle of the pendulum with respect to the direction of gravity
• $m$ is the mass of the pendulum (pendulum rod's mass is assumed to be zero)
• $g$ is the gravitational acceleration
• $k$ is coefficient of friction at the pivot point
• $l$ is the radius of the pendulum (to the center of gravity of the mass $m$)

The state equations are then

$\dot\left\{x_1\right\}\left(t\right) = x_2\left(t\right)$
$\dot\left\{x_2\right\}\left(t\right) = \frac\left\{g\right\}\left\{l\right\}\sin\left\{x_1\right\}\left(t\right) - \frac\left\{k\right\}\left\{m\right\}\left\{x_2\right\}\left(t\right)$

where

• $x_1\left(t\right) = \theta\left(t\right)$ is the angle of the pendulum
• $x_2\left(t\right) = \dot\left\{x_1\right\}\left(t\right)$ is the rotational velocity of the pendulum
• $\dot\left\{x_2\right\} = \ddot\left\{x_1\right\}$ is the rotational acceleration of the pendulum

Instead, the state equation can be written in the general form

$\dot\left\{\mathbf\left\{x\right\}\right\}\left(t\right) = \left\left( \begin\left\{matrix\right\} \dot\left\{x_1\right\}\left(t\right) \\ \dot\left\{x_2\right\}\left(t\right) \end\left\{matrix\right\} \right\right) = \mathbf\left\{f\right\}\left(t, x\left(t\right)\right) = \left\left( \begin\left\{matrix\right\} x_2\left(t\right) \\ \frac\left\{g\right\}\left\{l\right\}\sin\left\{x_1\right\}\left(t\right) - \frac\left\{k\right\}\left\{m\right\}\left\{x_2\right\}\left(t\right) \end\left\{matrix\right\} \right\right).$

The equilibrium/stationary points of a system are when $\dot\left\{x\right\} = 0$ and so the equilibrium points of a pendulum are those that satisfy

$\left\left( \begin\left\{matrix\right\} x_1 \\ x_2 \end\left\{matrix\right\} \right\right) = \left\left( \begin\left\{matrix\right\} n\pi \\ 0 \end\left\{matrix\right\} \right\right)$

for integers n.