In control engineering and system identification, a state-space representation is a mathematical model of a physical system specified as a set of input, output, and variables related by first-order differential equations or difference equations. Such variables, called state variables, evolve over time in a way that depends on the values they have at any given instant and on the externally imposed values of input variables. Output variables’ values depend on the state variable values and may also depend on the input variable values.
The state space or phase space is the geometric space in which the axes are the state variables. The system state can be represented as a vector, the state vector.
If the dynamical system is linear, time-invariant, and finite-dimensional, then the differential and algebraic equations may be written in matrix form.[1] [2] The state-space method is characterized by the algebraization of general system theory, which makes it possible to use Kronecker vector-matrix structures. The capacity of these structures can be efficiently applied to research systems with or without modulation.[3] 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
q
q x p
The state-space model can be applied in subjects such as economics, statistics,[4] computer science and electrical engineering,[5] and neuroscience.[6] In econometrics, for example, state-space models can be used to decompose a time series into trend and cycle, compose individual indicators into a composite index,[7] identify turning points of the business cycle, and estimate GDP using latent and unobserved time series.[8] Many applications rely on the Kalman Filter or a state observer to produce estimates of the current unknown state variables using their previous observations.[9] [10]
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.[11] The minimum number of state variables required to represent a given system,
n
p
q
n
x |
(t)=A(t)x(t)+B(t)u(t)
y(t)=C(t)x(t)+D(t)u(t)
x( ⋅ )
x(t)\inRn
y( ⋅ )
y(t)\inRq
u( ⋅ )
u(t)\inRp
A( ⋅ )
\dim[A( ⋅ )]=n x n
B( ⋅ )
\dim[B( ⋅ )]=n x p
C( ⋅ )
\dim[C( ⋅ )]=q x n
D( ⋅ )
D( ⋅ )
\dim[D( ⋅ )]=q x p
x |
(t):=
d | |
dt |
x(t)
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
t\inR
t\inZ
k
t
System type | State-space model | ||
Continuous time-invariant |
(t)=Ax(t)+Bu(t) y(t)=Cx(t)+Du(t) | ||
Continuous time-variant |
(t)=A(t)x(t)+B(t)u(t) y(t)=C(t)x(t)+D(t)u(t) | ||
Explicit discrete time-invariant | x(k+1)=Ax(k)+Bu(k) y(k)=Cx(k)+Du(k) | ||
Explicit discrete time-variant | x(k+1)=A(k)x(k)+B(k)u(k) y(k)=C(k)x(k)+D(k)u(k) | ||
Laplace domain of continuous time-invariant | sX(s)-x(0)=AX(s)+BU(s) Y(s)=CX(s)+DU(s) | ||
Z-domain of discrete time-invariant | zX(z)-zx(0)=AX(z)+BU(z) Y(z)=CX(z)+DU(z) |
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
bf{G}(s)=k
(s-z1)(s-z2)(s-z3) | |
(s-p1)(s-p2)(s-p3)(s-p4) |
.
The denominator of the transfer function is equal to the characteristic polynomial found by taking the determinant of
sI-A
λ(s)=|sI-A|.
The zeros found in the numerator of
bf{G}(s)
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).
See main article: Controllability.
The 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{rank}\begin{bmatrix}B&AB&A2B& … &An-1B\end{bmatrix}=n,
See 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{rank}\begin{bmatrix}C\ CA\ \vdots\ CAn-1\end{bmatrix}=n.
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
x |
(t)=Ax(t)+Bu(t)
yields
sX(s)-x(0)=AX(s)+BU(s).
X(s)
(sI-A)X(s)=x(0)+BU(s)
X(s)=(sI-A)-1x(0)+(sI-A)-1BU(s).
Substituting for
X(s)
Y(s)=CX(s)+DU(s),
Y(s)=C((sI-A)-1x(0)+(sI-A)-1BU(s))+DU(s).
Assuming zero initial conditions
x(0)=0
G(s)=Y(s)/U(s)
Y(s)=G(s)U(s)
using the method of equating the coefficients which yields
G(s)=C(sI-A)-1B+D
Consequently,
G(s)
q x p
See 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:
bf{G}(s)=
n1s3+n2s2+n3s+n4 | |
s4+d1s3+d2s2+d3s+d4 |
.
The coefficients can now be inserted directly into the state-space model by the following approach:
x |
(t)=\begin{bmatrix} 0&1&0&0\\ 0&0&1&0\\ 0&0&0&1\\ -d4&-d3&-d2&-d1 \end{bmatrix}x(t)+\begin{bmatrix}0\ 0\ 0\ 1\end{bmatrix}u(t)
y(t)=\begin{bmatrix}n4&n3&n2&n1\end{bmatrix}x(t).
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
bf{x |
bf{y}(t)=\begin{bmatrix}0&0&0&1\end{bmatrix}bf{x}(t).
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).
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.
bf{G}(s)=bf{G}SP(s)+bf{G}(infty).
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
bf{y}(t)=bf{G}(infty)bf{u}(t)
Here is an example to clear things up a bit:
bf{G}(s)=
s2+3s+3 | |
s2+2s+1 |
=
s+2 | |
s2+2s+1 |
+1
bf{x |
bf{y}(t)=\begin{bmatrix}1&2\end{bmatrix}bf{x}(t)+\begin{bmatrix}1\end{bmatrix}bf{u}(t)
bf{G}(infty)
A common method for feedback is to multiply the output by a matrix K and setting this as the input to the system:
u(t)=Ky(t)
x |
(t)=Ax(t)+Bu(t)
y(t)=Cx(t)+Du(t)
becomes
x |
(t)=Ax(t)+BKy(t)
y(t)=Cx(t)+DKy(t)
solving the output equation for
y(t)
x |
(t)=\left(A+BK\left(I-DK\right)-1C\right)x(t)
y(t)=\left(I-DK\right)-1Cx(t)
The advantage of this is that the eigenvalues of A can be controlled by setting K appropriately through eigendecomposition of
\left(A+BK\left(I-DK\right)-1C\right)
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
x |
(t)=\left(A+BK\right)x(t)
y(t)=x(t)
This reduces the necessary eigendecomposition to just
A+BK
In addition to feedback, an input,
r(t)
u(t)=-Ky(t)+r(t)
x |
(t)=Ax(t)+Bu(t)
y(t)=Cx(t)+Du(t)
becomes
x |
(t)=Ax(t)-BKy(t)+Br(t)
y(t)=Cx(t)-DKy(t)+Dr(t)
solving the output equation for
y(t)
x |
(t)=\left(A-BK\left(I+DK\right)-1C\right)x(t)+B\left(I-K\left(I+DK\right)-1D\right)r(t)
y(t)=\left(I+DK\right)-1Cx(t)+\left(I+DK\right)-1Dr(t)
One fairly common simplification to this system is removing D, which reduces the equations to
x |
(t)=\left(A-BKC\right)x(t)+Br(t)
y(t)=Cx(t)
A classical linear system is that of one-dimensional movement of an object (e.g., a cart).Newton's laws of motion for an object moving horizontally on a plane and attached to a wall with a spring:
m\ddot{y}(t)=u(t)-b
y |
(t)-ky(t)
where
y(t)
y(t) |
\ddot{y}(t)
u(t)
b
k
m
The state equation would then become
\begin{bmatrix}
x |
1(t)\
x |
2(t)\end{bmatrix} =\begin{bmatrix}0&1\ -
k | |
m |
&-
b | |
m |
\end{bmatrix}\begin{bmatrix}x1(t)\ x2(t)\end{bmatrix} +\begin{bmatrix}0\
1 | |
m |
\end{bmatrix}u(t)
y(t)=\left[\begin{matrix}1&0\end{matrix}\right]\left[\begin{matrix}
x1(t) |
\ x2(t) |
\end{matrix}\right]
where
x1(t)
x2(t)=
x |
1(t)
x |
2(t)=\ddot{x}1(t)
y(t)
The controllability test is then
\begin{bmatrix}B&AB\end{bmatrix} =\begin{bmatrix}\begin{bmatrix}0\
1 | |
m |
\end{bmatrix}&\begin{bmatrix}0&1\ -
k | |
m |
&-
b | |
m |
\end{bmatrix}\begin{bmatrix}0\
1 | |
m |
\end{bmatrix}\end{bmatrix} =\begin{bmatrix}0&
1 | \ | |
m |
1 | |
m |
&-
b | |
m2 |
\end{bmatrix}
which has full rank for all
b
m
y(t)
y(t) |
\ddot{y}(t)
b
m
u
The observability test is then
\begin{bmatrix}C\ CA\end{bmatrix} =\begin{bmatrix}\begin{bmatrix}1&0\end{bmatrix}\ \begin{bmatrix}1&0\end{bmatrix}\begin{bmatrix}0&1\ -
k | |
m |
&-
b | |
m |
\end{bmatrix}\end{bmatrix} =\begin{bmatrix}1&0\ 0&1\end{bmatrix}
which also has full rank. Therefore, this system is both controllable and observable.
The more general form of a state-space model can be written as two functions.
|
=f(t,x(t),u(t))
y(t)=h(t,x(t),u(t))
The first is the state equation and the latter is the output equation.If the function
f( ⋅ , ⋅ , ⋅ )
u(t)
A classic nonlinear system is a simple unforced pendulum
m\ell2\ddot\theta(t)=-m\ellg\sin\theta(t)-k\ell
\theta(t) |
where
\theta(t)
m
g
k
\ell
m
x |
1(t)=x2(t)
x |
2(t)=-
g | |
\ell |
\sin{x1}(t)-
k | |
m\ell |
{x2}(t)
where
x1(t)=\theta(t)
x2(t)=
x |
1(t)
x |
2=\ddot{x}1
Instead, the state equation can be written in the general form
x |
(t)=\begin{bmatrix}
x |
1(t)\
x |
2(t)\end{bmatrix}=f(t,x(t))=\begin{bmatrix}x2(t)\ -
g | |
\ell |
\sin{x1}(t)-
k | |
m\ell |
{x2}(t)\end{bmatrix}.
The equilibrium/stationary points of a system are when
x |
=0
\begin{bmatrix}x1\ x2\end{bmatrix}=\begin{bmatrix}n\pi\ 0\end{bmatrix}
for integers n.