# State Space Representation and Example

Want create site? Find Free WordPress Themes and plugins.

The state space models derivation is not contrary to that of transfer functions in that the differential equations are written first in order to express the system dynamics.Generally, In transfer function models, these differential equations are transformed and variables are carried off between them in order to achieve the relation between chosen input and output variable quantities.

## What is State Space Representation

For state models, the equations are set up into a set of first-order differential equations in terms of chosen state variables, and the outputs are stated in these same state variables. Since the variables elimination is not an integral part of this method, state models can be obtained easily. State models should be inferred from system equations directly.

Consider a system described by nth-order differential equation.

$\frac{{{d}^{n}}w}{d{{t}^{n}}}+{{a}_{n}}\frac{{{d}^{n-1}}w}{d{{t}^{n-1}}}+.\ldots +{{a}_{2}}\frac{dw}{dt}+{{a}_{1}}w=r\text{ (1)}$

A state mode for this system is not unique but depends on the choice of a set of state variables x1(t), x2(t)… xn (t). One possible choice is the following;

${{x}_{1}}=w$

${{x}_{2}}=\dot{w}$

${{x}_{n}}=\overset{(n-1)}{\mathop{w}}\,$           (n represents system order)

Directly from these definitions the following equations are obtained;

$\overset{.}{\mathop{{{x}_{1}}}}\,={{x}_{2}}$

$\overset{.}{\mathop{{{x}_{2}}}}\,={{x}_{3}}$

${{\overset{.}{\mathop{x}}\,}_{n-1}}={{x}_{n}}$

And substitution of the definitions into (1) yields

${{\overset{.}{\mathop{x}}\,}_{n}}=-{{a}_{1}}{{x}_{1}}-{{a}_{2}}{{x}_{2}}-\ldots -{{a}_{n}}{{x}_{n}}+r$

Together these form a set of first-order differential equations. The output w can also be expressed in terms of the state variables;

${{x}_{1}}=w$

In vector matrix form these equations can be arranged as follows;

\left[ \begin{matrix} \begin{matrix} \overset{\centerdot }{\mathop{{{x}_{1}}}}\, \\ \overset{\centerdot }{\mathop{{{x}_{2}}}}\, \\\end{matrix} \\ \begin{align} & \vdots \\ & \vdots \\\end{align} \\ \overset{\centerdot }{\mathop{{{x}_{n}}}}\, \\\end{matrix} \right]=\left[ \begin{matrix} 0 & \begin{matrix} 1 & 0 & \cdots \\\end{matrix} & 0 \\ \begin{matrix} 0 \\ \vdots \\ 0 \\\end{matrix} & Remaining~Entries & \begin{matrix} 0 \\ \vdots \\ 1 \\\end{matrix} \\ -{{a}_{1}} & \begin{matrix} -{{a}_{2}} & \cdots \\\end{matrix} & -{{a}_{n}} \\\end{matrix} \right]\left[ \begin{matrix} {{x}_{1}} \\ {{x}_{2}} \\ \vdots \\ \begin{matrix} \vdots \\ {{x}_{n}} \\\end{matrix} \\\end{matrix} \right]+\left[ \begin{matrix} 0 \\ \vdots \\ \vdots \\ \begin{matrix} 0 \\ 1 \\\end{matrix} \\\end{matrix} \right]r

$w=\left[ \begin{matrix} 1 & 0 & \cdots & 0 \\\end{matrix} \right]\left[ \begin{matrix} {{x}_{1}} \\ {{x}_{2}} \\ \vdots \\ {{x}_{n}} \\\end{matrix} \right]$

The standard form of a state-space model is as follows:

$\dot{x}=Ax+Bu~\text{ }\left( state~equation \right)$

$y=Cx+Du~\text{ }\left( output~equation \right)$

Here x is the state vector, the vectors of the state variables,

y, the output vector,

u, the control vector,

A, the system matrix,

In the preceding example the control vector is the scalar function r and the output vector the scalar function w. It may be seen that

$x=\left[ \begin{matrix} \begin{matrix} {{x}_{1}} \\ {{x}_{2}} \\\end{matrix} \\ \vdots \\ {{x}_{n}} \\\end{matrix} \right]=\left[ \begin{matrix} \begin{matrix} w \\ {\dot{w}} \\\end{matrix} \\ \vdots \\ {{w}^{\left( n-1 \right)}} \\\end{matrix} \right]$

$B=\left[ \begin{matrix} \begin{matrix} 0 \\ \vdots \\\end{matrix} \\ 0 \\ 1 \\\end{matrix} \right]$

$A=\left[ \begin{matrix} 0 & \begin{matrix} 1 & 0 & \cdots \\\end{matrix} & 0 \\ \begin{matrix} 0 \\ \vdots \\ 0 \\\end{matrix} & Remaining~Entries & \begin{matrix} 0 \\ \vdots \\ 1 \\\end{matrix} \\ -{{a}_{1}} & \begin{matrix} -{{a}_{2}} & \cdots \\\end{matrix} & -{{a}_{n}} \\\end{matrix} \right]$

$C=\left[ \begin{matrix} 1 & 0 \\\end{matrix}~~~\begin{matrix} \cdots & 0 \\\end{matrix} \right]$

$D=0$

This form of A is a companion matrix.

Some of the advantages of the state variables or state space approach are as follows;

1. The state space concept simplifies the mathematical notation by the use of vector equations.
2. The state space formulation of a set of differential equations is easier to solve with a digital computer.
3. The state space formulation is applicable to both linear and non- linear systems.
4. The state space formulation is applicable to multiple-input-multiple-output (MIMO) system.

## State Space Representation Example

Let’s use the following electrical network to illustrate the formulation of a state-space equation. Fig.1: RLC Electrical Network viewed as a Process

To illustrate that a given set is not unique two different sets of state variables will be used. As a rule of thumb, the order of a system equals the number of energy storage elements, especially in electrical networks.

The plant or process is an electrical circuit, and the control variables u is the applied voltage e (t). The immediate step is to determine the order of the system which in this case is 2, corresponding to the 2 independent energy storage elements, the capacitor, and the inductor.

### State Variables set 1

Select the voltage v and the current i as the state variables; the state equations become

$\frac{dv}{dt}=\frac{i}{C}~~\text{ (1a)}$

And

$\frac{di}{dt}=-\frac{R}{L}i-\frac{1}{L}v+\frac{1}{L}e\text{ (1b)}$

By the definition of stat variables, we write

$x=\left[ \begin{matrix} {{x}_{1}} \\ {{x}_{2}} \\\end{matrix} \right]=\left[ \frac{v}{i} \right]$

And express Eqs. (1a,1b) as

$\dot{x}=Ax+Bu$

Where

$A=\left[ \begin{matrix} 0 & \frac{1}{C} \\ -\frac{1}{L} & -\frac{R}{L} \\\end{matrix} \right]$

$b=\left[ \begin{matrix} 0 \\ \frac{1}{L} \\\end{matrix} \right]$

$u=e$

The use of lowercase b designates a vector. The symbol u is not boldface since we have a scalar for the control force. The output, then, is v and Ri or x1 and Rx2, which in matrix from becomes.

$C=Cx$

Where

c=\left[ \begin{align} & {{c}_{1}} \\ & {{c}_{2}} \\\end{align} \right]

$C=\left[ \begin{matrix} 1 & 0 \\ 0 & R \\\end{matrix} \right]$

For this choice, the two state variables can easily be determined from the output vectors; that is,

${{x}_{1}}={{c}_{1}}$

${{x}_{2}}=\frac{{{c}_{2}}}{R}$

## State Variable set 2

The equation for the system in figure 1 can be written as

$e=Ri+L\frac{di}{dt}+v$

And using

$i=C\frac{dv}{dt}$

We have

$e=RC\frac{dv}{dt}+LC\frac{{{d}^{2}}v}{d{{t}^{2}}}+v$

By the use of the Laplace Transform, we have

$\frac{V\left( s \right)}{E\left( s \right)}=\frac{{}^{1}/{}_{LC}}{{{s}^{2}}+{}^{Rs}/{}_{L}+{}^{1}/{}_{LC}}$

In order to have a numerical result, select R=6Ω, L=1H, and C=0.2F.then

$\frac{V\left( s \right)}{E\left( s \right)}=\frac{5}{{{s}^{2}}+6s+5}=\frac{5}{\left( s+1 \right)\left( s+5 \right)}$

By expanding this transfer function into partial fraction, we have

$\frac{V\left( s \right)}{E\left( s \right)}=\frac{1.25}{s+1}-\frac{1.25}{s+5}$

From which

$V\left( s \right)=\frac{1.25~E\left( s \right)}{s+1}-\frac{1.25~E\left( s \right)}{s+5}$

Now, we define

${{x}_{1}}\left( s \right)=\frac{1.25~E\left( s \right)}{s+1}$

${{x}_{2}}\left( s \right)=-\frac{1.25~E\left( s \right)}{s+5}$

These equations become

$s{{X}_{1}}\left( s \right)=-{{x}_{1}}\left( s \right)+1.25~E\left( s \right)\text{ (2a)}$

 ${{X}_{2}}\left( s \right)=-5{{X}_{2}}\left( s \right)-1.25~E\left( s \right)\text{ 2(b)}$

The inverse Laplace Transforms of Equations 2(a) and 2(b) yield

${{\overset{.}{\mathop{x}}\,}_{1}}=-{{x}_{1}}+1.25~e$

$\overset{.}{\mathop{{{x}_{2}}}}\,=-5{{x}_{2}}-1.25~e$

Which in state-space form become

$\dot{x}=Ax+bu$

Where

$A=\left[ \begin{matrix} -1 & 0 \\ 0 & -5 \\\end{matrix} \right]$

$~b=\left[ \begin{matrix} 1.25 \\ -1.25 \\\end{matrix} \right]$

$u=e$

Since

$V\left( s \right)={{X}_{1}}\left( s \right)+{{X}_{2}}\left( s \right)$

We have

$v={{x}_{1}}+{{x}_{2}}$

Or

$c=\left[ 1~~~1 \right]x=Cx$

Where

$c=v$

This example illustrates that the choice of state variables to represent a system is not unique and that the choice of states does not always have a simple physical interpretation. Also shown is that the choice is not completely arbitrary.

Did you find apk for android? You can find new Free Android Games and apps.