This is an old revision of the document!
State-space model
A state-space model models a system as a set of inputs, outputs, and state variables.
- The change in the state variables is a function of state variables and inputs. This change is described by the state evolution equations.
- For a CT system, the change is represented by the time derivatives. The resulting equations are differential equations.
- For a DT system, the change is represented by giving the value of the state variables at the next timestep. The resulting equations are difference equations.
- The output is similarly written as a function of state variables and inputs.
Linear state-space models can be written in matrix form.
State-space models can also be written with nonlinear equations. They can be linearized around a equilibrium point to get a linear model, which can then be written in a matrix form.
General linear forms
CT state-space
$$ \dot{\mathbf{q}}(t) = \mathbf{A}(t)\mathbf{q}(t) + \mathbf{B}(t)\mathbf{x}(t) $$ $$ \mathbf{y}(t) = \mathbf{C}(t)\mathbf{q}(t) + \mathbf{D}(t)\mathbf{x}(t) $$
Variables:
- $\mathbf{q}(t) = \begin{bmatrix} q_1 \\ q_2 \\ \vdots \\ q_L \end{bmatrix}$ is the state vector, where $L$ is the number of states.
- $\mathbf{y}(t) = \begin{bmatrix} y_1 \\ y_2 \\ \vdots \\ y_q \end{bmatrix}$ is the output vector, where $q$ is the number of outputs.
- $\mathbf{x}(t) = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_p \end{bmatrix}$ is the input vector, where $p$ is the number of inputs.
Parameters:
- $\mathbf{A} = \begin{bmatrix} A_{11} & \dots & A_{1L} \\ \vdots & \ddots & \\ A_{L1} & & A_{LL} \end{bmatrix}$ is the state/system matrix. It describes how the change (time derivative) of the states depends on the current values of the states.
- $\mathbf{B} = \begin{bmatrix} B_{11} & \dots & B_{1p} \\ \vdots & \ddots & \\ B_{L1} & & A_{Lp} \end{bmatrix}$ is the input matrix. It describes how the change of the states depends on the values of the inputs.
- $\mathbf{C} = \begin{bmatrix} C_{11} & \dots & C_{1L} \\ \vdots & \ddots & \\ C_{q1} & & C_{qL} \end{bmatrix}$ is the output matrix. It describes how the output depends on the current values of the states.
- $\mathbf{D} = \begin{bmatrix} D_{11} & \dots & D_{1p} \\ \vdots & \ddots & \\ D_{q1} & & D_{qp} \end{bmatrix}$ is the feedthrough/feedforward matrix. It describes how the output depends on the current values of the inputs.
Additional conditions
- For time-invariant systems, $\mathbf{A}$, $\mathbf{B}$, $\mathbf{C}$, and $\mathbf{D}$ are constant.
- For a single-input, single-output (SISO) system, $q = p = 1$.
DT state-space
$$ \mathbf{q}[n+1] = \mathbf{A}[n]\mathbf{q}[n] + \mathbf{B}[n]\mathbf{x}[n] $$ $$ \mathbf{y}[n] = \mathbf{C}[n]\mathbf{q}[n] + \mathbf{D}[n]\mathbf{x}[n] $$
Writing state-space models
- Choose state variables, which represent the memory of the system.
- Energy is often a good candidate for state variables.
- The first time derivative (CT case) or the difference (DT case) should be able to be written as a function of the current values of the state variables and the inputs.
- If only the second derivative of the state variable can be written in terms of current values of the state variables and inputs, then the first derivative of that state variable may be needed as another state variable.
- Write the state evolution equations.
- These equations relate the time derivative or difference of state variables to the current values of the state variables and inputs.
- Write the instantaneous output equation.
- These equations relate the outputs to the current values of the state variables and inputs.
- If the system is not linear, then linearize the model.
- Convert the state evolution and instantaneous output equations to matrix form.
Equilibrium
A state-space system is in equilibrium if the state variables do not change over time.
- A CT state-space system is in equilibrium if the time derivatives of the state variables are equal zero.
- Let $\bar{\mathbf{q}}$ and $\bar{\mathbf{x}}$ be the equilibrium values of the state variables and inputs respectively.
- These values must satisfy the following condition:
$$ \mathbf{0} = \mathbf{A}\bar{\mathbf{q}} + \mathbf{B}\bar{\mathbf{x}} $$
- A DT state-space system is in equilibrium if the the state variables at timestep $n+1$ are equal to the state variables at timestep $n$.
- Let $\bar{\mathbf{q}}$ and $\bar{\mathbf{x}}$ be the equilibrium values of the state variables and inputs respectively.
- These values must satisfy the following condition:
$$ \bar{\mathbf{q}} = \mathbf{A}\bar{\mathbf{q}} + \mathbf{B}\bar{\mathbf{x}} $$
Linearizing nonlinear state-space systems
Nonlinear state-space systems can be linearized around an equilibrium point. Small changes in the inputs (around the equilibrium point $\tilde{\mathbf{x}}$, $\tilde{\mathbf{q}}$) result in small changes in the state variables (around the equilibrium point).
$$ \mathbf{x} = \bar{\mathbf{x}} + \tilde{\mathbf{x}} $$ $$ \mathbf{q} = \bar{\mathbf{q}} + \tilde{\mathbf{q}} $$
We can consider $\tilde{\mathbf{q}}$ and $\tilde{\mathbf{x}}$ to be small deviations from the equilibrium. Then we can pretend that $\tilde{\mathbf{q}}$ is a linear function of $\tilde{\mathbf{x}}$.
CT case: $$ \dot{\mathbf{q}}(t) = \mathbf{A}\tilde{\mathbf{q}}(t) + \mathbf{B}\tilde{\mathbf{x}}(t) $$ DT case: $$ \tilde{\mathbf{q}}[n+1] = \mathbf{A}\tilde{\mathbf{q}}[n] + \mathbf{B}\tilde{\mathbf{x}}[n] $$