\chapter{Linear Time-Invariant (LTI) Systems}
\begin{flushright}
\parbox{5.5in}{In bear country, wear bells to avoid surprising bruins. Don't approach a bear, but don't run away from one either. Movement may incite a charge, and a bear can outrun you.

If a bear approaches you, talk to it calmly in a low, firm voice. Slowly back away until the bear is out of sight. If you climb a tree, get at least 12 feet up.

If a bear senses that its food may be stolen or that its cub is in danger, it may charge. If this happens, drop to the ground and assume a fetal position, protecting your head with your arms, and play dead. Keep your pack on; it may serve as armor.~\cite[pages~18--19]{rd91}}
\end{flushright}

\bigskip

We begin our discussion of linear system theory with a description of the concept of linearity\index{linearity!concept of} by Mitchell J. Feigenbaum~\cite[page~3]{peitgen92}, who is a researcher of nonlinear systems. ``Linearity means that the rule that determines what a piece of a system is going to do next is not influenced by what it is doing now. More precisely, this is intended in a differential or incremental sense: For a linear spring\index{spring!linear}\index{linear spring}, the increase of its tension is proportional to the increment whereby it is stretched, with the ratio of these increments exactly independent of how much it has already been stretched. Such a spring can be stretched arbitrarily far, and in particular will never snap or break. Accordingly, no real spring\index{real spring}\index{spring!real} is linear.'' The real world\index{real world!nonlinear}\index{nonlinear!real world} is nonlinear. However, there is a number of reasons to investigate linear systems. Linear models\index{linear!approximate nonlinear} are often used to approximate nonlinear systems. Many times, this approximation is sufficient for the controller design for the underlying nonlinear system. Knowledge of linear system theory helps to understand the intricate theory of nonlinear systems.

In this chapter, we acquaint ourselves with basic concepts from linear systems that are used in subsequent chapters.
\section{Reachability and Controllability}
We first consider a linear, time-invariant~(LTI)\index{linear time-invariant (LTI)}\index{LTI|see{linear time-invariant}}, discrete-time system\index{discrete-time}\index{system!discrete-time} modeled by
\begin{equation}
\b x[k+1]=\b A\b x[k]+\b B\b u[k],\quad\b x[0]=\b x_0,
\label{eq:ltidissys}
\end{equation}
where $\b A \in \mb{\Bb R}^{n \times n}$, $\b B \in \mb{\Bb R}^{n \times m}$. The solution to~(\ref{eq:ltidissys}) is
\[
\b x[i]=\b A^i\b x[0]+\sum_{k=0}^{i-1} \b A^{i-k-1}\b B \b u[k],
\]
which can be represented as
\begin{equation}
\b x[i]=\b A^i\b x[0]+\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{i-1}\b B
\end{array}\right]\left[ \begin{array}{c}
\b u[i-1]\\
\b u[i-2]\\
\vdots\\
\b u[0]
\end{array}\right].
\label{eq:altrepofsol}
\end{equation}
Let
\[
\b U_i=\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{i-1}\b B
\end{array}\right],\quad i=1,2,\ldots .
\]
Note that $\b U_i\in \mb{\Bb R}^{n\times mi}$. If for some positive $l$,
\[
\mb{rank}\,\b U_l = \mb{rank}\,\b U_{l+1},
\]
then all the columns of $\b A^{l}\b B$ are linearly dependent\index{linearly dependent} on those of $\b U_l$. This, in turn, implies that all the columns of $\b A^{l+1}\b B$, $\b A^{l+2}\b B,\ldots$ must also be linearly dependent on those of $\b U_l$. Hence,
\begin{equation}
\mb{rank}\,\b U_l = \mb{rank}\,\b U_{l+1}=\mb{rank}\,\b U_{l+2} = \ldots
\label{eq:inrabyone}
\end{equation}
The above implies that the rank of $\b U_i$ increases by at least one when $i$ is increased by one, until the maximum value of $\mb{rank}\,\b U_i$ is attained. The maximum value of the rank\index{maximum value!of rank} $\b U_i$ is guaranteed to be achieved for $i=n$, which means that, we always have
\begin{equation}
\mb{rank}\,\b U_n = \mb{rank}\,\b U_{n+1}=\mb{rank}\,\b U_{n+2} = \ldots
\label{eq:satrafon}
\end{equation}
It follows from~(\ref{eq:inrabyone}) that if $\mb{rank}\,\b B=r$, then
\begin{equation}
\mb{rank}\;\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{n-1}\b B
\end{array}\right]=\mb{rank}\;\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{n-r}\b B
\end{array}\right].
\label{eq:satrarbp}
\end{equation}
\begin{defn}
We say that the system~(\ref{eq:ltidissys}) is reachable\index{reachable!definition of}\index{system!reachable} if for any $\b x_f$ there exists an integer $q>0$ and a control sequence, $\{\b u[i]:i=0,1,\ldots,q-1\}$, that transfers $\b x[0]=\b 0$ to $\b x[q]=\b x_f$.
\end{defn}\markdefn

\begin{thm}\label{thm:reachfodissy}
The system~(\ref{eq:ltidissys}) is reachable if and only if
\[
rank \left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{n-1}\b B
\end{array}\right]=n.
\]
\end{thm}
{\bf Proof}\quad Using~(\ref{eq:altrepofsol}) where $\b x[0]=\b 0$ and $\b x[q]=\b x_f$, we obtain
\begin{eqnarray}
\b x_f &=& \sum_{k=0}^{q-1} \b A^{q-k-1}\b B \b u[k]\nonumber\\
&=& \left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{q-1}\b B
\end{array}\right]\left[ \begin{array}{c}
\b u[q-1]\\
\b u[q-2]\\
\vdots\\
\b u[0]
\end{array}\right].
\label{eq:xfreafor}
\end{eqnarray}
It follows from the above that for any $\b x_f$ there exists a control sequence\index{control sequence} $\{\b u[i]:i=0,1,\ldots,q-1\}$ that transfers $\b x[0]=\b 0$ to $\b x[q]=\b x_f$ if and only if
\[
\mb{rank}\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{q-1}\b B
\end{array}\right]=\mb{rank}\,\b U_q=n.
\]
By~(\ref{eq:satrafon}) the maximum value of the rank of $\b U_q$ is guaranteed to be attained for $q=n$, which proves the theorem.\\
\hspace*{5.5in} $\Box$
%Let now $\b v\in \mb{\Bb R}$ be such that for some $s\in \mb{\Bb C}$,
%\begin{equation}
%\b v^{\top}\left[ s\b I_n-\b A \vdots \b B\right]=\b 0,
%\label{eq:vtrhau}
%\end{equation}
%that is,
%\[
%\b v^{\top}\b B=\b 0\quad\mb{and}\quad \b v^{\top}\b A=s\b v^{\top}.
%\]
%Then, we have
%\[
%\b v^{\top}\b A\b B=s\b v^{\top}\b B=\b 0,\quad \b v^{\top}\b A^2\b B=s\b v^{\top}\b A\b B=\b %0,\ldots,\b v^{\top}\b A^{n-1}\b B=\b 0,
%\]
%that is,
%\begin{equation}
%\b b^{\top}\left[\begin{array}{cccc}
%\b B&\b A\b B&\cdots \b A^{n-1}\b B
%\end{array}\right]=\b 0
%\label{eq:vtrkalmat}
%\end{equation}

A closely related notion to reachability is the notion of {\em controllability\/}\index{controllability!definition of}.
\begin{defn}
A system is controllable if it can be transferred from any given state to the origin $\b 0$ of the state space by means of an appropriately chosen control law\index{control law}.
\end{defn}\markdefn

%The notion of controllability is related to the property of a controlled system being transferable from any given state to the origin $\b 0$ of the state space by means of an appropriately chosen control law.
\begin{thm}\label{thm:contrfodissy}
The system~(\ref{eq:ltidissys}) is controllable if and only if
\[
\mb{range}\:\left(\b A^n\right)\subset\mb{range}\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{n-1}\b B
\end{array}\right].
\]
\end{thm}
{\bf Proof}\quad Using the solution formula for the system~(\ref{eq:ltidissys}), for the case when $\b x[0]=\b x_0$ and $\b x_f=\b x[q]=\b 0$, we obtain
\begin{eqnarray}
\b A^q\b x_0 &=& -\sum_{k=0}^{q-1} \b A^{q-k-1}\b B \b u[k]\nonumber\\
&=& -\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{q-1}\b B
\end{array}\right]\left[ \begin{array}{c}
\b u[q-1]\\
\b u[q-2]\\
\vdots\\
\b u[0]
\end{array}\right].
\label{eq:stafrxo}
\end{eqnarray}
The system~(\ref{eq:ltidissys}) is controllable if and only if for some $q>0$ and arbitrary initial condition $\b x_0$, the vector $\b A^q\b x_0$ is in the range\index{range} of $\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{q-1}\b B
\end{array}\right]=\b U_q$. Taking into account that the maximal range\index{maximal range}\index{range!maximal} of $\b U_q$ is guaranteed to be attained for $q=n$, the system~(\ref{eq:ltidissys}) is controllable if and only if the condition of the theorem is satisfied.\\
\hspace*{5.5in} $\Box$

Note that the condition of the above theorem can be equivalently represented as
\begin{equation}
\mb{rank}\,\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{n-1}\b B
\end{array}\right]=\mb{rank}\,\left[\begin{array}{ccccc}
\b B & \b A\b B & \cdots & \b A^{n-1}\b B&\b A^n
\end{array}\right].
\label{eq:eqreofcomate}
\end{equation}
We illustrate the above discussion with a simple example that we found in~\cite[page~482]{kaczorek98}.
\begin{example}\rm
Consider a discrete-time system modeled by
\begin{eqnarray}
\b x[k+1]&=&\b A\b x[k]+\b b u[k]\nonumber\\
&=&\left[\begin{array}{cc}
0 & a\\
0 & 0
\end{array}\right]\b x[k]+\left[\begin{array}{c}
1\\
0
\end{array}\right]u[k], \quad a\in \mb{\Bb R}.
\label{eq:twdidiss}
\end{eqnarray}
The above system model is not reachable because
\[
\mb{rank}\left[\begin{array}{cc}
\b b & \b A\b b
\end{array}\right]=\mb{rank}\left[\begin{array}{cc}
1 & 0\\
0 & 0
\end{array}\right]=1<2.
\]
It is easy to check using~(\ref{eq:xfreafor}) that, for example, the state $\b x_f=\left[\begin{array}{cc}
0 & 1
\end{array}\right]^{\top}$ is not reachable from $\b x[0]=\b 0$ because $\b x_f$ does not belong to the range of $\left[\begin{array}{cc}
\b b & \b A\b b
\end{array}\right]$. In fact, nonreachable states\index{nonreachable states} form the set,
\[
\left\{c \left[\begin{array}{c}
0\\
1
\end{array}\right],\; c \in \mb{\Bb R} \right\}.
\]
However, the system~(\ref{eq:twdidiss}) is controllable\index{controllable}\index{controllable!yet not reachable} because for any $a\in \mb{\Bb R}$,
\[
\mb{rank}\left[\begin{array}{cc}
\b b & \b A\b b
\end{array}\right]=\mb{rank}\left[\begin{array}{cc}
1 & 0\\
0 & 0
\end{array}\right]=\mb{rank}\left[\begin{array}{ccc}
\b b & \b A\b b & \b A^2
\end{array}\right]=\mb{rank}\left[\begin{array}{cccc}
1 & 0 & 0 & 0\\
0 & 0 & 0 & 0
\end{array}\right].
\]
That is,
\[
\mb{range}\,\left(\b A^2 \right)=\mb{range}\,(\b O)\subset \mb{range}\,\left[\begin{array}{cc}
\b b & \b A\b b
\end{array}\right].
\]
Using~(\ref{eq:stafrxo}), we can easily see that arbitrary initial state $\b x[0]\in \mb{\Bb R}^2$ of the system~(\ref{eq:twdidiss}) can be transferred to the origin of $\mb{\Bb R}^2$ using, for example, the zero control\index{zero control} sequence, $u[0]=u[1]=0$. This is because $\b A^2=\b O$ and hence $\b A^2\b x[0]=\b 0$ for any $\b x[0]\in \mb{\Bb R}^2$.
\end{example}\markex

In summary, for discrete-time linear systems, reachability implies controllability\index{reachability!implies controllability}, and the two notions are equivalent if the matrix $\b A$ of the given discrete system is nonsingular.

We next discuss the notions of reachability\index{reachability} and controllability\index{controllability} for continuous-time linear systems\index{linear systems}\index{linear systems!continuous-time}.
\begin{defn}
We say that the system $\dot{\b x}(t)=\b A\b x(t) + \b B\b u(t)$, where $\b A \in \mb{\Bb R}^{n \times n}$, $\b B \in \mb{\Bb R}^{n \times m}$, or equivalently, the pair $\left(\b A,\b B\right)$, is reachable\index{reachable!definition} if for any $\b x_f \in \mb{\Bb R}^n$ there is $t_1$ and a control law $\b u(t)$ that transfers $\b x(t_0)=\b 0$ to $\b x(t_1)=\b x_f$.
\end{defn}\markdefn

\begin{defn}
We say that the system $\dot{\b x}(t)=\b A\b x(t) + \b B\b u(t)$, or equivalently, the pair $\left(\b A,\b B\right)$, is controllable\index{controllable!definition} if there is a control law $\b u(t)$ that transfers any initial state $\b x_0=\b x(t_0)$ at any time $t_0$ to the origin $\b 0$ of the state space at some time $t_1>t_0$.
\end{defn}\markdefn

It turns out that in the case of continuous, time invariant, systems the two notions are equivalent. Indeed, from the solution formula for the controlled system~(\ref{eq:coreofcotrls}), for $\b x(0)=\b 0$ and $\b x(t_1)=\b x_f$, we obtain
\[
\b x_f =\int_0^{t_1}e^{\b A(t_1-t)}\b B\b u(t)d t.
\]
Premultiplying the above equation by $e^{-\b At_1}$ and rearranging, we get
\begin{equation}
\b v=\int_0^{t_1}e^{-\b A t}\b B\b u(t)dt,
\label{eq:foforaech}
\end{equation}
where $\b v=e^{-\b A t_1}\b x_f$. On the other hand, from the solution formula for the controlled system~(\ref{eq:coreofcotrls}), for $\b x(0)=\b x_0$ and $\b x(t_1)=\b 0$, we obtain
\[
\b 0 =e^{\b A t_1}\b x_0+\int_0^{t_1}e^{\b A(t_1-t)}\b B\b u(t)d t.
\]
Premultiplying the above equation by $e^{-\b At_1}$ and rearranging yields
\begin{equation}
-\b x_0=\int_0^{t_1}e^{-\b A t}\b B\b u(t)dt.
\label{eq:fofocontr}
\end{equation}
Comparing~(\ref{eq:foforaech}) and~(\ref{eq:fofocontr}), we conclude that reachability of the system $\dot{\b x}(t)=\b A\b x(t) + \b B\b u(t)$ is equivalent to its controllability\index{reachability!equivalence to controllability}. This is not true in the case of discrete-time systems, where reachability implies controllability, and the two notions are equivalent if the matrix $\b A$ of the given discrete system is nonsingular.

There are many criteria for checking if a given system is reachable/controllable or not. We present a few of them in this section.
\begin{thm}
The following are equivalent:
\begin{enumerate}
\item [(1)] The system $\dot{\b x}(t)=\b A\b x(t) + \b B\b u(t)$ is reachable;
\item [(2)] rank$\,\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{n-1}\b B
\end{array}\right]=n$;
%\item [(3)] The $n$ rows of the matrix $e^{-\b At} \b B$ are linearly independent over the set of real numbers for all $t\in[0,\infty)$;
\item [(3)] The matrix
\[
\b W(t_0,t_1)=\int_{t_0}^{t_1}e^{-\b A t}\b B \b B^{\top}e^{-\b A^{\top} t} d t
\]
is nonsingular for all $t_1>t_0$;
\end{enumerate}
\end{thm}
{\bf Proof}\quad We first prove the implication\index{implication} $(1) \Rightarrow (2)$, that is, if the pair $\left(\b A,\b B\right)$ is reachable, then the so called controllability matrix\index{controllability!matrix}
\[
\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{n-1}\b B
\end{array}\right]\in \mb{\Bb R}^{n \times mn}
\]
is of full rank $n$. We prove this statement by contraposition\index{contraposition}\index{proof!by contraposition}. Thus, we assume that
\[
\mb{rank}\,\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{n-1}\b B
\end{array}\right] <n,
\]
then, there is a constant $n$-vector $\b q \ne \b 0$ so that
\[
\b q^{\top} \b B = \b 0^{\top},\quad \b q^{\top} \b A\b B=\b 0^{\top},\ldots,\b q^{\top}\b A^{n-1}\b B=\b 0^{\top}.
\]
By the Cayley-Hamilton theorem\index{Cayley-Hamilton theorem} the matrix $\b A$ satisfies its own characteristic equation\index{characteristic equation}. Hence
\[
\b A^n=-a_{n-1}\b A^{n-1}-\cdots-a_1\b A-a_0\b I_n.
\]
Therefore
\[
\b q^{\top}\b A^n\b B = \b q^{\top}\left(-a_{n-1}\b A^{n-1}\b B-\cdots-a_1\b A\b B-a_0\b B \right) = \b 0^{\top}.
\]
By induction\index{induction!proof by}
\[
\b q^{\top}\b A^i\b B=\b 0^{\top}\quad\mb{for}\quad i=n+1,n+2,\ldots
\]
Let now $\b x(0)=\b 0$ and $\b x(t_1)=\b q$. We will show that there is no control law that can transfer the system from $\b x(0)=\b 0$ to $\b x(t_1)=\b q$. From the solution formula for the controlled system, we obtain
\[
\b q =\int_0^{t_1}e^{\b A(t_1-t)}\b B\b u(t)d t.
\]
%Premultiplying the above equation by $e^{-\b At_1}$ and rearranging, we get
%\[
%-\b q=\int_0^{t_1}e^{-\b A t}\b B\b u(t)dt.
%\]
We premultiply the resulting equation by $\b q^{\top}$ to get
\[
0\ne \|\b q\|^2=\int_0^{t_1}\b q^{\top}e^{\b A(t_1- t)}\b B\b u(t)dt=0
\]
because
\[
\b q^{\top}e^{\b A(t_1-t)}\b B=\b q^{\top}\left(\b B+(t_1-t)\b A\b B+\frac{(t_1-t)^2}{2!}\b A^2\b B + \cdots\right)=\b 0^{\top}.
\]
Thus the system cannot be transferred from $\b x(0)=\b 0$ to $\b x(t_1)=\b q$, and hence the pair $\left(\b A,\b B\right)$ is not reachable.

%We will now prove the implication $(2) \Rightarrow (3)$, that is, if the controllability matrix is of full rank, then the $n$ rows of $e^{-\b At}\b B$ are linearly independent over $\mb{\Bb R}$ for all $t\in[0,\infty)$. We prove this statement by contraposition. So assume that for some nonzero $n$-vector $\b q$ we have
%\[
%\b q^{\top}e^{-\b At}\b B = \b 0^{\top},\quad \mb{for all}\quad t\in[0,\infty).
%\]
%If we set $t=0$, then we obtain
%\[
%\b q^{\top}\b B=\b 0^{\top}.
%\]
%Differentiating $\b q^{\top}e^{-\b At}\b B=\b 0$ and letting $t=0$ yields
%\[
%\b q^{\top}\b A\b B=\b 0^{\top}.
%\]
%Continuing this process gives
%\[
%\b q^{\top}\left[\begin{array}{cccc}
%\b B & \b A\b B & \cdots & \b A^{n-1}\b B
%\end{array}\right]
%=\b 0^{\top},
%\]
%which means that $\mb{rank}\left[\begin{array}{cccc}
%\b B & \b A\b B & \cdots & \b A^{n-1}\b B
%\end{array}\right] <n$.

We next prove, by contraposition\index{contraposition}, the implication $(2) \Rightarrow (3)$, that is, if the controllability matrix is of full rank, then $\det \b W(t_0,t_1)\ne 0$ for any $t_1>t_0$. So assume that $\det \b W(t_0,t_1)= 0$. Then, there is a nonzero $n$-vector $\b q\in\mb{\Bb R}^n$ such that
\[
\b q^{\top}\int_{t_0}^{t_1}e^{-\b A t}\b B\b B^{\top}e^{-\b A^{\top} t}d t=\b 0
\]
for all $t\in \left[t_0,t_1\right]$. We postmultiply the above equation by $\b q$ to get
\[
\int_{t_0}^{t_1}\left(\b q^{\top}e^{-\b A t}\b B\right)\left(\b B^{\top}e^{-\b A^{\top} t}\b q \right)d t= 0.
\]
Let $\b v(t)=\b B^{\top}e^{-\b A^{\top}t}\b q$, then the above equation can be written as
\[
\int_{t_0}^{t_1}\|\b v(t)\|^2 d t =0.
\]
However, the above is true if and only if $\b v(t)=\b 0$, that is, if and only if the rows of $e^{-\b At}\b B$ are linearly dependent over the set of real numbers for all $t\in \left[t_0,t_1\right]$. Now, evaluating
\[
\b q^{\top}e^{-\b A t} \b B = \b 0^{\top}
\]
and its successive derivatives\index{successive derivatives} with respect to $t$ at $t=0$, we obtain
\[
\b q^{\top}\b B=\b 0^{\top},\quad \b q^{\top}\b A\b B=\b 0^{\top}, \ldots, \b q^{\top}\b A^{n-1}\b B=\b 0^{\top},
\]
which means that $\mb{rank}\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{n-1}\b B
\end{array}\right] <n$.

We now prove, constructively, the implication $(3) \Rightarrow (1)$. Let $\b x(t_0)=\b x_0$ be an arbitrary initial state and $\b x(t_1)=\b x_f$ an arbitrary final state. Then, we claim that the control law
\begin{equation}
\b u(t)=\b B^{\top}e^{-\b A^{\top}t}\b W^{-1}(t_0,t_1)\left(e^{-\b At_1}\b x(t_1)-e^{-\b At_0}\b x_0\right)
\label{eq:trlsyfota}
\end{equation}
will transfer the system from $\b x_0$ to $\b x_f$. Note that to construct the above control law the matrix $\b W(t_0,t_1)$ must be invertible. Substituting~(\ref{eq:trlsyfota}) into
\[
\b x(t_1) =e^{\b A(t_1-t_0)}\b x_0 + \int_{t_0}^{t_1}e^{\b A(t_1-\tau)}\b B\b u(\tau)d\tau
\]
yields
\begin{eqnarray*}
\b x(t_1) &=& e^{\b A(t_1-t_0)}\b x_0\\
&{}&\quad +e^{\b At_1}\int_{t_0}^{t_1}e^{-\b A\tau}\b B\b B^{\top}e^{-\b A^{\top}\tau} d\tau\b W^{-1}(t_0,t_1)\left(e^{-\b At_1}\b x(t_1)-e^{-\b At_0}\b x_0\right).
\end{eqnarray*}
Performing easy manipulations gives $\b x(t_1)=\b x(t_1)$, which means that indeed the proposed control law does the required job. Thus, we have established equivalence between the three statements of the theorem.\\
\hspace*{5.5in} $\Box$
\begin{example}\label{ex:simp_dcmo}\rm
Consider an armature-controlled DC motor\index{DC motor}\index{DC motor!armature-controlled} system whose schematic is shown in Figure~\ref{fig:open_dcex}, where the system parameters are: $R_a=1\,\Omega$, $L_a\approx 0\,\mb{H}$, $K_b=5\,\mb{V/rad/sec}$, $K_i=5\,\mb{Nm/A}$, and the effective moment of inertia is $I_{eq}=0.1$~kg$\cdot$m$^2$. The gear inertia and friction are negligible.
\begin{figure}
\centering
\includegraphics[scale=0.575]{hw2_b.eps}
\caption{Schematic of an armature-controlled DC motor system of Example~\ref{ex:simp_dcmo}.}
\label{fig:open_dcex}
\end{figure}

Applying Kirchhoff's voltage law\index{Kirchhoff's voltage law} to the armature circuit\index{armature circuit} gives
\begin{equation}
R_a i_a+K_b\dot{\theta} = e_a.
\label{eq:kvltodcmotsys}
\end{equation}
The armature-controlled DC motor\index{DC motor!armature-controlled}\index{armature-controlled!DC motor} uses a constant field current\index{field current}, and therefore the motor torque is
\[
\tau_m=K_i i_a.
\]
The motor torque\index{motor torque!torque delivered} is equal to the torque delivered to the load. Hence,
\begin{equation}
I_{eq}\ddot{\theta} = K_ii_a.
\label{eq:mottoreq}
\end{equation}
Substituting $i_a$ from~(\ref{eq:kvltodcmotsys}) into the above equation and dividing both sides by $I_{eq}$ yields
\begin{eqnarray*}
\ddot{\theta}&=&\frac{K_i}{I_{eq}}\left( \frac{e_a-K_b\dot{\theta}}{R_a}\right)\\
&=&-\frac{K_iK_b}{I_{eq}R_a}\dot{\theta}+\frac{K_i}{I_{eq}R_a}e_a.
\end{eqnarray*}
Let $x_1=\theta$, $x_2=\dot{\theta}$, and $u=e_a$. Then taking into account the system parameters, we represent the above equation in a state space format,
\[
\left[\begin{array}{c}
\dot{x}_1\\
\dot{x}_2
\end{array}\right]=\left[\begin{array}{cc}
0 & 1\\
0 & -250
\end{array}\right]\left[\begin{array}{c}
{x}_1\\
{x}_2
\end{array}\right]+\left[\begin{array}{c}
0\\
50
\end{array}\right]u.
\]

We construct a control $u$ that transfers the system from the initial state $\b x(t_0)=\b x(0)=\left[\begin{array}{cc}
10 & 1
\end{array}\right]^{\top}$ to the final state $\b x(2)=\left[\begin{array}{cc}
0 & 0
\end{array}\right]^{\top}$. Recall that the solution of a controlled system has the form
\[
\b x(t)=e^{\b A(t-t_0)}\b x(t_0)+\int_{t_0}^{t}e^{\b A(t-\tau)}\b B\b u(\tau)d\tau.
\]
Our goal is to find $u$ so that
\[
\b 0=e^{2\b A}\b x(0)+\int_0^2e^{\b A(2-\tau)}\b bu(\tau)d\tau.
\]
One can verify that one such $u$ has the form
\[
u(t)=-\b b^{\top}e^{\b A^{\top}(2-t)}\left( \int_0^2e^{\b A(2-\tau)}\b b\b b^{\top}e^{\b A^{\top}(2-\tau)}d\tau\right)^{-1}e^{2\b A}\b x(0),
\]
where
\[
e^{\b At}=\left[\begin{array}{cc}
1 & \frac{1}{250}\left( 1-e^{-250t}\right)\\
0 & e^{-250t}
\end{array}\right].
\]
Hence,
\begin{eqnarray*}
\int_0^2e^{\b A(2-\tau)}\b b\b b^{\top}e^{\b A^{\top} (2-\tau)}d\tau
&=& \int_0^2\left[\begin{array}{cc}
1 & \frac{1}{250}\left( 1-e^{-250(2-\tau)}\right)\\
0 & e^{-250(2-\tau)}
\end{array}\right]\left[\begin{array}{c}
0\\
50
\end{array}\right]\left[\begin{array}{cc}
0 & 50
\end{array}\right]\\
&{}&\quad\times\left[\begin{array}{cc}
1 & 0\\
\frac{1}{250}\left( 1-e^{-250(2-\tau)}\right)& e^{-250(2-\tau)}
\end{array}\right]d\tau\\
&=& \left[\begin{array}{cc}
0.07976 & 0.02\\
0.02 & 5
\end{array}\right].
\end{eqnarray*}
The inverse of the above matrix is
\[
\left[\begin{array}{cc}
12.5502 & -0.0502\\
-0.0502 & 0.2002
\end{array}\right].
\]
Hence,
\begin{eqnarray*}
u(t) &=& -\left[\begin{array}{cc}
0 & 50
\end{array}\right]\left[\begin{array}{cc}
1 & 0\\
\frac{1}{250}\left( 1-e^{-250(2-t)}\right)& e^{-250(2-t)}
\end{array}\right]\\
&{}&\quad\times \left[\begin{array}{cc}
12.5502 & -0.0502\\
-0.0502 & 0.2002
\end{array}\right]e^{2\b A}\left[\begin{array}{c}
10\\
1
\end{array}\right]\\
&=& 50.22e^{(250t-500)}-25.11.
\end{eqnarray*}
The above control strategy\index{control strategy!transfers} transfers the system from $\b x(0)=\left[\begin{array}{cc}
10 & 1
\end{array}\right]^{\top}$ to $\b x(2)=\left[\begin{array}{cc}
0 & 0
\end{array}\right]^{\top}$. Plots of $x_1$, $x_2$ versus time are shown in Figure~\ref{fig:hw2x}.
\begin{figure}
\centering
\includegraphics[scale=0.5]{hw2x.eps}
%\vspace{4in}
%\centering{\epsfig{file=c:/mybook/hw2x.eps,height=3in}}
%\hskip.5in\special{bmp:c:/ee680/hw2x.bmp x=5.33in y=4in}
\caption{Plots of state variables versus time of Example~\ref{ex:simp_dcmo}.}
\label{fig:hw2x}
\end{figure}
A plot of $u$ versus time is given in Figure~\ref{fig:hw2u}.
\begin{figure}
\centering
\includegraphics[scale=0.5]{hw2u.eps}
%\vspace{4in}
%\centering{\epsfig{file=c:/mybook/hw2u.eps,height=3in}}
%\hskip.5in\special{bmp:c:/ee680/hw2u.bmp x=5.33in y=4in}
\caption{A plot of the control action versus time of Example~\ref{ex:simp_dcmo}.}
\label{fig:hw2u}
\end{figure}
\end{example}\markex

We now give a necessary and sufficient condition for the pair $\left(\b A,\b B\right)$ to be nonreachable\index{nonreachable}.
\begin{thm}
\label{thm_decomp}
The pair $\left(\b A,\b B\right)$ is nonreachable if and only if there is a similarity transformation\index{similarity transformation}index{transformation!similarity} $\b z=\b T\b x$ such that
\[
\tilde{\b A}=\b T\b A\b T^{-1}=\left[\begin{array}{cc}
\b A_1 & \b A_2\\
\b O & \b A_4
\end{array}\right],\quad \tilde{\b B}=\b T\b B=\left[\begin{array}{c}
\b B_1\\
\b O
\end{array}\right],
\]
where the pair $\left(\b A_1,\b B_1\right)$ is reachable, $\b A_1 \in \mb{\Bb R}^{r\times r}$, $\b B_1 \in \mb{\Bb R}^{r\times m}$, and the rank of the controllability matrix of the pair $(\b A,\b B)$ equals $r$.
\end{thm}
{\bf Proof}\quad We first prove necessity $(\Rightarrow)$. After forming the controllability matrix of the pair $(\b A,\b B)$, we use elementary row operations to get
\begin{eqnarray}
\b T\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{n-1}\b B
\end{array}\right]
&=&\left[\begin{array}{cccc}
\b T\b B & \left(\b T\b A\b T^{-1}\right)\left(\b T\b B\right) & \cdots & \left(\b T\b A\b T^{-1}\right)^{n-1}\left(\b T\b B\right)
\end{array}\right]\nonumber\\
&=& \left[\begin{array}{ccccccc}
x & x & x& \cdots & x& x&x\\
0& x& x & \cdots & x & x & x\\
\vdots& {}& {}& \vdots&{}& {}&\vdots\\
0& 0& 0& \cdots&x&x&x\\
0&0&0&0&0&0&0\\
\vdots& {}& {}& \vdots&{}& {}&\vdots\\
0&0&0&0&0&0&0
\end{array}\right]\nonumber\\
&=&\left[\begin{array}{ccccc}
\b B_1 &\b A_1\b B_1 &\b A_1^2\b B_1 &\cdots&\b A_1^{n-1}\b B_1\\
\b O& \b O&\b O &\cdots&\b O
\end{array}\right],
\label{eq:prekalman}
\end{eqnarray}
where the symbol $x$ denotes a ``don't care'', that is, an unspecified scalar\index{unspecified scalar}\index{scalar!unspecified}. We now show that indeed
\[
\tilde{\b A}=\b T\b A\b T^{-1}=\left[\begin{array}{cc}
\b A_1 & \b A_2\\
\b A_3 & \b A_4
\end{array}\right],\quad \tilde{\b B}=\b T\b B=\left[\begin{array}{c}
\b B_1\\
\b O
\end{array}\right],
\]
where $\b A_3=\b O$. It is clear that $\b T\b B$ must have the above form. If $\b A_3$ were not a zero matrix, then we would have
\[
\tilde{\b A}\tilde{\b B}=\left[\begin{array}{cc}
\b A_1\b B_1\\
\b A_3\b B_1
\end{array}\right].
\]
Comparing the above with~(\ref{eq:prekalman}), we conclude that $\b A_3\b B_1=\b O$. Thus,
\[
\tilde{\b A}\tilde{\b B}=\left[\begin{array}{cc}
\b A_1\b B_1\\
\b O
\end{array}\right].
\]
Next we consider
\[
\tilde{\b A}^2\tilde{\b B}=\left[\begin{array}{cc}
\b A_1^2\b B_1\\
\b A_3\b A_1\b B_1
\end{array}\right].
\]
Again, comparing the above with~(\ref{eq:prekalman}) gives
\[
\b A_3\b A_1\b B_1=\b O,
\]
and thus
\[
\tilde{\b A}^2\tilde{\b B}=\left[\begin{array}{cc}
\b A_1^2\b B_1\\
\b O
\end{array}\right].
\]
Continuing in this manner, we conclude that $\b A_3\b A_1^{n-1}\b B_1=\b O$. Thus it follows that
\[
\b A_3\left[\begin{array}{cccc}
\b B_1 & \b A_1\b B_1 & \cdots & \b A_1^{n-1}\b B_1
\end{array}\right]=\b O.
\]
Because rank$\left[\begin{array}{cccc}
\b B_1 & \b A_1\b B_1 & \cdots & \b A_1^{n-1}\b B_1
\end{array}\right] = r$, that is, the controllability matrix of the pair $\left(\b A_1,\b B_1\right)$ is of full rank, we have to have $\b A_3=\b O$, and the proof of necessity is complete.

To prove sufficiency $(\Leftarrow)$, note that if there is a similarity transformation\index{similarity transformation}\index{transformation!similarity} such that
\[
\tilde{\b A}=\b T\b A\b T^{-1}=\left[\begin{array}{cc}
\b A_1 & \b A_2\\
\b O & \b A_4
\end{array}\right],\quad \tilde{\b B}=\b T\b B=\left[\begin{array}{c}
\b B_1\\
\b O
\end{array}\right],
\]
then the controllability matrix\index{controllability matrix} of the pair $\left(\tilde{\b A},\tilde{\b B}\right)$ has the form
\[
\left[\begin{array}{ccccc}
\b B_1 &\b A_1\b B_1 &\b A_1^2\b B_1 &\cdots &\b A_1^{n-1}\b B_1\\
\b O & \b O &\b O  &\cdots &\b O
\end{array}\right].
\]
Hence, the pair $\left(\tilde{\b A},\tilde{\b B}\right)$ is nonreachable. Because the similarity transformation preserves the reachability\index{similarity transformation!preserves reachability} property, the pair $\left(\b A,\b B\right)$ is nonreachable.\\
\hspace*{5.5in}$\Box$

\begin{example}\rm
For the system model,
\[
\dot{\b x} = \left[\begin{array}{cccc}
-1 & 1 & 0 & 1\\
1 & 1 & 0 & 0\\
0 & 0 & 4 & 0\\
1 & 1 & -1 & 2
\end{array}\right]\b x+\left[\begin{array}{cc}
1 & 1\\
0 & 0\\
0 & 0\\
0 & 1
\end{array}\right]\b u,
\]
construct a state variable transformation so that in the new coordinates the reachable part is separated and distinct from the nonreachable\index{reachable!separated from nonreachable} part.

We first form the controllability matrix of the pair $(\b A, \b B)$ to get
\[
\b {\cal U}=\left[\begin{array}{cccc}
\b B & \b A\b B & \b A^2\b B & \b A^3\b B
\end{array}\right] = \left[\begin{array}{cccccccc}
1 & 1 & -1 & 0 & 3 & 4 & -1 & 4\\
0 & 0 & 1 & 1 & 0 & 1 & 3 & 5\\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & 1 & 1 & 3 & 2 & 7 & 7 & 19
\end{array}\right].
\]
We then use the MATLAB command\index{MATLAB command![Q,R]=qr(C)} \verb![Q,R]=qr(C)! to obtain
\[
\b Q=\left[\begin{array}{cccc}
-1 & 0 & 0 & 0\\
0 & 0 & -1 & 0\\
0 & 0 & 0 & 1\\
0 & -1 & 0 & 0
\end{array}\right],\quad \b R=\left[\begin{array}{cccccccc}
-1 & -1 & 1 & 0 & -3 & -4 & 1 & -4\\
0 & -1 & -1 & -3 & -2 & -7 & -7 & -19\\
0 & 0 & -1 & -1 & 0 & -1 & -3 & -5\\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0
\end{array}\right],
\]
where the matrices $\b Q$ and $\b R$ satisfy $\b {\cal U}= \b Q\b R$, and $\b R$ is upper row triangular such that $\mb{rank}\,\b R=\mb{rank}\,\b {\cal U}$. Thus, premultiplying the controllability matrix, $\b {\cal U}$, by $\b Q^{-1}$ reduces this matrix to an upper row triangular matrix $\b R$ because $\b Q^{-1}\b {\cal U}=\b R$. Let $\b z=\b Q^{-1}\b x$ be the state variable transformation. Then in the new coordinates the matrices $\b A$ and $\b B$ take the form
\[
\b Q^{-1}\b A\b Q=\left[\begin{array}{ccc|c}
-1& 1 & 1 & 0\\
1 & 2 & 1 & 1\\
1 & 0 & 1 & 0\\\hline
0 & 0 & 0 & 4
\end{array}\right]\quad\mb{and}\quad
\b Q^{-1}\b B=\left[\begin{array}{cc}
-1& -1\\
0 & -1\\
0 & 0\\
\hline
0 & 0
\end{array}\right].
\]
The dimension of the nonreachable\index{dimension!of nonreachable} part is 1.
\end{example}\markex

\begin{defn}
If the eigenvalues of the noncontrollable part of a given pair $(\b A, \b B)$ are all in the open left-hand complex plane, that is, the nonreachable part is asymptotically stable, then the pair $(\b A, \b B)$ is called stabilizable\index{stabilizable!definition of}.
\end{defn}\markdefn

We now give yet another test for reachability. This test is also known as the Popov-Belevitch-Hautus~(PBH)\index{Popov-Belevitch-Hautus (PBH) test}\index{PBH test|see{Popov-Belevitch-Hautus test}} eigenvector test\index{eigenvector test|see{Popov-Belevitch-Hautus test}}. We denote the set of eigenvalues of a matrix $\b A$ as $\mb{eig}(\b A)$.
\begin{thm}
\label{thm:pbhtest}
The pair $\left(\b A,\b B\right)$ is reachable if and only if
\[
\mb{rank}\left[\begin{array}{cc}
s\b I_n-\b A & \b B
\end{array}\right]=n\quad \mb{for all}\quad s\in \mb{eig}(\b A).
\]
\end{thm}
{\bf Proof}\quad We first prove the necessity part $(\Rightarrow)$ by contraposition\index{proof by contraposition}\index{contraposition!proof by}. If there is a vector $\b q \ne \b 0$ such that for some $s\in \mb{eig}(\b A)$,
\[
\b q^{\top}\left[\begin{array}{cc}
s\b I_n-\b A & \b B
\end{array}\right]=\b 0^{\top},
\]
that is,
\[
\b q^{\top}\b A=s\b q^{\top},\quad \b q^{\top}\b B=\b 0^{\top},
\]
then
\[
\b q^{\top}\b A\b B = s\b q^{\top}\b B= \b 0^{\top},
\]
\[
\b q^{\top}\b A^2\b B = s\b q^{\top}\b A\b B= \b 0^{\top},
\]
and so on, until
\[
\b q^{\top}\b A^{n-1}\b B = s\b q^{\top}\b A^{n-2}\b B= \b 0^{\top}.
\]
We write the above equations in the form
\[
\b q^{\top}\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{n-1}\b B
\end{array}\right]= \b 0^{\top},
\]
which means that the pair $\left(\b A,\b B\right)$ is nonreachable.

We now prove the sufficiency part $(\Leftarrow)$ also by contraposition. So we assume that $\mb{rank}\left[\begin{array}{cccc}
\b B & \b A\b B & \cdots & \b A^{n-1}\b B
\end{array}\right]=r <n$. By Theorem~\ref{thm_decomp}, there exists a state variable transformation\index{state variable!transformation} such that in the new basis the pair $\left(\b A,\b B\right)$ takes the form
\[
\tilde{\b A}=\b T\b A\b T^{-1}=\left[\begin{array}{cc}
\b A_1 & \b A_2\\
\b O & \b A_4
\end{array}\right],\quad \tilde{\b B}=\b T\b B=\left[\begin{array}{c}
\b B_1\\
\b O
\end{array}\right].
\]
We choose $\b q$ of the form
\[
\b q^{\top}=\left[\begin{array}{cc}
\b 0 & \b z
\end{array}\right],
\]
where $\b z\ne\b 0$ is a left eigenvector of $\b A_4$, that is,
\[
\b z\b A_4=s\b z,
\]
where $s\in \mb{eig}(\b A_4)$. Thus
\begin{eqnarray*}
\b q^{\top}\tilde{\b A} &=& \left[\begin{array}{cc}
\b 0 & \b z
\end{array}\right]\tilde{\b A}\\
&=& \left[\begin{array}{cc}
\b 0 & s\b z
\end{array}\right]\\
&=& s\b q^{\top}.
\end{eqnarray*}
Clearly
\[
\b q^{\top}\left[\begin{array}{cc}
s\b I_n-\tilde{\b A} & \tilde{\b B}
\end{array}\right]=\b 0^{\top},
\]
which means that the rank of the matrix $\left[\begin{array}{cc}
s\b I_n-\tilde{\b A} & \tilde{\b B}
\end{array}\right]$ is less than $n$, and therefore the proof of the sufficiency part is complete.\\
\hspace*{5.5in}$\Box$

\section{Observability and Constructability}
As we have seen in the previous section, system reachability\index{reachability} implies the ability to completely control the entire state of the system. Suppose now that the system state is not directly accessible. Instead, we have the output of the system,
\[
\b y=\b C\b x + \b D\b u,
\]
where $\b C\in \mb{\Bb R}^{p\times n}$, $p\le n$, and $\b D\in \mb{\Bb R}^{p\times m}$. However, we still want to know the dynamical behavior of the entire state.

\begin{defn}
We say that the system
\[
\left.\begin{array}{lll}
\dot{\b x} &=& \b A\b x+\b B\b u\\
\b y &=& \b C\b x +\b D\b u,
\end{array}\right\}
\]
or equivalently the pair $\left(\b A,\b C\right)$, is observable\index{observable!definition of} if there is a finite $t_1>t_0$ such that for arbitrary $\b u(t)$ and resulting $\b y(t)$ over $[t_0,t_1]$, we can determine $\b x(t_0)$ from complete knowledge of the system input $\b u$ and output $\b y$.
\end{defn}\markdefn

Note that once $\b x(t_0)$ is known, we can determine $\b x(t)$ from knowledge of $\b u(t)$ and $\b y(t)$ over any finite time interval $[t_0,t_1]$. We now show how to constructively determine $\b x(t_0)$, given $\b u(t)$ and $\b y(t)$. While doing so we establish a sufficiency condition for the system to be observable. The condition is also necessary for the system observability as we show it next. To proceed with constructive determination\index{determination!of state vector} of the state vector, we note that the solution $\b y(t)$ is given by
\[
\b y(t)=\b Ce^{\b A(t-t_0)}\b x(t_0)+\int_{t_0}^{t}\b Ce^{\b A(t-\tau)}\b B\b u(\tau)d\tau +\b D\b u(t).
\]
We subtract $\int_{t_0}^{t}\b Ce^{\b A(t-\tau)}\b B\b u(\tau)d\tau +\b D\b u(t)$ from both sides of the above equation. Let
\[
\b g(t)=\b y(t)-\int_{t_0}^{t}\b Ce^{\b A(t-\tau)}\b B\b u(\tau)d\tau -\b D\b u(t),
\]
then we have
\[
\b g(t)=\b Ce^{\b A(t-t_0)}\b x(t_0),
\]
where $\b g$ is known to us. Our goal now is to determine $\b x(t_0)$. Having $\b x(t_0)$, we can determine the entire $\b x(t)$ for all $t\in[t_0,t_1]$ from the formula
\[
\b x(t)=e^{\b A(t-t_0)}\b x(t_0)+\int_{t_0}^{t}e^{\b A(t-\tau)}\b B\b u(\tau)d\tau.
\]
Premultiplying both sides of $\b g(t)$ by $e^{\b A^{\top}(t-t_0)}\b C^{\top}$ and integrating the resulting expression between the limits $t_0$ and $t_1$, we get
\[
\int_{t_0}^{t_1}e^{\b A^{\top}(t-t_0)}\b C^{\top} \b Ce^{\b A(t-t_0)}dt\,\b x(t_0)=\int_{t_0}^{t_1}e^{\b A^{\top}(t-t_0)}\b C^{\top}\b g(t)dt.
\]
Let
\[
\b V(t_0,t_1)=\int_{t_0}^{t_1}e^{\b A^{\top}t}\b C^{\top}\b C e^{\b At}dt.
\]
Then, after performing some manipulations and assuming that the matrix $\b V(t_0,t_1)$ is invertible, we obtain
\[
\b x(t_0)=e^{\b At_0}\b V^{-1}(t_0,t_1)e^{\b A^{\top}t_0}\int_{t_0}^{t_1}e^{\b A^{\top}(t-t_0)}\b C^{\top}\b g(t)dt.
\]
Knowledge of $\b x(t_0)$ allows us to reconstruct the entire state\index{reconstruct!entire state} $\b x(t)$ over the interval $[t_0,t_1]$. We conclude that if the matrix $\b V(t_0,t_1)$ is invertible, then the system is observable.
\begin{example}\rm
For a dynamical system modeled by
\[
\left.\begin{array}{lll}
\dot{\b x} &=& \left[\begin{array}{cc}
-1/2 & 1/2\\
-1/2 & 1/2
\end{array}\right]\b x+\left[\begin{array}{c}
-1\\
1
\end{array}\right]u\\
y &=& \left[\begin{array}{cc}
1 & 1
\end{array}\right]\b x,
\end{array}\right\}
\]
we determine $\b x(t)$ over the time interval $[0, 10]$ knowing that $u(t)=1$ for $t\ge 0$ and $y(t)=t^2+2t$ for $t\ge0$.

We first find $\b x(0)$. Knowledge of $\b x(0)$ will allow us to find the entire state vector for all $t\in[0,10]$. We have $t_0=0$ and $t_1=10$. Hence,
\begin{eqnarray*}
\b x(t_0) = \b x(0)
&=& e^{\b At_0}\b V^{-1}(t_0,t_1)e^{\b A^{\top}t_0}\int_{t_0}^{t_1}e^{\b A^{\top}(t-t_0)}\b c^{\top}g(t)dt\\
&=& \b V^{-1}(0,10)\int_{0}^{10}e^{\b A^{\top}t}\b c^{\top}g(t)dt,
\end{eqnarray*}
where
\[
g(t)=y(t)-\b c\int_{0}^te^{\b A(t-\tau)}\b bu(\tau)d\tau.
\]
To evaluate the above expression, we first use formula~(\ref{eq:inlatrofunco}) to compute,
\[
e^{\b At} = {\cal L}^{-1}\left( [s\b I_2-\b A]^{-1}\right)= {\cal L}^{-1}\left( \left[\begin{array}{cc}
\frac{1}{s}-\frac{1}{2}\frac{1}{s^2} & \frac{1}{2}\frac{1}{s^2}\\
-\frac{1}{2}\frac{1}{s^2} & \frac{1}{s}+\frac{1}{2}\frac{1}{s^2}
\end{array}\right] \right)
= \left[\begin{array}{cc}
1-\frac{1}{2}t & \frac{1}{2}t\\
-\frac{1}{2}t & 1+\frac{1}{2}t
\end{array}\right].
\]
Next, we compute
\begin{eqnarray*}
\b V(0,10) &=& \int_0^{10}e^{\b A^{\top}t}\b c^{\top}\b ce^{\b At}dt\\
&=& \int_0^{10}\left( \left[\begin{array}{c}
1-t\\
1+t
\end{array}\right]\left[\begin{array}{cc}
1-t & 1+t
\end{array}\right]
\right)dt
= \int_0^{10}\left[\begin{array}{cc}
1-2t+t^2 & 1-t^2\\
1-t^2 & 1+2t + t^2
\end{array}\right]dt\\
&=& \left.\left[\begin{array}{cc}
t-t^2+\frac{t^3}{3} & t-\frac{t^3}{3}\\
t-\frac{t^3}{3} & t+t^2+\frac{t^3}{3}
\end{array}\right]\right\arrowvert^{10}_0
= \left[\begin{array}{cc}
243.333 & -323.333\\
-323.333 & 443.333
\end{array}\right].
\end{eqnarray*}
The inverse of $\b V(0,10)$ is
\[
\b V^{-1}(0,10)=\left[\begin{array}{cc}
0.133 & 0.097\\
0.97 & 0.073
\end{array}\right].
\]
We can now compute $g(t)$ to get
\begin{eqnarray*}
g(t) &=& y(t)-\b c\int_0^te^{\b A(t-\tau)}\b bu(\tau)d\tau\\
&=& t^2+2t -\left[\begin{array}{cc}
1 & 1
\end{array}\right]\int_0^t\left[\begin{array}{c}
-1+t-\tau\\
1+t+\tau
\end{array}\right]d\tau
=t^2+2t-\int_0^t(2t-2\tau)d\tau\\
&=& \left.t^2+2t-2t(\tau)\right\arrowvert_0^t+\left.\tau^2\right\arrowvert_0^t
= t^2+2t-t^2\\
&=&2t.
\end{eqnarray*}
Hence,
\[
\int_0^{10}e^{\b A^{\top}t}\b c^{\top}g(t)dt = \int_0^{10}\left[\begin{array}{c}
(1-t)2t\\
(1+t)2t
\end{array}\right]dt= \left.\left[\begin{array}{c}
t^2-\frac{2}{3}t^3\\
t^2+\frac{2}{3}t^3
\end{array}\right]\right\arrowvert^{10}_0
= \left[\begin{array}{c}
-566.6667\\
766.6667
\end{array}\right].
\]
Finally, we compute
\[
\b x(0) = \b V^{-1}(0,10)\int_0^{10}e^{\b A^{\top}t}\b c^{\top}g(t)dt
= \left[\begin{array}{c}
-1\\
1
\end{array}\right].
\]
Alternatively, we could use the Laplace transform\index{Laplace transform} method to find $\b x(0)$. Knowing $\b x(0)$, we can find $\b x(t)$ for $t\ge0$,
\begin{eqnarray*}
\b x(t) &=& e^{\b At}\b x(0)+\int_0^te^{\b A(t-\tau)}\b bu(\tau)d\tau\\
&=& \left[\begin{array}{c}
-1+t\\
1+t
\end{array}\right]+\left[\begin{array}{c}
(-1+t)t-\frac{t^2}{2}\\
(1+t)t-\frac{t^2}{2}
\end{array}\right]
= \left[\begin{array}{c}
\frac{t^2}{2}-1\\
\frac{t^2}{2}+2t+1
\end{array}\right].
\end{eqnarray*}
\end{example}\markex

We next show that the invertibility of $\b V(t_0,t_1)$ is also necessary for observability\index{observability}.
%We first note that one can use similar arguments to those in the previous section to show that $\b V(t_0,t_1)$ is nonsingular if and only if the $n$ columns of the matrix
%\[
%\b Ce^{\b At}
%\]
%are linearly independent for all $t\in [0,\infty)$ over the set of real numbers.
Hence, if $\b V(t_0,t_1)$ is singular, there exists a nonzero constant vector, say $\b x_a$, such that $\b V(t_0,t_1)\b x_a=\b 0$. This implies that
\[
\b Ce^{\b At}\b x_a = \b 0,
\]
and therefore we can write
\[
\b g(t)=\b Ce^{\b At}\b x_0= \b Ce^{\b At}\left(\b x_0+\b x_a\right).
\]
Thus, $\b x(0)=\b x_0+\b x_a$ yields the same response as $\b x(0)=\b x_0$, which means that we cannot determine the system state, or in other words, the state fails to be observable. In view of the above result, it follows that by repeating essentially the same arguments used in the previous section we can prove the following theorem:
\begin{thm}
The following statements are equivalent:
\begin{itemize}
\item [(1)] The pair $\left(\b A,\b C\right)$ is observable;
\item [(2)] The matrix $\b V(t_0,t_1)$ is nonsingular for all $t_1>t_0$;
%\item [(3)] The $n$ columns of $\b Ce^{\b At}$ are linearly independent for all $t\in[0,\infty)$ over the real numbers;
\item [(3)] The observability matrix\index{observability matrix}
\[
\left[\begin{array}{c}
\b C\\
\b C\b A\\
\vdots\\
\b C\b A^{n-1}
\end{array}\right]\in \mb{\Bb R}^{pn \times n}
\]
is of full rank $n$.
\item [(4)] \[
\mb{rank}\left[\begin{array}{c}
s\b I_n-\b A\\
\b C
\end{array}\right]=n\quad \mb{for all}\quad s\in \mb{eig}(\b A).
\]
\end{itemize}
\end{thm}
\begin{example}\rm
For the dynamical system model,
\[
\left.\begin{array}{lll}
\dot{x}&=&\b A\b x=\left[\begin{array}{cc}
2 & 0\\
3 & -1
\end{array}\right]\b x\\
y&=&\b c\b x=\left[\begin{array}{cc}
-1 & 1
\end{array}\right]\b x,
\end{array}\right\}
\]
we find a non-zero initial vector $\b x(0)=\b x_0$ such that $y(t)=0$ for all $t\ge 0$.

We have, $\b x(t)=e^{\b At}\b x_0$, where
\[
e^{\b At}={\cal L}^{-1}\left( (s\b I-\b A)^{-1}\right)=\left[\begin{array}{cc}
e^{2t} & 0\\
e^{2t}-e^{-t} & e^{-t}
\end{array}\right].
\]
Our objective is to find $\b x_0$ such that
\[
\left[\begin{array}{cc}
-1 & 1
\end{array}\right]e^{\b At}\b x_0 = 0 = y(t),\quad \mb{for all}\quad t\ge 0.
\]
For example, if
\[
\b x_0=\left[\begin{array}{cc}
1 & 1
\end{array}\right]^{\top},
\]
then $y(t)=0$ for all $t\ge 0$. Note that we were able to find $\b x_0 \ne \b 0$ such that $y(t)=0$ for all $t\ge 0$, because for all $t\ge 0$, the columns of $\b c e^{\b At}$ are linearly dependent over the real numbers. This is because the pair $(\b A,\b c)$ is nonobservable\index{nonobservable}. The vector $\b x_0$ is in the null-space of the observability matrix
\[
\left[\begin{array}{c}
\b c\\
\b c\b A
\end{array}\right].
\]
\end{example}\markex

We can also prove analogous result to Theorem~\ref{thm_decomp} for the given pair $(\b A, \b C)$, that is, using a similarity transformation\index{similarity transformation} we can separate the observable part from the nonobservable.

\begin{defn} If the eigenvalues of the nonobservable part of a given pair $(\b A, \b C)$ are all in the open left-hand complex plane, that is, if the nonobservable part is asymptotically stable, then we say that the pair $(\b A, \b C)$ is detectable\index{detectable!definition}.
\end{defn}\markdefn

A related notion to observability is the notion of constructability\index{constructability}.


\begin{defn} We say that the system
\[
\left.\begin{array}{lll}
\dot{\b x} &=& \b A\b x+\b B\b u\\
\b y &=& \b C\b x +\b D\b u,
\end{array}\right\}
\]
or equivalently the pair $\left(\b A,\b C\right)$, is constructable if there is a finite $t_1>t_0$ such that for arbitrary $\b u(t)$ and resulting $\b y(t)$ over $[t_0,t_1]$ we can determine $\b x(t_1)$ from complete knowledge of the system input $\b u$ and output $\b y$.
\end{defn}\markdefn

One can verify that in the case of continuous, time invariant systems, observability is equivalent to constructability. In the case of discrete-time systems observability implies constructability, and the two notions are equivalent if the matrix $\b A$ of the given discrete system is nonsingular.

\section{Minimal Realizations}\label{sec:minmal_realns}

In Section~\ref{sec:realization_tf2ss}, we discussed several methods of converting a transfer function into a state-space representation\index{transfer function!into state-space representation} for both continuous and discrete LTI lumped systems. Recall that if $\b G(s)$ is a proper rational transfer function\index{transfer function!proper rational} matrix then a quadruple of constant matrices $(\b A, \b B, \b C, \b D)$ is a realization\index{realization!of a transfer function} of $\b G(s)$ if $\b G(s)=\b C \left(s\b I_n - \b A  \right)^{-1}\b B + \b D$. Recall also that the dimension of a realization\index{dimension!of a realization} is the size of the matrix $\b A$, that is, if $\b A$ is an $n$-by-$n$ matrix then the dimension of the corresponding realization is $n$.

Different methods may yield realizations of different dimensions\index{realizations!of different dimensions} as is the case in Examples~\ref{ex:firstrealizsizes} and~\ref{ex:differentrealizsizes}. It is easy to see that a proper rational transfer function matrix has infinitely many realizations of different dimensions. A realization with the smallest possible dimension is called a minimal realization\index{minimal realization}\index{realization!minimal}. Necessary and sufficient conditions for a realization to be minimal\index{minimal!necessary and sufficient conditions for} was given by Kalman~\cite{kalman63} in 1963.
\begin{thm} A realization $(\b A, \b B, \b C, \b D)$ of a given transfer function matrix $\b G(s)$ is minimal if and only if the pair $(\b A, \b B)$ is reachable and the pair $(\b A, \b C)$ is observable.
\end{thm}
%{\bf Proof}\quad  First apply Theorem~\ref{thm_decomp} to the pair $(\b A, \b B)$ and its dual version to the\\
%\hspace*{5.5in}$\Box$

We can use Theorem~\ref{thm_decomp} to construct a minimal realization using any realization, say $(\b A, \b B, \b C, \b D)$, of a given transfer function matrix. Indeed, given a realization $(\b A, \b B, \b C, \b D)$. We check if the pair $(\b A, \b B)$ is reachable. If not, we apply Theorem~\ref{thm_decomp} to represent $(\b A, \b B, \b C, \b D)$ in the new coordinates where the reachable part is separated from non-reachable one. In other words, we construct a similarity transformation\index{similarity transformation!equivalence relation} $\b z=\b T\b x$ such that
\[
\tilde{\b A}=\b T\b A\b T^{-1}=\left[\begin{array}{c|c}
\b A_1 & \b A_2\\\hline
\b O & \b A_4
\end{array}\right],\quad \tilde{\b B}=\b T\b B=\left[\begin{array}{c}
\b B_1\\\hline
\b O
\end{array}\right],
\]
where the pair $\left(\b A_1,\b B_1\right)$ is reachable\index{reachable!pair}, $\b A_1 \in \mb{\Bb R}^{r\times r}$, $\b B_1 \in \mb{\Bb R}^{r\times m}$. The matrix $\b C$ becomes
\[
\tilde{\b C}=\b C\b T^{-1}=\left[\begin{array}{c|c}
\b C_1 &  \b C_2
\end{array}\right],
\]
where $\b C_1 \in \mb{\Bb R}^{p\times r}$, and $\tilde{\b D}=\b D$. The transfer functions of $(\b A, \b B, \b C, \b D)$ and $(\tilde{\b A}, \tilde{\b B}, \tilde{\b C}, \b D)$ are the same, that is, the transfer function is invariant under similarity\index{transfer function!invariant under similarity} transformations. We have
\begin{eqnarray}
\b G(s) &=& \b C \left(s\b I_n - \b A  \right)^{-1}\b B + \b D\nonumber\\
&=& \tilde{\b C} \left(s\b I_n - \tilde{\b A}  \right)^{-1}\tilde{\b B} + \b D\nonumber\\
&=& \left[\begin{array}{c|c}
\b C_1 &\b C_2
\end{array}\right]\left[\begin{array}{c|c}
s\b I_r-\b A_1 & -\b A_2\\\hline
\b O &  s\b I_{n-r} - \b A_4
\end{array}\right]^{-1}\left[\begin{array}{c}
\b B_1\\\hline
\b O
\end{array}\right] + \b D\nonumber\\
&=& \left[\begin{array}{c|c}
\b C_1  & \b C_2
\end{array}\right]\left[\begin{array}{c|c}
[s\b I_r-\b A_1]^{-1} & [s\b I_r-\b A_1]^{-1}\b A_2[s\b I_{n-r} - \b A_4]^{-1}\\\hline
\b O & [s\b I_{n-r} - \b A_4]^{-1}
\end{array}\right]\left[\begin{array}{c}
\b B_1\\\hline
\b O
\end{array}\right] + \b D\nonumber\\
&=& \b C_1[s\b I_r-\b A_1]^{-1}\b B_1 + \b D
\label{eq:lowering_sie_n}
\end{eqnarray}
Thus the quadruple $(\b A_1, \b B_1, \b C_1, \b D)$ is a realization of $\b G(s)$ of lower dimension then the realization $(\b A, \b B, \b C, \b D)$.

We proceed to check if the pair $(\b A_1, \b C_1)$ is observable or not. If it is, then $(\b A_1, \b B_1, \b C_1, \b D)$ is a minimal realization of $\b G(s)$. If, on the other hand, the pair $(\b A_1, \b C_1)$ is not observable, we apply a dual version of Theorem~\ref{thm_decomp} to the pair $(\b A_1, \b C_1)$ to extract from it an observable\index{extract observable!from unobservable} part. This observable part along with corresponding input submatrix and the matrix $\b D$ form a minimal realization of $\b G(s)$.

We can obtain a minimal realization\index{minimal realization}\index{realization!minimal} of a given transfer function matrix using MATLAB's function \verb!ss!. We illustrate the use of this function with a numerical example.
\begin{example}\label{ex:min_realiz_ex}\rm We obtain a minimal realization of the transfer function matrix considered in Examples~\ref{ex:firstrealizsizes} and~\ref{ex:differentrealizsizes}. Recall that
\[
\b G(s)=\left[\begin{array}{ccc}
\frac{1}{s(s+2)} & \frac{2s-1}{s(s+2)} & \frac{s-1}{s(s+2)}\\
-\frac{1}{s+2} & \frac{1-s}{s^2+3s+2} & \frac{1}{s^2+3s+2}
\end{array}\right].
\]
We represent the above transfer function matrix as
\begin{verbatim}
G=[tf([1],[1 2 0]) tf([2 -1],[1 2 0]) tf([1 -1],[1 2 0]);...
   tf([-1],[1 2]) tf([-1 1],[1 3 2])  tf([1],[1 3 2])]
\end{verbatim}
We then type in
\begin{verbatim}
sys = ss(G,'min')
\end{verbatim}\index{MATLAB function!ss(G,'min')}
to obtain a fourth dimensional state-space realization of $\b G(s)$, where
\begin{eqnarray*}
\b A & = & \left[\begin{array}{cccc}
-0.2586 &  -0.4843  &  0.1328  & -0.3330\\
0.1033 &  -1.8720 &   0.7555  &  0.3066\\
-1.1740 &  0.5232 &  -1.1520 &  0.6336\\
1.0110 &  -0.0522 &   1.1670 &  -1.7180
\end{array}\right],\, \b B=\left[\begin{array}{ccc}
0.4118 &  -0.3924 &  -0.4021\\
0.6211 &  0.9522  &  0.1655\\
-0.4053 &  -0.9915 &  -0.2931\\
-0.5748 &   1.1860 &   0.8804
\end{array}\right],\\
\b C & = & \left[\begin{array}{cccc}
-0.4876 &  -0.2338 &  -1.5020  &  0.4572\\
-0.8541 &  -1.1970 &  -0.0004 &  -0.1651
\end{array}\right],\, \b D=\b O.
\end{eqnarray*}
It is easy to check, using, for example, MATLAB's functions \verb!ctrb!\index{MATLAB function!ctrb} and \verb!obsv!\index{MATLAB function!obsv} that the pair $(\b A, \b B)$ is reachable and the pair $(\b A, \b C)$ is observable, thus confirming the fact that the above quadruple is indeed a minimal realization of the given transfer function matrix $\b G(s)$.
\end{example}\markex

We may have different minimal realizations of a given transfer function matrix. If this is the case, then they are related via a similarity transformation as shown by Kalman~\cite{kalman63}. That is, minimal realizations of a given transfer function matrix are equivalent\index{minimal realizations!equivalent}\index{minimal realizations!similarity transformation}. Indeed, suppose we have two different minimal realizations $(\b A_1, \b B_1, \b C_1, \b D_1)$ and $(\b A_2, \b B_2, \b C_2, \b D_2)$ of a given proper transfer function matrix $\b G(s)$. Then
\[
\b G(s)=\b C_1(s\b I_n - \b A_1)^{-1}\b B_1+ \b D_1 = \b C_2(s\b I_n - \b A_2)^{-1}\b B_2+ \b D_2
\]
and hence, we have to have
\[
\b D_1=\b D_2
\]
and
\[
\b C_1(s\b I_n - \b A_1)^{-1}\b B_1=\b C_2(s\b I_n - \b A_2)^{-1}\b B_2.
\]
Taking the inverse Laplace transform of both sides yields
\[
\b C_1e^{\b A_1 t}\b B_1 = \b C_2e^{\b A_2 t}\b B_2.
\]
Taking into account that
\[
e^{\b At}=\b I + t\b A + \frac{t^2}{2!}\b A^2+\cdots = \sum_{k=0}^{\infty}\frac{t^k}{k!} \b A^k
\]
we obtain
\[
\sum_{k=0}^{\infty}\frac{t^k}{k!} \b C_1\b A_1^k\b B_1 = \sum_{k=0}^{\infty}\frac{t^k}{k!} \b C_2\b A_2^k\b B_2,
\]
that is,
\begin{equation}
\b C_1\b A_1^k\b B_1 = \b C_2\b A_2^k\b B_2, \quad k=0,1,2,\ldots
\label{eq:markov_parameters}
\end{equation}
The matrices $\b C_i\b A_i^k\b B_i$ are called {\em Markov parameters}\index{Markov parameters}. Thus Markov parameters of different realizations of a given transfer function matrix are equal.

Using~\eqref{eq:markov_parameters}, we obtain
\begin{equation}
\left[\begin{array}{c}
\b C_1\\
\b C_1\b A_1\\
\vdots\\
\b C_1\b A_1^{n-1}
\end{array}\right]\left[\begin{array}{cccc}
\b B_1 & \b A_1\b B_1 & \cdots & \b A_1^{n-1}\b B_1
\end{array}\right]=\left[\begin{array}{c}
\b C_2\\
\b C_2\b A_2\\
\vdots\\
\b C_2\b A_2^{n-1}
\end{array}\right]\left[\begin{array}{cccc}
\b B_2 & \b A_2\b B_2 & \cdots & \b A_2^{n-1}\b B_2
\end{array}\right].
\label{eq:equal_products}
\end{equation}
Let
\[
\b{\cal U}_i=\left[\begin{array}{cccc}
\b B_i & \b A_i\b B_i & \cdots & \b A_i^{n-1}\b B_i
\end{array}\right], \quad i=1,2
\]
and
\[
\b{\cal V}_i=\left[\begin{array}{c}
\b C_i\\
\b C_i\b A_i\\
\vdots\\
\b C_i\b A_i^{n-1}
\end{array}\right], \quad i=1,2.
\]
Then, we represent~\eqref{eq:equal_products} in a compact format as
\begin{equation}
\b{\cal V}_1\b{\cal U}_1  = \b{\cal V}_2\b{\cal U}_2.
\label{eq:shor_ver_eq_pro}
\end{equation}
Pre-multiplying both sides of~\eqref{eq:shor_ver_eq_pro} by $\b{\cal V}_1^{\top}$ gives
\begin{equation}
\b{\cal V}_1^{\top}\b{\cal V}_1\b{\cal U}_1  = \b{\cal V}_1^{\top}\b{\cal V}_2\b{\cal U}_2.
\label{eq:after_prem_byobst}
\end{equation}
Both realizations are minimal, therefore their controllability and observability matrices have full ranks, that is,
\[
\mb{rank}\, \b{\cal U}_i = \mb{rank} \b{\cal V}_i = n,\quad i=1,2.
\]
Hence, the $n\times n$ matrix
\[
\b{\cal V}_1^{\top}\b{\cal V}_1
\]
is invertible. We pre-multiply both sides of~\eqref{eq:after_prem_byobst} by
\[
\left[\b{\cal V}_1^{\top}\b{\cal V}_1  \right]^{-1}
\]
to obtain
\begin{equation}
\b{\cal U}_1=\left[\b{\cal V}_1^{\top}\b{\cal V}_1  \right]^{-1}\b{\cal V}_1^{\top}\b{\cal V}_2\b{\cal U}_2.
\label{eq:prep_for_equ_mat}
\end{equation}
Let
\begin{equation}
\b T_1=\left[\b{\cal V}_1^{\top}\b{\cal V}_1  \right]^{-1}\b{\cal V}_1^{\top}\b{\cal V}_2,
\label{eq:sism_trans_obs}
\end{equation}
then we represent~\eqref{eq:prep_for_equ_mat} as
\[
\b{\cal U}_1=\b T_1\b{\cal U}_2.
\]
We re-write the above as
\begin{eqnarray*}
\left[\begin{array}{cccc}
\b B_1 & \b A_1\b B_1 & \cdots & \b A_1^{n-1}\b B_1
\end{array}\right] &=& \b T_1 \left[\begin{array}{cccc}
\b B_2 & \b A_2\b B_2 & \cdots & \b A_2^{n-1}\b B_2
\end{array}\right]\\
&=& \left[\begin{array}{cccc}
\b T_1\b B_2 & \b T_1\b A_2\b T_1^{-1}\b T_1\b B_2 & \cdots & \b T_1\b A_2^{n-1}\b T_1^{-1}\b T_1\b B_2
\end{array}\right].
%\label{eq:alamos_sism_equi}
\end{eqnarray*}
taking into account that
\[
\b T_1\b A_2^{k}\b T_1^{-1}=\left(\b T_1\b A_2\b T_1^{-1}\right)^{k},
\]
we conclude that the pairs $(\b A_1, \b B_1)$ and $(\b A_2, \b B_2)$ are equivalent\index{equivalent!related via similarity transformation}\index{related via similarity transformation!equivalent}, that is, they are related via the similarity transformation. In other words,
\[
\b A_1=\b T_1\b A_2\b T_1^{-1}\quad\mb{and}\quad \b B_1=\b T_1\b B_2.
\]

The transformation matrix~\eqref{eq:sism_trans_obs} is expressed in terms of the observability matrices. We can express the transformation matrix in terms of the controllability matrices as well. Indeed, post-multiplying both sides of~\eqref{eq:sism_trans_obs} by $\b{\cal U}_1^{\top}$ gives
\begin{equation}
\b{\cal V}_1\b{\cal U}_1\b{\cal U}_1^{\top}  = \b{\cal V}_2\b{\cal U}_2\b{\cal U}_1^{\top}.
\label{eq:afterpost_mul_by_con}
\end{equation}
The $n\times n$ matrix is invertible. We post-multiply both sides of~\eqref{eq:afterpost_mul_by_con} by the matrix
\[
[\b{\cal U}_1\b{\cal U}_1^{\top}]^{-1}
\]
to obtain
\begin{equation}
\b{\cal V}_1= \b{\cal V}_2\b{\cal U}_2\b{\cal U}_1^{\top}[\b{\cal U}_1\b{\cal U}_1^{\top}]^{-1}.
\label{eq:get_t_indIncon}
\end{equation}
Let
\begin{equation}
\b T_2^{-1}=\b{\cal U}_2\b{\cal U}_1^{\top}[\b{\cal U}_1\b{\cal U}_1^{\top}]^{-1},
\label{eq:ttwoinverse}
\end{equation}
then, we can represent~\eqref{eq:get_t_indIncon} as
\[
\b{\cal V}_1=\b{\cal V}_2\b T_2^{-1}.
\]
We re-write the above as
\begin{eqnarray*}
\left[\begin{array}{c}
\b C_1\\
\b C_1\b A_1\\
\vdots\\
\b C_1\b A_1^{n-1}
\end{array}\right] &=& \left[\begin{array}{c}
\b C_2\\
\b C_2\b A_2\\
\vdots\\
\b C_2\b A_2^{n-1}
\end{array}\right]\b T_2^{-1}\\
&=& \left[\begin{array}{c}
\b C_2\b T_2^{-1}\\
\b C_2\b T_2^{-1}\b T_2\b A_2\b T_2^{-1}\\
\vdots\\
\b C_2\b T_2^{-1}\b T_2 \b A_2^{n-1}\b T_2^{-1}
\end{array}\right].
\end{eqnarray*}
Taking into account that
\[
\b T_2 \b A_2^k\b T_2^{-1} = \left( \b T_2 \b A_2\b T_2^{-1}\right)^k
\]
we conclude that the pairs $(\b A_1, \b C_1)$ and $(\b A_2, \b C_2)$ are equivalent, that is,
\[
\b A_1= \b T_2\b A_2\b T_2^{-1}\quad\mb{and}\quad \b C_1 = \b C_2\b T_2^{-1}.
\]

It is easy to verify that
\[
\b T_1=\b T_2.
\]
Indeed, it is enough to show that
\[
\b T_1\b T_2^{-1}=\b I_n.
\]
Using~\eqref{eq:sism_trans_obs} and~\eqref{eq:ttwoinverse} we obtain,
\[
\b T_1\b T_2^{-1}= \left[\b{\cal V}_1^{\top}\b{\cal V}_1  \right]^{-1}\b{\cal V}_1^{\top}\b{\cal V}_2  \b{\cal U}_2\b{\cal U}_1^{\top}[\b{\cal U}_1\b{\cal U}_1^{\top}]^{-1}.
\]
Substituting into the above~\eqref{eq:shor_ver_eq_pro}, that is, $\b{\cal V}_2\b{\cal U}_2=\b{\cal V}_1\b{\cal U}_1$, gives
\begin{eqnarray*}
\b T_1\b T_2^{-1} &=& \left[\b{\cal V}_1^{\top}\b{\cal V}_1  \right]^{-1}\b{\cal V}_1^{\top}\b{\cal V}_1  \b{\cal U}_1\b{\cal U}_1^{\top}[\b{\cal U}_1\b{\cal U}_1^{\top}]^{-1}\\
&=&\b I_n.
\end{eqnarray*}
Hence,
\[
\b T_1=\b T_2=\b T.
\]
In view of the above, we conclude that different minimal realizations\index{minimal realizations!equivalent} of the same transfer function matrix are equivalent, that is,
\begin{equation}
\b A_1= \b T\b A_2\b T^{-1},\quad \b B_1=\b T\b B_2, \quad \b C_1 = \b C_2\b T^{-1}, \quad \b D_1=\b D_2,
\label{eq:min_real_equival}
\end{equation}
where the transformation matrix $\b T$ can be computed using~\eqref{eq:sism_trans_obs} or~\eqref{eq:ttwoinverse}.


\section{Companion Forms}
In this section, we present two types of special forms of a given linear dynamical system model represented by a quadruple $\left( \b A, \b B, \b C, \b D\right)$. These forms are obtained by a change of state variables using similarity transformations. They reveal structural properties of the model. We use the above mentioned forms to construct algorithms for pole placement. The pole placement\index{pole placement} algorithms are then used to design state-feedback\index{state-feedback} controllers, as well as observers. We begin by introducing the controller companion form, or for short, controller form\index{controller form}.

\subsection{Controller Form}
\label{subsec:controform}
We begin by considering a single-input\index{LTI model!single-input}, \index{LTI model!continuous-time}continuous-time, LTI model,
\[
\dot{\b x}(t)=\b A\b x(t)+\b bu(t),
\]
where the pair $\left( \b A,\b b\right)$ is assumed to be reachable, or equivalently, controllable. This means that
\[
\mb{rank}\left[\begin{array}{cccc}
\b b & \b A\b b & \cdots & \b A^{n-1}\b b
\end{array}\right]=n.
\]
We select the last row of the inverse of the controllability matrix\index{controllability matrix}. Let $\b q_1$ be that row. Next, we form the matrix
\begin{equation}
\b T=\left[\begin{array}{c}
\b q_1\\
\b q_1 \b A\\
\vdots\\
\b q_1 \b A^{n-1}
\end{array}\right].
\label{eq:lin_sys_trans}
\end{equation}
Note that $\b T$ is invertible. Indeed, because
\[
\b T \left[\begin{array}{cccc}
\b b & \b A\b b & \cdots & \b A^{n-1}\b b
\end{array}\right]=\left[\begin{array}{ccccc}
0 & 0 & \cdots & 0 & 1\\
0 & 0 & \cdots & 1 & x\\
\vdots &\vdots &{}& \vdots& \vdots\\
1 & x & \cdots & x & x
\end{array}\right],
\]
this implies that $\b T$ must be nonsingular. In the above, we used the symbol $x$ to denote ``don't care'', unspecified, scalars in our present discussion. Consider now the state variable transformation\index{state variable!transformation}, $\tilde{\b x}=\b T\b x$. Then, in the new coordinates, the system model is
\begin{eqnarray*}
\dot{\tilde{\b x}}(t)&=&\b T\b A\b T^{-1}\tilde{\b x}(t)+\b T\b bu(t)\\
&=& \tilde{\b A}\tilde{\b x}(t)+\tilde{\b b}u(t).
\end{eqnarray*}
The matrices $\tilde{\b A}$ and $\tilde{\b b}$ have particular structures that we now discuss. We first analyze the structure of $\tilde{\b b}$. Because $\b q_1$ is the last row of the inverse of the controllability matrix, we have
\[
\b q_1\b b=\b q_1\b A\b b=\cdots=\b q_1\b A^{n-2}\b b=0,
\]
and
\[
\b q_1\b A^{n-1}\b b=1.
\]
Hence,
\[
\tilde{\b b} = \b T\b b=\left[\begin{array}{c}
\b q_1\b b\\
\b q_1 \b A\b b\\
\vdots\\
\b q_1\b A^{n-2}\b b\\
\b q_1 \b A^{n-1}\b b
\end{array}\right]= \left[\begin{array}{c}
0\\
0\\
\vdots\\
0\\
1
\end{array}\right].
\]
The structure of $\tilde{\b A}$ is revealed by considering the relation $\b T\b A\b T^{-1}=\tilde{\b A}$ represented as
\[
\b T\b A=\tilde{\b A}\b T.
\]
The left-hand side of the above matrix equation is
\[
\b T\b A=\left[\begin{array}{c}
\b q_1\b A\\
\b q_1 \b A^2\\
\vdots\\
\b q_1\b A^{n-1}\\
\b q_1 \b A^{n}
\end{array}\right].
\]
By the Cayley-Hamilton theorem\index{Cayley-Hamilton theorem},
\[
\b A^n=-a_0\b I_n-a_1\b A-\cdots-a_{n-1}\b A^{n-1},
\]
and hence
\[
\b q_1\b A^n=-a_0\b q_1-a_1\b q_1\b A-\cdots-a_{n-1}\b q_1\b A^{n-1}.
\]
Comparing both sides of the equation $\b T\b A=\tilde{\b A}\b T$, and taking into account the Cayley-Hamilton theorem, we get
\[
\tilde{\b A}=\left[\begin{array}{cccccc}
0 & 1 & 0& \cdots& 0 & 0\\
0 & 0 & 1 & \cdots & 0 & 0\\
\vdots & \vdots & {} & {} & {} & \vdots\\
0 & 0 & 0 & \cdots & 0 & 1\\
-a_0 & -a_1 & -a_2 & \cdots & -a_{n-2} & -a_{n-1}
\end{array}\right].
\]
Note that the coefficients of the characteristic polynomial\index{characteristic polynomial} of $\b A$ are immediately apparent by inspecting the last row of $\tilde{\b A}$. There are other benefits of the pair $(\b A,\b b)$ being given in its controller form\index{controller form} that we discuss in Section~\ref{sec:linstfec}. We illustrate the above algorithm for reducing a single-input system into the controller form\index{controller form} with a numerical example.
\begin{example} \rm
Consider the following dynamical system model:
\[
\dot{\b x} = \left[\begin{array}{cccc}
0 & 0 & 1 & 0\\
0 & 0 & 0 & 1\\
-2 & 1 & 0 & 0\\
1 & -1 & 0 & 0
\end{array}\right]\b x+\left[\begin{array}{c}
0\\
0\\
1\\
0
\end{array}\right]u.
\]
The controllability matrix\index{controllability matrix} of the pair $(\b A,\b b)$ is
\[
\left[\begin{array}{cccc}
\b b & \b A\b b & \b A^2\b b & \b A^3 \b b
\end{array}\right]=\left[\begin{array}{cccc}
0 & 1 & 0 & -2\\
0 & 0 & 0 & 1\\
1 & 0 & -2 & 0\\
0 & 0 & 1 & 0
\end{array}\right].
\]
The pair $(\b A,\b b)$ is controllable because the controllability matrix is nonsingular. We find the last row of the inverse of the controllability matrix to be $\b q_1=\left[\begin{array}{cccc}
0 & 1 & 0 & 0
\end{array}\right]$. Hence the transformation matrix\index{transformation matrix!into controller form} is
\[
\b T = \left[\begin{array}{c}
\b q_1\\
\b q_1\b A\\
\b q_1 \b A^2\\
\b q_1 \b A^3
\end{array}\right]= \left[\begin{array}{cccc}
0 & 1 & 0 & 0\\
0 & 0 & 0 & 1\\
1 & -1 & 0 & 0\\
0 & 0 & 1 & -1
\end{array}\right].
\]
The matrices $\b A$ and $\b b$ in the new coordinates have the form,
\[
\b T\b A\b T^{-1} =\left[\begin{array}{cccc}
0 & 1 & 0 & 0\\
0 & 0 & 0 & 1\\
1 & -1 & 0 & 0\\
0 & 0 & 1 & -1
\end{array}\right]\left[\begin{array}{cccc}
0 & 0 & 1 & 0\\
0 & 0 & 0 & 1\\
-2 & 1 & 0 & 0\\
1 & -1 & 0 & 0
\end{array}\right]\left[\begin{array}{cccc}
1 & 0 & 1 & 0\\
1 & 0 & 0 & 0\\
0 & 1 & 0 & 1\\
0 & 1 & 1 & 0
\end{array}\right]
= \left[\begin{array}{cccc}
0 & 1 & 0 & 0\\
0 & 0 & 1 & 0\\
0 & 0 & 0 & 1\\
-1 & 0 & -3 & 0
\end{array}\right],
\]
and
\[
\b T\b b = \left[\begin{array}{c}
0 \\
0 \\
0\\
1
\end{array}\right].
\]
\end{example}\markex

We generalize the above method of transforming the given pair $(\b A,\b B)$ into the controller form for multi-input\index{multi-input!controller form} systems. We consider a controllable pair $(\b A,\b B)$ where $\b A \in \mb{\Bb R}^{n \times n}$, $\b B \in \mb{\Bb R}^{n \times m}$, $m \le n$, and $\mb{rank}\,\b B=m$. The last assumption we made is just for convenience to simplify further manipulations. This assumption implies that all inputs are mutually independent, which is usually the case in practical applications. We first form the controllability matrix of the pair $(\b A,\b B)$ and represent it as
\begin{equation}
\left[\begin{array}{cccccccccccc}
\b b_1 & \b b_2 &\cdots &\b b_m &\b A\b b_1 & \b A\b b_2 &\cdots &\b A\b b_m & \cdots & \b A^{n-1}\b b_1 &\cdots & \b A^{n-1}\b b_m
\end{array}\right],
\label{eq:exfoocomat}
\end{equation}
where $\b b_i$, $i=1,2,\ldots,m$, is the $i$-th column of $\b B$. The above controllability matrix is of full rank because we assumed that the pair $(\b A,\b B)$ is controllable. Thus, we can select $n$ linearly independent columns from~(\ref{eq:exfoocomat}). We select these columns proceeding from left to right. Then, we rearrange the selected columns to form a $n\times n$ nonsingular matrix $\b L$ of the form
\[
\b L=\left[\begin{array}{ccccccccccc}
\b b_1 & \b A\b b_1 &\cdots &\b A^{d_1-1}\b b_1 & \b b_2 & \cdots &\b A^{d_2-1}\b b_2 & \cdots &\b b_m &\cdots & \b A^{d_m-1}\b b_m
\end{array}\right].
\]
We call the $m$ integers $d_i$ the {\em controllability indices\/} of the pair $(\b A,\b B)$. Note that
\[
\sum_{i=1}^md_i=n.
\]
We call the integer
\[
d=\max \{d_i:i=1,2,\ldots,m\},
\]
the {\em controllability index\/}\index{controllability index} of the pair $(\b A,\b B)$. Observe that all $m$ columns of $\b B$ are present in $\b L$ because we assumed that $\b B$ is of full rank and the way we selected mutually independent columns from the controllability matrix~(\ref{eq:exfoocomat}) to construct the matrix $\b L$. Furthermore, if the column $\b A^k\b b_j$ is present in $\b L$, then so is $\b A^{k-1}\b b_j$.

To proceed further, we let
\[
\sigma_k=\sum_{i=1}^kd_i,\quad\mb{for}\quad k=1,2,\ldots,m.
\]
Note that $\sigma_1=d_1$, $\sigma_2=d_1+d_2$, $\ldots,$ $\sigma_m=\sum_{i=1}^md_i=n$. We select $m$ rows from $\b L^{-1}$. We denote the selected rows by $\b q_k$, where $\b q_k$ is the $\sigma_k$-th row of $\b L^{-1}$. Next, we form the $n\times n$ matrix
\[
\b T=\left[\begin{array}{c}
\b q_1\\
\b q_1\b A\\
\vdots\\
\b q_1\b A^{d_1-1}\\
\b q_2\\
\vdots\\
\b q_2\b A^{d_2-1}\\
\vdots\\
\b q_m\\
\vdots\\
\b q_m\b A^{d_m-1}
\end{array}\right].
\]
We can show that $\b T$ is nonsingular by computing the product $\b T\b L$ and noticing that $\det(\b T\b L)=\pm 1$. We define a state-variable transformation\index{transformation!into controller form} $\tilde{\b x}=\b T\b x$, and then using similar arguments as in the single-input case, we arrive at the special structure of the pair
\[
\left( \tilde{\b A},\tilde{\b B}\right)=\left( \b T\b A\b T^{-1},\b T\b B\right),
\]
where
\[
\tilde{\b A}=\left[\begin{array}{ccccc|cccc|c|cccc}
0 & 1 & 0 & \cdots & 0 & 0 & 0 & \cdots & 0 & \cdots & 0 & 0 & \cdots & 0\\
0 & 0 & 1 & \cdots& 0 & 0 & 0 & \cdots & 0 & {}& 0 & 0 & \cdots & 0\\
{} & {} & {} & \ddots& {} & \vdots & {} & {} & \vdots & {} & \vdots & {} &{} & \vdots\\
0 & 0 & 0 & \cdots & 1 & 0 & 0 & \cdots & 0 & {} & 0 & 0 & \cdots & 0\\
x & x & x & \cdots & x & x & x & \cdots & x & \cdots & x & x & \cdots & x\\ \hline
0 & 0 & 0 & \cdots & 0 & 0 & 1 & \cdots & 0 & \cdots & 0 & 0 & \cdots & 0\\
\vdots & {} & {} & {} & \vdots & \vdots & {} & \ddots & \vdots & {} & \vdots & {} & {} & \vdots\\
0 & 0 & 0 & \cdots & 0 & 0 & 0 & \cdots & 1 & {} & 0 & 0 & \cdots & 0\\
x & x & x & \cdots & x & x & x & \cdots & x & \cdots & x & x & \cdots & x\\ \hline
\vdots & {} & {} & {}& {}& {} &\vdots &{} & {} & \ddots& {}& {}& \vdots {} & {}\\ \hline
0 & 0 & 0 & \cdots & 0 & 0 & 0 & \cdots & 0 & \cdots & 0 & 1 & \cdots & 0\\
\vdots & {} & {} & {} & \vdots & \vdots & {} & {} & \vdots & {} & \vdots & {} & \ddots & \vdots\\
0 & 0 & 0 & \cdots & 0 & 0 & 0 & \cdots & 0 & {} & 0 & 0 & \cdots & 1\\
x & x & x & \cdots & x & x & x & \cdots & x & \cdots & x & x & \cdots & x
\end{array}
\right].
\]
Note that the $m$ diagonal blocks of $\tilde{\b A}$ have the structure of the controller form as in the single-input case. The dimensions of the diagonal blocks are $d_i \times d_i$, $i=1,2,\dots,m$. The off-diagonal blocks consist of zero elements except for their respective last rows. Thus, all information about $\tilde{\b A}$, as well as $\b A$, can be derived from knowledge of the controllability indices\index{controllability indices}, and the $m$ nonzero rows containing the elements marked using $x$, of the matrix $\tilde{\b A}$.

The matrix $\tilde{\b B}$ has the form,
\[
\tilde{\b B}=\left[\begin{array}{ccccc}
0 & 0 & \cdots& 0 & 0\\
0 & 0 & \cdots& 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
1 & x & x& x& x\\ \hline
0 & 0 & \cdots& 0 & 0\\
0 & 0 & \cdots& 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
0 & 1 & x& x& x\\ \hline
\vdots & {} & {} & {}& \vdots \\ \hline
0 & 0 & \cdots& 0 & 0\\
0 & 0 & \cdots& 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
0& 0 & 0& 0& 1
\end{array}\right].
\]
The nonzero rows of $\tilde{\b B}$ correspond to the rows of $\tilde{\b A}$ containing the elements marked using $x$.

We illustrate the above algorithm for reducing a multi-input system model into the controller form with a numerical example.
\begin{example} \rm
Consider the pair $(\b A,\b B)$, where
\[
\b A=\left[\begin{array}{cccc}
-1 & 1 & 0 & 1\\
1 & 1 & 0 & 0\\
0 & 0 & 4 & 0\\
1 & 1 & -1 & 2
\end{array}\right], \quad \b B=\left[\begin{array}{cc}
1 & 1\\
2 & 0\\
1 & 0\\
0 & 1
\end{array}\right].
\]
We transform the above pair into its controller companion form. Following the algorithm, we find,
\[
\mb{rank}\left[\begin{array}{cccc}
\b b_1 & \b b_2 & \b A\b b_1 & \b A\b b_2
\end{array}\right]=4.
\]
Hence $d_1=d_2=2$. We next form the matrix $\b L$,
\[
\b L = \left[\begin{array}{cccc}
\b b_1 & \b A\b b_1 & \b b_2 & \b A\b b_2
\end{array}\right]=\left[\begin{array}{cccc}
1 & 1 & 1 & 0\\
2 & 3 & 0 & 1\\
1 & 4 & 0 & 0\\
0 & 2 & 1 & 3
\end{array}\right],
\]
and
\[
\b L^{-1}=\left[\begin{array}{cccc}
0.20 & 0.60 & -0.40 & -0.20\\
-0.05 & -0.15 & 0.35 & 0.05\\
0.85 & -0.45 & 0.05 & 0.15\\
-0.25 & 0.25 & -0.25 & 0.25
\end{array}\right].
\]
Hence
\[
\b q_1=\left[\begin{array}{cccc}
-0.05 & -0.15 & 0.35 & 0.05
\end{array}\right],
\]
and
\[
\b q_2=\left[\begin{array}{cccc}
-0.25 & 0.25 & -0.25 & 0.25
\end{array}\right].
\]
The transformation matrix is
\[
\b T = \left[\begin{array}{c}
\b q_1\\
\b q_1\b A\\
\b q_2\\
\b q_2\b A
\end{array}\right]=\left[\begin{array}{cccc}
-0.05 & -0.15 & 0.35 & 0.05\\
-0.05 & -0.15 & 1.35 & 0.05\\
-0.25 & 0.25 & -0.25 & 0.25\\
0.75 & 0.25 & -1.25 & 0.25
\end{array}\right].
\]
The matrices $\b A$ and $\b B$ in the new coordinates have the form,
\[
\b T\b A\b T^{-1}=\left[\begin{array}{cc|cc}
0 & 1 & 0 & 0\\
-4 & 5 & 0 & 0\\
\hline
0 & 0 & 0 & 1\\
3 & -3 & 4 & 1
\end{array}\right]\quad\mb{and}\quad
\b T\b B=\left[\begin{array}{cc}
0 & 0\\
1 & 0\\
\hline
0 & 0\\
0 & 1
\end{array}\right].
\]
\end{example}\markex

\subsection{Observer Form}
In this subsection, we use duality\index{duality} and the algorithms for reducing reachable systems into controller forms to derive analogous results for observable systems. For the sake of simplicity and without loss of generality, we consider an observable dynamical system model
\begin{equation}
\left.\begin{array}{lll}
\dot{\b x}(t) &=& \b A \b x(t)\\
\b y(t) &=& \b C \b x(t),
\end{array}\right\}
\label{eq:sysforobsfo}
\end{equation}
or, equivalently, the observable pair\index{observable pair} $(\b A, \b C)$, where $\b A \in \mb{\Bb R}^{n \times n}$, $\b C \in \mb{\Bb R}^{p \times n}$, $p \le n$, and $\mb{rank}\, \b C=p$. We omitted the input variable $\b u$ for convenience because it plays no role in the subsequent discussion. We next consider the {\em dual system\/}\index{dual system} model associated with the system~(\ref{eq:sysforobsfo}),
\[
\dot{\b z}(t)=\b A^{\top} \b z(t)+\b C^{\top} \b v(t).
\]
Because the pair $(\b A,\b C)$ is observable, the dual pair $\left(\b A^{\top},\b C^{\top}\right)$ is reachable. Therefore, the pair $\left(\b A^{\top},\b C^{\top}\right)$ can be transformed into the controller form using the algorithm from the previous subsection. We then take the dual of the result to get
\[
\left.\begin{array}{lll}
\dot{\hat{\b x}}(t) &=& \hat{\b A}\hat{\b x}\\
\b y(t) &=& \hat{\b C}\hat{\b x},
\end{array}\right\}
\]
where
\[
\hat{\b A}=\left[\begin{array}{cccc}
\hat{\b A}_{11} & \hat{\b A}_{12}& \cdots& \hat{\b A}_{1p}\\
\hat{\b A}_{21} & \hat{\b A}_{22}& \cdots& \hat{\b A}_{2p}\\
\vdots & {} & {}& \vdots\\
\hat{\b A}_{p1} & \hat{\b A}_{p2}& \cdots& \hat{\b A}_{pp}
\end{array}\right].
\]
Each diagonal submatrix $\hat{\b A}_{ii} \in \mb{\Bb R}^{\hat{d}_i\times \hat{d}_i}$ of $\hat{\b A}$ has the form
\[
\hat{\b A}_{ii}=\left[\begin{array}{ccccc}
0 & 0 & \cdots & 0 & x\\
1 & 0 & \cdots & 0 & x\\
\vdots& {}& \ddots&{}& \vdots\\
0 & 0 & \cdots & 1 & x
\end{array}\right],
\]
which is just the transpose of the controller form for the single-input case. The integers $\hat{d}_i$, $i=1,2,\ldots,p$ are the controllability indices of the controllable pair $\left(\b A^{\top},\b C^{\top}\right)$. The off-diagonal blocks, $j\ne i$, have the form
\[
\hat{\b A}_{ji}=\left[\begin{array}{ccccc}
0 & 0 & \cdots & 0 & x\\
0 & 0 & \cdots & 0 & x\\
\vdots& {}& {}& {}& \vdots\\
0 & 0 & \cdots & 0 & x
\end{array}\right],
\]
that is, they consist of zeros except for their last columns. The matrix $\hat{\b C}$ consists of $p$ blocks and has the form
\[
\hat{\b C}=\left[\begin{array}{cccc|cccc|c|cccc}
0 & 0 & \cdots& 1&0&0 & \cdots & 0 &\cdots& 0 & 0 & \cdots & 0\\
0 & 0 & \cdots& x&0&0 & \cdots & 1 &\cdots& 0 & 0 & \cdots & 0\\
\vdots&{}&{}&\vdots&\vdots&{}&{}&\vdots&{}&\vdots&{}&{}&\vdots\\
0 & 0 & \cdots& x&0&0 & \cdots & x &\cdots& 0 & 0 & \cdots & 1
\end{array}\right].
\]
The $p$ controllability indices of the pair $\left(\b A^{\top},\b C^{\top}\right)$ are called the {\em observability indices\/}\index{observability indices} of the pair $(\b A,\b C)$. Note that
\[
\sum_{i=1}^p\hat{d}_i=n.
\]
Similarly as in the controller form, we define the {\em observability index\/}\index{observability index} of the pair $(\b A,\b C)$ to be the integer
\[
\hat{d}=\max\{\hat{d}_i:i=1,2,\ldots,p\}.
\]
We illustrate the above algorithm for transforming an observable pair into the observer form\index{observer form} with a numerical example.
\begin{example}\rm
\label{ex:ocf}
Consider the observable pair $(\b A,\b C)$,
\[
\b A=\left[\begin{array}{cccc}
0 & 0 & 1 & 0\\
1 & 0 & 2 & 0\\
0 & 1 & 3 & 0\\
0 & 0 & -21 & 5
\end{array}\right],\quad \b C=\left[\begin{array}{cccc}
1 & 0 & 0 & 0\\
0 & 0 & 0 & 1
\end{array}\right].
\]
We transform the pair $\left(\b A^{\top},\b C^{\top}\right)$ into the controller form. Thus, we first form the controllability matrix for $\left(\b A^{\top},\b C^{\top}\right)$, then proceeding from left to right, we select the first $n=4$ linearly independent columns. They are
\[
\b c_1^{\top},\b c_2^{\top},\b A^{\top}\b c_1^{\top},\left( \b A^{\top}\right)^2\b c_1^{\top}.
\]
Therefore, the observability indices\index{observability indices} are: $\hat{d}_1=3$ and $\hat{d}_2=1$. Hence,
\[
\b L = \left[\begin{array}{cccc}
\b c_1^{\top} & \b A^{\top}\b c_1^{\top} &\left( \b A^{\top}\right)^2\b c_1^{\top} & \b c_2^{\top}
\end{array}\right]=\left[\begin{array}{cccc}
1 & 0 & 0 & 0\\
0 & 0 & 1 & 0\\
0 & 1 & 3 & 0\\
0 & 0 & 0 & 1
\end{array}\right],
\]
and
\[
\b L^{-1}=\left[\begin{array}{cccc}
1 & 0 & 0 & 0\\
0 & -3 & 1 & 0\\
0 & 1 & 0 & 0\\
0 & 0 & 0 & 1
\end{array}\right].
\]
The two vectors that we need to form the desired transformation are
\[
\b q_1 = \left[\begin{array}{cccc}
0 & 1 & 0 & 0
\end{array}\right]\quad\mb{and}\quad \b q_2 = \left[\begin{array}{cccc}
0 & 0 & 0 & 1
\end{array}\right].
\]
The transformation matrix is
\[
\hat{\b T}=\left[\begin{array}{cccc}
0 & 1 & 0 & 0\\
0 & 0 & 1 & 0\\
1 & 2 & 3 & -21\\
0 & 0 & 0 & 1
\end{array}\right].
\]
The observer form of the pair $(\b A,\b C)$ is given by the matrices
\[
\hat{\b A} = \hat{\b T}^{-T}\b A\hat{\b T}^{\top}=\left[\begin{array}{ccc|c}
0 & 0 & 1& 0\\
1 & 0 & 2 & 0\\
0 & 1 & 3& 0\\ \hline
0 & 0 & -105& 5
\end{array}\right]\quad\mb{and}\quad
\hat{\b C}=\b C\hat{\b T}^{\top}=\left[\begin{array}{ccc|c}
0 & 0 & 1 & 0\\
0 & 0 & -21 & 1
\end{array}\right].
\]
\end{example}\markex

\section{Linear State-Feedback Control}
\label{sec:linstfec}
In the following sections, we discuss methods for a feedback controller design\index{feedback controller!design} for linear systems. The design process involves three steps. The first step is the design of a state-feedback\index{state-feedback} control law. In this step, we assume that we have all states available to us for feedback purposes. In general, this may not be the case. The assumption that all the states are available allows us to proceed with the state-feedback control law design. We then proceed with the second step that involves the design of an observer\index{observer!estimate state vector} to estimate the state vector. The observer should use only the input and output of the plant to be controlled to generate an estimate of the plant state. The last step is to combine the first two steps in that the control law, designed in the first step, uses the state estimate\index{state estimate} instead of the true state\index{true state} vector. The result of this step is a combined controller-observer\index{combined controller-observer!compensator} compensator. We first discuss the problem of designing a linear state-feedback control law. In the following sections, we present methods for constructing observers and combined controller-observer compensators.

The linear state-feedback\index{state-feedback}\index{state-feedback!linear} control law, for a system modeled by $\dot{\b x}=\b A\b x+\b B\b u$, is the feedback\index{feedback!combination of state variables} of a linear combination of all the state variables, and has the form
\[
\b u=-\b K\b x+\b v,
\]
where $\b K \in \mb{\Bb R}^{m \times n}$ is a constant matrix. Figure~\ref{fig:lin_st_feed} illustrates the linear state-feedback applied to the linear system $\dot{\b x}=\b A\b x+\b B\b u$.
\begin{figure}
\centering
\includegraphics[scale=0.5]{lin_st_feed.eps}
%\vskip3in
%\centerbmp{3.33in}{2.5in}{c:/mybook/cl_esti.bmp}
%\hskip1in\special{bmp:c:/mybook/cl_esti.bmp x=4in y=3in}
\caption{Linear state-feedback.}
\label{fig:lin_st_feed}
\end{figure}

The closed-loop system\index{closed-loop system} is described as
\[
\dot{\b x}=\left( \b A-\b B\b K \right)\b x + \b B\b v.
\]
The poles of the closed-loop system are the roots of the characteristic equation\index{characteristic equation!roots of}\index{roots of!characteristic equation}
\[
\det\left(s\b I_n-\b A+\b B\b K\right)=0.
\]
The linear state-feedback control law design consists of selecting the gains
\[
k_{ij},\quad i=1,2,\ldots,m,\quad j=1,2,\ldots,n,
\]
so that the roots of the closed-loop characteristic equation\index{closed-loop!characteristic equation}
\[
\det\left(s\b I_n-\b A+\b B\b K\right)=0
\]
are in desirable locations in the complex plane. We assume that a designer has made the selection of the desired\index{desired!closed-loop poles} poles of the closed-loop system and they are:
\[
s_1,s_2,\ldots,s_n.
\]
The desired closed-loop poles\index{closed-loop poles!desired} can be real or complex. If they are complex, then they must come in complex conjugate pairs\index{poles!complex conjugate pairs}\index{complex conjugate pairs!poles}. This is because we use only real gains $k_{ij}$. Having selected the desired closed-loop poles we can form the desired closed-loop characteristic polynomial\index{closed-loop!characteristic polynomial},
\begin{eqnarray*}
\alpha_c(s) &=& (s-s_1)(s-s_2)\cdots(s-s_n)\\
&=& s^n + \alpha_{n-1}s^{n-1}+\cdots+\alpha_1s+\alpha_0.
\end{eqnarray*}
Our goal is to select a feedback matrix $\b K$ such that
\[
\det\left(s\b I_n-\b A+\b B\b K\right)=s^n + \alpha_{n-1}s^{n-1}+\cdots+\alpha_1s+\alpha_0.
\]
The above problem is also referred to as the {\em pole placement\/}\index{pole placement} problem. We first discuss the pole placement problem for the single-input\index{pole placement!single-input} plants. In this case $\b K=\b k\in \mb{\Bb R}^{1\times n}$. The solution to the problem is easily obtained if the pair $(\b A,\b b)$ is already in the controller companion form. In such a case we have
\[
\b A-\b b\b k =\left[\begin{array}{cccccc}
0 & 1 & 0 & \cdots & 0 & 0\\
0 & 0 & 1 & \cdots & 0 & 0\\
\vdots & {}& {}& {}& {}& \vdots\\
0 & 0 & 0 & \cdots & 0 & 1\\
-a_0-k_1 & -a_1-k_2 & -a_2-k_3 & \cdots & -a_{n-2}-k_{n-1}& -a_{n-1}-k_n
\end{array}\right].
\]
Hence, the desired gains are
\begin{eqnarray*}
k_1 &=& \alpha_0-a_0,\\
k_2 &=& \alpha_1-a_1,\\
{}&\vdots&{}\\
k_n &=& \alpha_{n-1}-a_{n-1}.
\end{eqnarray*}

If the pair $(\b A,\b b)$ is not in the controller companion form, we first transform it into the companion form, and then compute the gain vector $\tilde{\b k}$ such that
\[
\det\left(s\b I_n-\tilde{\b A}+\tilde{\b b}\tilde{\b k}\right)=s^n + \alpha_{n-1}s^{n-1}+\cdots+\alpha_1s+\alpha_0.
\]
Thus,
\[
\tilde{\b k}=\left[\begin{array}{cccc}
\alpha_0-a_0 & \alpha_1-a_1 & \cdots & \alpha_{n-1}-a_{n-1}
\end{array}\right].
\]
Then,
\[
\b k=\tilde{\b k}\b T,
\]
where $\b T$ is the transformation\index{transform!into controller form} that brings the pair $(\b A,\b b)$ into the controller companion form.

We can represent the above formula for the gain matrix in an alternative way. For this note that
\begin{eqnarray*}
\tilde{\b k}\b T &=& \left[\begin{array}{cccc}
\alpha_0-a_0 & \alpha_1-a_1 & \cdots & \alpha_{n-1}-a_{n-1}
\end{array}\right]\left[\begin{array}{c}
\b q_1\\
\b q_1\b A\\
\vdots\\
\b q_1\b A^{n-1}
\end{array}\right]\\
&=& \b q_1\left( \alpha_0 \b I_n+\alpha_1\b A+\cdots +\alpha_{n-1}\b A^{n-1}\right)-\b q_1\left( a_0 \b I_n+a_1\b A+\cdots +a_{n-1}\b A^{n-1}\right).
\end{eqnarray*}
By the Cayley-Hamilton theorem\index{Cayley-Hamilton theorem},
\[
\b A^n=-\left( a_0\b I_n+a_1\b A+\cdots+a_{n-1}\b A^{n-1} \right).
\]
Hence,
\[
\b k=\b q_1 \alpha_c\left( \b A \right).
\]
The above expression for the gain row vector was proposed by Ackermann in 1972, and is now referred to as the {\em Ackermann's formula}\index{Ackermann's formula!for pole placement} for pole placement.

\begin{example}\rm
For the linear dynamical system
\[
\dot{\b x}=\left[\begin{array}{cc}
1 & -1\\
1 & -2
\end{array}\right]\b x + \left[\begin{array}{c}
2\\
1
\end{array}\right]u,
\]
we will use the Ackermann's formula to design a state-feedback controller, $u=-\b k\b x$, such that the closed-loop poles are located at $\{-1, -2\}$.


To use the Ackermann's formula, we first form the controllability matrix of the pair $(\b A,\b b)$ and then find the last row of its inverse denoted $\b q_1$. The controllability matrix is
\[
\b{\cal U}=\left[\begin{array}{cc}
\b b & \b A\b b
\end{array}\right]=\left[\begin{array}{cc}
2 & 1\\
1 & 0
\end{array}\right].
\]
Its inverse is
\[
{\b{\cal U}}^{-1}=\left[\begin{array}{cc}
0 & 1\\
1 & -2
\end{array}\right].
\]
Hence, $\b q_1=\left[\begin{array}{cc}
1 & -2
\end{array}\right]$. The desired closed-loop characteristic polynomial is
\[
\alpha_c(s)=(s+1)(s+2)=s^2+3s+2.
\]
Therefore,
\begin{eqnarray*}
\b k&=&\b q_1\alpha_c(\b A)\\
&=&\b q_1\left(\b A^2+3\b A+2\b I_2 \right)\\
&=& \b q_1\left(\left[\begin{array}{cc}
1 & -1\\
1 & -2
\end{array}\right]\left[\begin{array}{cc}
1 & -1\\
1 & -2
\end{array}\right]+3\left[\begin{array}{cc}
1 & -1\\
1 & -2
\end{array}\right]+2\left[\begin{array}{cc}
1 & 0\\
0 & 1
\end{array}\right] \right)\\
&=& \b q_1\left(\left[\begin{array}{cc}
0 & 1\\
-1 & 3
\end{array}\right]+\left[\begin{array}{cc}
3 & -3\\
3 & -6
\end{array}\right]+\left[\begin{array}{cc}
2 & 0\\
0 & 2
\end{array}\right] \right)\\
&=& \left[\begin{array}{cc}
1 & -2
\end{array}\right]\left[\begin{array}{cc}
5 & -2\\
2 & -1
\end{array}\right]\\
&=& \left[\begin{array}{cc}
1 & 0
\end{array}\right]
\end{eqnarray*}
\end{example}\markex

We now present a pole placement algorithm for multi-input\index{multi-input!pole placement} systems. If the pair $(\b A,\b B)$ is already in the controller companion form, then we may proceed as follows. First, represent the matrix $\b B$ as
\[
\b B=\left[\begin{array}{ccccc}
0 & 0 & \cdots& 0 & 0\\
0 & 0 & \cdots& 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
1 & x & x& x& x\\ \hline
0 & 0 & \cdots& 0 & 0\\
0 & 0 & \cdots& 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
0 & 1 & x& x& x\\ \hline
\vdots & {} & {} & {}& \vdots \\ \hline
0 & 0 & \cdots& 0 & 0\\
0 & 0 & \cdots& 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
0& 0 & 0& 0& 1
\end{array}\right]=\left[\begin{array}{ccccc}
0 & 0 & \cdots& 0 & 0\\
0 & 0 & \cdots& 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
1 & 0 & 0& 0& 0\\ \hline
0 & 0 & \cdots& 0 & 0\\
0 & 0 & \cdots& 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
0 & 1 & 0& 0& 0\\ \hline
\vdots & {} & {} & {}& \vdots \\ \hline
0 & 0 & \cdots& 0 & 0\\
0 & 0 & \cdots& 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
0& 0 & 0& 0& 1
\end{array}\right]\left[\begin{array}{ccccc}
1 & x & \cdots & x & x\\
0 & 1 & \cdots & x & x\\
\vdots & {} & \ddots & {} & \vdots\\
0 & 0 & \cdots & 1 & x\\
0 & 0 & \cdots & 0 & 1
\end{array}\right]
= \hat{\b B}\b \Gamma,
\]
where the square and nonsingular matrix $\b \Gamma$ consists of the nonzero rows of $\b B$. Next, let
\[
\hat{\b K}=\b \Gamma \b K.
\]
Notice that
\[
\hat{\b B}\hat{\b K}=\left[\begin{array}{ccccc}
0 & 0 & \cdots & 0 & 0\\
0 & 0 & \cdots & 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
\hat{k}_{11} & \hat{k}_{12} & \cdots & \hat{k}_{1\,n-1}& \hat{k}_{1n}\\ \hline
0 & 0 & \cdots & 0 & 0\\
0 & 0 & \cdots & 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
\hat{k}_{21} & \hat{k}_{22} & \cdots & \hat{k}_{2\,n-1}& \hat{k}_{2n}\\ \hline
\vdots & {} & {}& {}& \vdots\\ \hline
0 & 0 & \cdots & 0 & 0\\
0 & 0 & \cdots & 0 & 0\\
\vdots & {}& {}& {}& \vdots\\
\hat{k}_{m1} & \hat{k}_{m2} & \cdots & \hat{k}_{m\,n-1}& \hat{k}_{mn}
\end{array}\right],
\]
that is, the nonzero rows in the product $\hat{\b B}\hat{\b K}$ match the nonzero rows of the matrix $\b A$ in the controller companion form. We can then, for example, select the gains $k_{ij}$, $i=1,2,\ldots,m$, $j=1,2,\ldots,n$, so that
\[
\b A-\b B\b K = \b A-\hat{\b B}\hat{\b K}=\left[\begin{array}{cccccc}
0 & 1 & 0 & \cdots & 0 & 0\\
0 & 0 & 1 & \cdots & 0 & 0\\
\vdots & {}& {}& {}& {}& \vdots\\
0 & 0 & 0 & \cdots & 0 & 1\\
-\alpha_0 & -\alpha_1 & -\alpha_2 & \cdots & -\alpha_{n-2}& -\alpha_{n-1}
\end{array}\right],
\]
where
\[
\b K=\b \Gamma^{-1}\hat{\b K}.
\]
If the pair $(\b A, \b B)$ is not in the controller companion form, we first transform it into this form, then compute the gain matrix that allocates the closed-loop poles into the desired locations. The gain matrix $\b K$ that allocates the closed-loop poles into the prespecified locations for the pair $(\b A, \b B)$ in the original coordinates is then given by
\[
\b K=\b \Gamma^{-1}\hat{\b K}\b T,
\]
where $\b T$ is the transformation matrix that brings the pair $(\b A, \b B)$ into the controller companion form.
\begin{example}\rm
\label{ex:twoinpopl}
For the pair
\[
\b A=\left[\begin{array}{cccc}
0 & 0 & 1 & 0\\
1 & 0 & 2 & 0\\
0 & 1 & 3 & 0\\
0 & 0 & -21 & 5
\end{array}\right],\quad \b B=\left[\begin{array}{cc}
1 & 0\\
0 & 0\\
0 & 0\\
0 & 1
\end{array}\right],
\]
we use its controller companion form to find the matrix $\b K\in \mb{\Bb R}^{2\times4}$ so that closed-loop poles are located at
\[
-2,-3+j,-3-j,-4.
\]

We first transform the pair $(\b A,\b B)$ into its controller companion form\index{controller form}. We begin by forming the controllability matrix
\[
\left[\begin{array}{cccccc}
\b b_1 & \b b_2 & \b A\b b_1 & \b A\b b_2 & \b A^2\b b_1&\cdots
\end{array}\right]=\left[\begin{array}{cccccc}
1& 0 & 0 & 0 & 0 &\cdots\\
0 & 0 & 1 & 0 & 0 & \cdots\\
0 & 0 & 0 & 0 & 1 & \cdots\\
0 & 1 & 0 & 5 & 0 & \cdots
\end{array}\right].
\]
We then select, proceeding from left to right\index{select!from left to right}, the first four linearly independent columns from the above controllability matrix. We obtain
\[
\left[\begin{array}{cccc}
\b b_1 & \b b_2 & \b A\b b_1 & \b A^2\b b_1
\end{array}\right].
\]
Thus, the controllability indices\index{controllability indices} are $d_1=3$ and $d_2=1$. We rearrange the above columns and form the matrix $\b L$ of the form
\[
\b L = \left[\begin{array}{cccc}
\b b_1 & \b A\b b_1 & \b A^2\b b_1 & \b b_2
\end{array}\right]= \b I_4= \b L^{-1}.
\]
The two row vectors that we need in constructing the transformation\index{transformation!constructing} are
\[
\b q_1 = \left[\begin{array}{cccc}
0 & 0 & 1 & 0
\end{array}\right]\quad\mb{and}\quad \b q_2 = \left[\begin{array}{cccc}
0 & 0 & 0 & 1
\end{array}\right].
\]
The transformation matrix is
\begin{eqnarray*}
\b T&=& \left[\begin{array}{c}
\b q_1\\
\b q_1\b A\\
\b q_1\b A^2\\
\b q_2
\end{array}\right]=\left[\begin{array}{cccc}
0 & 0 & 1 & 0\\
0 & 1 & 3 & 0\\
1 & 3 & 11 & 0\\
0 & 0 & 0 & 1
\end{array}\right].
\end{eqnarray*}
The pair $(\b A,\b B)$ in the new coordinates has the form
\[
\tilde{\b A}=\b T\b A\b T^{-1}=\left[\begin{array}{ccc|c}
0 & 1 & 0 & 0\\
0 & 0 & 1 & 0\\
1 & 2 & 3 & 0\\ \hline
-21 & 0 & 0 & 5
\end{array}\right]\quad\mb{and}\quad
\tilde{\b B}=\b T\b B=\left[\begin{array}{cc}
0 & 0\\
0 & 0\\
1 & 0\\ \hline
0 & 1
\end{array}\right].
\]
The desired closed-loop characteristic polynomial\index{desired closed-loop!characteristic polynomial} is
\[
\alpha_c(s) = (s+2)(s+3-j)(s+3+j)(s+4)= s^4+12s^3+54s^2+108s+80.
\]
A possible choice of the gain matrix\index{gain matrix} $\tilde{\b K}$, from among many, that does the job is $\tilde{\b K}$ such that
\[
\tilde{\b A}-\tilde{\b B}\tilde{\b K}=\left[\begin{array}{cccc}
0 & 1 & 0 & 0\\
0 & 0 & 1 & 0\\
0 & 0 & 0 & 1\\
-80 & -108 & -54 & -12
\end{array}\right].
\]
Note that $\b \Gamma = \b I_2$. Therefore,
\[
\tilde{\b K}=\left[\begin{array}{cccc}
1 & 2 & 3 & -1\\
59 & 108& 54 & 17
\end{array}\right],
\]
and thus
\[
\b K = \tilde{\b K}\b T= \left[\begin{array}{cccc}
3 & 11 & 40 & -1\\
54 & 270 & 977 & 17
\end{array}\right].
\]
\end{example}\markex

The above algorithm for pole placement for multi-input systems is more of a theoretical value rather than practical. This algorithm is not well suited for numerical implementations because the transformation of a given pair $(\b A, \b B)$ into the controller companion form\index{controller form!poor numerical properties} suffers from poor numerical properties. For a discussion of pole placement numerically stable\index{pole placement!numerically stable} algorithms for multi-input systems, we refer the reader to Jamshidi, Tarokh, and Shafai~\cite{jamshidi92}.


Unlike in the single-input case, a solution to the pole placement problem for a multi-input system is not unique\index{multi-input pole placement solution!not unique}. Therefore, one can use the remaining degrees of freedom to achieve secondary goals\index{multi-input pole placement!can achieve secondary goals}. We discuss a method for constructing a linear state-feedback control law that allocates the closed-loop poles into prespecified locations, and at the same time minimizes a quadratic performance index, in Subsection~\ref{subsec:optprep}.

Using the results preceding the above discussion, we state and prove a fundamental theorem of linear systems.
\begin{thm}
\label{thm:pp}
The pole placement problem is solvable\index{pole placement problem!solvable if and only if} for all choices of $n$ desired closed-loop poles, symmetric with respect to the real axis, if and only if the given pair $(\b A, \b B)$ is reachable.
\end{thm}
{\bf Proof} \quad The proof of necessity ($\Leftarrow$) follows immediately from the discussion preceding Example~\ref{ex:twoinpopl}. Indeed, the pair $(\b A, \b B)$ is reachable, if and only if it can be transformed into the controller canonical form. Once the transformation is performed, we can easily solve the pole placement problem for the given set of desired closed-loop poles, symmetric with respect to the real axis. We then transform the pair $(\b A, \b B)$ and the gain matrix back into the original coordinates. Because the similarity transformation does not affect neither controllability nor the characteristic polynomial\index{similarity transformation!does not affect characteristic polynomial}\index{similarity transformation!does not affect controllability}, the eigenvalues of $\b A-\b B\b K$ are precisely the desired prespecified closed-loop poles. This completes the proof of the necessity part.

We use a proof by contraposition\index{proof!by contraposition} to prove the sufficiency part ($\Rightarrow$). Assume that the pair $(\b A, \b B)$ is nonreachable. By Theorem~\ref{thm_decomp}, there is a similarity transformation $\b z=\b T\b x$ such that the pair $(\b A,\b B)$ in the new coordinates has the form
\[
\tilde{\b A}=\b T\b A\b T^{-1}=\left[\begin{array}{cc}
\b A_1 & \b A_2\\
\b O & \b A_4
\end{array}\right],\quad \tilde{\b B}=\b T\b B=\left[\begin{array}{c}
\b B_1\\
\b O
\end{array}\right],
\]
where the pair $\left(\b A_1,\b B_1\right)$ is reachable, $\b A_1 \in \mb{\Bb R}^{r\times r}$, and $\b B_1 \in \mb{\Bb R}^{r\times m}$. Let
\[
\b u=-\tilde{\b K}\b z=-\left[\begin{array}{cc}
\b K_1 & \b K_2
\end{array}\right]\b z,
\]
where $\b K_1 \in \mb{\Bb R}^{m \times r}$ and $\b K_2 \in \mb{\Bb R}^{m \times (n-r)}$. Then,
\begin{equation}
\tilde{\b A}-\tilde{\b B}\tilde{\b K}=\left[\begin{array}{cc}
\b A_1-\b B_1\b K_1 & \b A_2-\b B_1\b K_2\\
\b O & \b A_4
\end{array}\right].
\label{eq:unconotaffe}
\end{equation}
It follows from~(\ref{eq:unconotaffe}) that the nonreachable portion of the system is not affected by the state-feedback, that is, the eigenvalues of $\b A_4$ cannot be allocated. Hence, the pole placement problem cannot be solved in general if the pair $(\tilde{\b A}, \tilde{\b B})$, or equivalently the pair $(\b A, \b B)$, is nonreachable, which completes the proof of the sufficiency part.\\
\hspace*{5.5in} $\Box$

For an alternative proof of this important result, the reader may consult Wonham~\cite{wonham67}.

\section{Observers}
In the previous section, we presented algorithms for solving the pole placement problem using linear state-feedback control law. To implement such a control law, one needs availability of all the state variables\index{state variables}. Often, this requirement is not met, either because measuring of all the state variables would require excessive number of sensors, or because the state variables are not accessible for direct measurement\index{state!not accessible for measurement}. Instead, only a subset of state variables or their combination may be available. To implement the control law constructed in the previous section, we will use estimates of state variables\index{state variables!estimates} rather than the true states.

We now discuss the problem of constructing observers. Much of the literature refers to observers as ``state estimators.''\index{state estimators|see{observers}} For example,  Franklin and Powell~\cite[page 139]{franklin80} argue that estimator is much more descriptive in its function because observer implies a direct measurement\index{observers!state estimators}. On the other hand, estimator implies non-deterministic approach. Here we use only a deterministic approach\index{observers!deterministic approach}. Therefore we follow the original terminology of the observer's inventor.


 The first observer was proposed by Luenberger in the early nineteen sixties~\cite{luenberger66,luenberger71,luenberger79} for the purpose of estimating the state of a dynamical system, referred to as a plant, based on limited measurements of that system. More specifically, an observer is a deterministic dynamical system\index{observer!deterministic system} that can generate an estimate of the plant's state using that plant's input and output signals. A block diagram of a general observer structure is depicted in Figure~\ref{fig:gen_obs}.
\begin{figure}[h]
  \centering
  \includegraphics[width=3.15in]{state01}
  \caption{General observer architecture.}
  \label{fig:gen_obs}
\end{figure}
The plant's state estimate can then be employed, in place of the true state, to close the control loop\index{state estimate!to close the control loop}. Observers can be used as ``software'' or ``virtual'' sensors\index{observers!as ``software'' sensors}\index{observers!as ``virtual'' sensors} as opposed to hardware sensing devices directly measuring physical variables, thus augmenting or replacing sensors in a control system~\cite{ellis02}. Observers have been applied in a variety of different areas such as secure communication using chaotic synchronization~\cite{grassi97,azemi00,lian01,lin05,jiang06,chen08}, machine vision~\cite{chen04}, wind energy systems~\cite{sbarbaro00},  speed-sensorless control of induction motors~\cite{derdiyok02,derdiyok05}, or in model-based predictive control~(MPC)~\cite{michalska95}, among many other applications.

 We present two types of observers. First, full-order observers are discussed and then a reduced-order observers are presented.
\subsection{Full-Order Observer}
We discuss the problem of constructing a full-order observer\index{full-order observer} for dynamical systems modeled by
\[
\left.\begin{array}{lll}
\dot{\b x}(t) &=& \b A\b x(t)+\b B\b u(t)\\
\b y(t) &=& \b C\b x(t),
\end{array}\right\}
\]
where $\b C \in \mb{\Bb R}^{p \times n}$, $p \le n$. We assume that the pair $(\b A, \b C)$ is observable. Our goal is to construct a dynamical system that will estimate the state vector $\b x$ based on the plant input $\b u$ and the plant output $\b y$. One could consider constructing a model of the plant dynamics and connecting the resulting dynamical system, referred to as an {\em open-loop observer\/}\index{observer}\index{observer!open-loop}\index{open-loop observer}, as in Figure~\ref{fig:op_esti}. An alternative representation of the open-loop observer is depicted in Figure~\ref{fig:op_esti_alt}.
\begin{figure}
\centering
\includegraphics[scale=0.5]{op_esti.eps}
%\vskip3in
%\centerbmp{3.33in}{2.5in}{c:/mybook/op_esti.bmp}
%\hskip1in\special{bmp:c:/mybook/op_esti.bmp x=4in y=3in}
\caption{Open-loop observer.}
\label{fig:op_esti}
\end{figure}
This open-loop observer is described by
\[
\dot{\tilde{\b x}}(t)=\b A \tilde{\b x}(t)+\b B\b u(t),
\]
where $\tilde{\b x}(t)$ is the estimate of $\b x(t)$. Let
\[
\b e(t)=\b x(t) - \tilde{\b x}(t)
\]
be the estimation error. Then, the dynamics of the observation error\index{observation error} are described by
\[
\dot{\b e}(t) = \dot{\b x}(t) - \dot{\tilde{\b x}}(t)= \b A \b e(t),
\]
with the initial estimation error
\[
\b e(0)=\b x(0) - \tilde{\b x}(0).
\]
\begin{figure}
\centering
\includegraphics[scale=0.5]{state03b.eps}
\caption{Alternative representation of the open-loop observer.}
\label{fig:op_esti_alt}
\end{figure}
If the eigenvalues of the matrix $\b A$ are in the open left-hand plane, then the error converges to zero. However, we have no control over the convergence rate\index{observation error!convergence rate}. Furthermore, the matrix $\b A$ does not have to have all its eigenvalues in the open left-hand plane. Thus, the open-loop observer is impractical\index{open-loop observer!impractical}. We modify this estimator by adding a feedback term to it. The resulting structure, depicted in Figure~\ref{fig:cl_esti}, is called the {\em closed-loop observer\/}\index{closed-loop observer|see{Luenberger observer}}, or the {\em Luenberger observer\/}\index{Luenberger observer}, or the asymptotic full-order observer\index{asymptotic observer}. An alternative representation of the closed-loop observer is depicted in Figure~\ref{fig:cl_esti_alt}.
\begin{figure}
\centering
\includegraphics[scale=0.5]{cl_esti.eps}
%\vskip3in
%\centerbmp{3.33in}{2.5in}{c:/mybook/cl_esti.bmp}
%\hskip1in\special{bmp:c:/mybook/cl_esti.bmp x=4in y=3in}
\caption{Closed-loop observer.}
\label{fig:cl_esti}
\end{figure}
The dynamics of the closed-loop observer are described by
\[
\dot{\tilde{\b x}}(t)=\b A \tilde{\b x}(t)+\b B\b u(t)+\b L\left(\b y(t)-\b C\tilde{\b x}(t)\right),
\]
and the dynamics of the observation error\index{observation error!dynamics} are governed by
\begin{eqnarray*}
\dot{\b e}(t)&=& \dot{\b x}(t) - \dot{\tilde{\b x}}(t)\\
&=&\left( \b A-\b L\b C\right)\b e(t),\quad \b e(0)=\b x(0) - \tilde{\b x}(0).
\end{eqnarray*}
The pair $(\b A,\b C)$ is observable, if and only if the dual pair $(\b A^{\top}, \b C^{\top})$ is reachable. By assumption, the pair $(\b A, \b C)$ is observable, and therefore the pair $(\b A^{\top},\b C^{\top})$ is reachable. By Theorem~\ref{thm:pp}, we can solve the pole placement problem for the dual pair\index{dual pair!observer design} $(\b A^{\top},\b C^{\top})$, that is, for any set of prespecified $n$ complex numbers, symmetric with respect to the real axis, there is a matrix, call it $\b L^{\top}$, such that the eigenvalues of $\b A^{\top}-\b C^{\top}\b L^{\top}$ and hence of $\b A-\b L\b C$ are in the prespecified locations. It follows from the above that if the pair $(\b A,\b C)$ is observable, then in addition to forcing the observation error to converge to zero, we can also control its rate of convergence by appropriately selecting the eigenvalues of the matrix $\b A-\b L\b C$. We also note that the selection of the closed-loop observer gain matrix\index{closed-loop observer!gain matrix}\index{asymptotic observer!gain matrix} $\b L$ can be approached in exactly the same fashion as the construction of the gain matrix $\b K$ in the linear state-feedback control law design. We illustrate the above point with a numerical example.
\begin{figure}
\centering
\includegraphics[scale=0.5]{state05b.eps}
\caption{Alternative representation of the closed-loop observer.}
\label{fig:cl_esti_alt}
\end{figure}
\begin{example}\rm
For the given observable pair
\[
\b A=\left[\begin{array}{cccc}
0 & 0 & 1 & 0\\
1 & 0 & 2 & 0\\
0 & 1 & 3 & 0\\
0 & 0 & -21 & 5
\end{array}\right],\quad \b C=\left[\begin{array}{cccc}
1 & 0 & 0 & 0\\
0 & 0 & 0 & 1
\end{array}\right],
\]
construct the matrix $\b L\in \mb{\Bb R}^{4\times 2}$ so that the eigenvalues of $\b A-\b L\b C$ are located at
\[
\{-2,-3+j,-3-j,-4\}.
\]
In our construction of the gain matrix $\b L$ we use the observer companion form\index{observer form!gain matrix construction} of the pair $(\b A, \b C)$ that we computed in Example~\ref{ex:ocf}. Our goal then is to construct a matrix $\b L$ so that the characteristic polynomial\index{characteristic polynomial} of the matrix $\b A-\b L\b C$ is
\[
\det(s\b I_4-\b A+\b L\b C)=s^4+12s^3+54s^2+108s+80.
\]
Using the observer form of the pair $(\b A,\b C)$, we select $\hat{\b L}$ so that
\[
\hat{\b A}-\hat{\b L}\hat{\b C}=\left[\begin{array}{cccc}
0 &0& 0 & -80\\
1 & 0 & 0 & -108\\
0 & 1 & 0 & -54\\
0 & 0 & 1 & -12
\end{array}\right].
\]
We have
\[
\hat{\b L}=\left[\begin{array}{cc}
1681 & 80\\
2270 & 108\\
1137 & 54\\
251 & 17
\end{array}\right],
\]
and hence
\[
\b L= \hat{\b T}^{\top}\hat{\b L}=\left[\begin{array}{cc}
1137 & 54\\
3955 & 188\\
5681 & 270\\
-23626 & -1117
\end{array}\right].
\]
We note that there are other possible gain matrices $\b L$ that could be used to allocate the eigenvalues of $\b A-\b L\b C$ into desired locations.
\end{example}\markex
We now present an alternative approach\index{observer design!alternative approach} to the closed-loop observer\index{observer}\index{observer!closed-loop}\index{closed-loop observer!alternative design} design. This approach will then be used to construct a reduced-order observer that we discuss in the subsequent section. We assume that the dynamics of an observer are given by
\begin{equation}
\dot{\b z}(t)=\b D\b z(t)+\b E\b u(t)+\b G\b y(t),
\label{eq:genestima}
\end{equation}
where $\b z(t) \in \mb{\Bb R}^{n}$. To begin with the development, suppose that we would like to obtain
\[
\b z=\b T\b x,
\]
where $\b T \in \mb{\Bb R}^{n \times n}$ is invertible. Premultiplying $\dot{\b x}(t)=\b A\b x(t)+\b B\b u(t)$ by $\b T$ yields
\begin{equation}
\b T\dot{\b x}(t)=\b T\b A\b x(t)+\b T\b B\b u(t).
\label{eq:premgenesti}
\end{equation}
Substituting into~(\ref{eq:genestima}) the relation $\b y(t)=\b C\b x(t)$ gives
\begin{equation}
\dot{\b z}(t)=\b D\b z(t)+\b E\b u(t)+\b G\b C\b x(t).
\label{eq:afsubycx}
\end{equation}
Subtracting~(\ref{eq:afsubycx}) from~(\ref{eq:premgenesti}) and taking into account that $\b z=\b T\b x$ and $\dot{\b z}=\b T\dot{\b x}$ yields
\[
\b 0=\left(\b T\b A-\b D\b T-\b G\b C \right)\b x(t)+\left(\b T\b B-\b E \right)\b u(t)
\]
for all $t$ and for arbitrary input $\b u$. Hence, we must have
\begin{eqnarray*}
\b T\b A-\b D\b T &=& \b G\b C\\
\b E &=& \b T\b B.
\end{eqnarray*}
If $\b z \ne \b T\b x$, but the two above equations hold, then subtracting~(\ref{eq:premgenesti}) from~(\ref{eq:afsubycx}) and taking into account the above relations yields
\begin{eqnarray*}
\frac{d}{dt}\left(\b z-\b T\b x \right) &=& \b D\b z-\b T\b A\b x+\b G\b C\b x\\
&=& \b D\b z-\b D\b T\b x\\
&=& \b D\left( \b z-\b T\b x\right).
\end{eqnarray*}
If the eigenvalues of $\b D$ all have negative real parts, then
\[
\b z-\b T\b x \to \b 0\quad\mb{as}\quad t \to \infty .
\]
Note that if we try $\b T=\b I_n$, then we have the previously analyzed case, where $\b G=\b L$, and
\begin{eqnarray*}
\b E &=& \b B,\\
\b A-\b L\b C &=& \b D.
\end{eqnarray*}
The resulting observer, when $\b T=\b I_n$, was called the identity observer\index{identity observer}\index{observer!identity} by its developer Luenberger~\cite{luenberger66,luenberger71}. Given the desired eigenvalues, symmetric with respect to the real axis, the equation $\b A-\b L\b C = \b D$ can be solved for $\b L$ so that the resulting $\b D$ has its eigenvalues in the desired locations, if and only if the pair $(\b A,\b C)$ is observable. However, it is not true that given an arbitrary $\b D$ we can solve for $\b L$ so that $\b A-\b L\b C = \b D$ even if the pair $(\b A,\b C)$ is observable. We use the results of the above discussion to construct an observer of reduced order in the following section.

\subsection{Reduced-Order Observer}
The full-order observer possesses a certain degree of redundancy\index{full-order observer!degree of redundancy}. It estimates all $n$ state variables even though a linear combination of the states in the form of the output, $\b y=\b C\b x$, is already known to us.  If the output $\b y$ is a $p$-vector with $p<n$, we would like to use the $p$ outputs to determine $p$ of the $x_i$'s and design an observer of order $n-p$ to estimate the rest of state variables. Specifically, if rank\,$\b C=p$, then we can use the equation $\b y=\b C\b x$ to solve for $p$ of the $x_i$'s in terms of the $y_i$'s and the remaining $n-p$ state variables $x_k$'s. Then, we construct an observer of order $n-p$. We present two methods for constructing reduced-order observers of order $n-p$.

\subsubsection{Method 1 for Reduced-Order Observer Construction}\index{reduced-order observer}\index{reduced-order observer!method 1}

To recover all states, we should like to solve, for $\b x$, the equations
\begin{eqnarray*}
\b z &=& \b T\b x\\
\b y &=& \b C\b x,
\end{eqnarray*}
where now $\b T \in \mb{\Bb R}^{(n-p) \times n}$. This can be done if and only if
\begin{equation}
\mb{rank}\left[\begin{array}{c}
\b T\\
\b C
\end{array}\right]=n.
\label{eq:tcfullrank}
\end{equation}
Given $\b D \in \mb{\Bb R}^{(n-p)\times (n-p)}$, $\b G \in \mb{\Bb R}^{(n-p)\times p}$, and the triple $(\b A,\b B,\b C)$, we can use the Kronecker product to show that the equation
\[
\b T\b A-\b D\b T = \b G\b C
\]
can be uniquely solved for $\b T$ if and only if no eigenvalue of $\b D$ is also an eigenvalue of $\b A$. Indeed, the above equation is a special case of the matrix equation~(\ref{eq:abc_eq}) that we analyzed in Section~\ref{sec:kroneckerpro}. Note that when choosing the matrices $\b D$ and $\b G$, we must make sure that the condition~(\ref{eq:tcfullrank}) is satisfied. The structure of the resulting reduced-order observer\index{reduced-order observer!method 1} is shown in Figure~\ref{fig:red_esti}.
\begin{figure}
\centering
\includegraphics[scale=0.5]{red_esti.eps}
%\vskip3in
%\centerbmp{3.33in}{2.5in}{c:/mybook/red_esti.bmp}
%\hskip1in\special{bmp:c:/mybook/red_esti.bmp x=4in y=3in}
\caption{Architecture of the reduced-order observer designed using method 1.}
\label{fig:red_esti}
\end{figure}


\subsubsection{Method 2 for Reduced-Order Observer\index{reduced-order observer}\index{reduced-order observer!method 2} Construction}

This method is presented in Luenberger~\cite[pp.~304--307]{luenberger79}. In this method, we first find a full-rank matrix $\b N \in \mb{\Bb R}^{n\times (n-p)}$ such that
\[
\b C\b N=\b O.
\]
Then, we construct a state-variable transformation\index{state-variable!transformation}
\[
\tilde{\b x}=\left[\begin{array}{c}
\b N^{\top}\\
\b C
\end{array}\right]=\tilde{\b T}\b x .
\]
Note that by construction, $\det \tilde{\b T} \ne 0$, and therefore $\tilde{\b T}$ is invertible. Let
\[
\tilde{\b x}=\left[\begin{array}{c}
\b w\\
\b y
\end{array}\right]= \left[\begin{array}{c}
\b N^{\top}\b x\\
\b C\b x
\end{array}\right].
\]
The plant model\index{plant model!in new coordinates} in the new coordinates has the form
\begin{eqnarray}
\frac{d}{dt}\left[\begin{array}{c}
\b w\\
\b y
\end{array}\right] &=& \tilde{\b T}\b A\tilde{\b T}^{-1}\left[\begin{array}{c}
\b w\\
\b y
\end{array}\right] + \tilde{\b T}\b B\b u\nonumber\\
&=& \left[\begin{array}{cc}
\b A_{11} & \b A_{12}\\
\b A_{21} & \b A_{22}
\end{array}\right]\left[\begin{array}{c}
\b w\\
\b y
\end{array}\right]+\left[\begin{array}{c}
\b B_1\\
\b B_2
\end{array}\right]\b u \label{eq:states_in_new_coord_ntc}\\
\b y &=& \b C \tilde{\b T}^{-1}\nonumber\\
&=& \left[\begin{array}{cc}
\b O & \b I_p
\end{array}\right]\left[\begin{array}{c}
\b w\\
\b y
\end{array}\right].
\label{eq:out_in_new_coor}
\end{eqnarray}
We represent~\eqref{eq:states_in_new_coord_ntc} as
\begin{eqnarray}
\dot{\b w} &=& \b A_{11}\b w + \b A_{12}\b y + \b B_1\b u\label{eq:first_eq_new_cor}\\
\dot{\b y} &=& \b A_{21}\b w + \b A_{22}\b y + \b B_2\b u .
\label{eq:second_eq_new_cor}
\end{eqnarray}
We can use the PBH test\index{PBH test} for observability\index{PBH test!observability} to show that if the pair $(\b A,\b C)$ is observable, then so is the pair $(\b A_{11}, \b A_{21})$. Therefore, we can construct a matrix $\b L_r\in \mb{\Bb R}^{(n - p)\times p}$ such that the matrix $(\b A_{11} - \b L_r\b A_{21})$ has its eigenvalues in pre-specified locations in the open-left half complex plane. Our next step is to premultiply both sides of~\eqref{eq:second_eq_new_cor} by $\b L_r$ and subtract the resulting equation from~\eqref{eq:first_eq_new_cor} to obtain
\[
\dot{\b w}-\b L_r\dot{\b y} = (\b A_{11} - \b L_r\b A_{21})\b w + (\b A_{12} - \b L_r\b A_{22})\b y + (\b B_{1} - \b L_r\b B_{2})\b u
\]
We need a term $(\b w-\b L_r\b y)$ on the right hand-side of the above equation. We add and subtract the term $(\b A_{11}-\b L_r\b A_{21})\b L_r\b y$ and perform simple manipulations to obtain
\begin{equation}
\frac{d}{dt}(\b w-\b L_r\b y) = (\b A_{11} - \b L_r\b A_{21})(\b w-\b L_r\b y) + (\b A_{11}\b L_r - \b L_r\b A_{21}\b L_r + \b A_{12}-\b L_r\b A_{22})\b y + (\b B_1 - \b L_r\b B_2)\b u .
\label{eq:after_adsubman}
\end{equation}
Let
\begin{equation}
\b v=\b w-\b L_r\b y.
\label{eq:var_change_to_v}
\end{equation}
Then we represent~\eqref{eq:after_adsubman} as
\begin{equation}
\dot{\b v} = (\b A_{11} - \b L_r\b A_{21})\b v  + (\b B_1 - \b L_r\b B_2)\b u + (\b A_{11}\b L_r - \b L_r\b A_{21}\b L_r + \b A_{12}-\b L_r\b A_{22})\b y .
\label{eq:red_plant_in_v}
\end{equation}
Let
\begin{equation}
\left.\begin{array}{ccl}\b D&=& \b A_{11} - \b L_r\b A_{21}\\
\b E &=& \b B_1 - \b L_r\b B_2\\
\b G &=& \b A_{11}\b L_r - \b L_r\b A_{21}\b L_r + \b A_{12}-\b L_r\b A_{22}.
\end{array}\right\}
\label{eq:red_obs_deg_mats}
\end{equation}
We construct a trivial observer\index{trivial observer!for reduced-order method 2} of $\b v$,
\begin{equation}
\dot{\b z} = \b D\b z + \b E\b u + \b G\b y .
\label{eq:trv_obsr_v}
\end{equation}
Note that
\[
\frac{d}{dt}(\b v-\b z)=(\b A_{11} - \b L_r\b A_{21})(\b v-\b z),
\]
which means that we fully control the dynamics of the observation error $(\b v-\b z)$ because we are free to select the gain matrix $\b L_r$ to place the eigenvalues\index{eigenvalue placement} of $(\b A_{11} - \b L_r\b A_{21})$ at any pre-specified locations. Thus
\[
\b z(t) \to \b v(t) = \b w-\b L_r\b y.
\]
We use $\b z$ and $\b y$ to obtain the estimate of $\b x$, denoted $\tilde{\b x}$, that is,
\begin{equation}
\tilde{\b x}=\tilde{\b T}^{-1}\left[\begin{array}{c}
\hat{\b w}\\
\b y
\end{array}\right]=\tilde{\b T}^{-1}\left[\begin{array}{c}
\b z+\b L_r\b y\\
\b y
\end{array}\right].
\label{eq:state_esti_meth2}
\end{equation}
The structure of the above observer\index{reduced-order observer!method 2} has the format somewhat similar to the one depicted in Figure~\ref{fig:red_esti}, which is the structure of the reduced-order observer designed using Method~1. However, the observers' matrices are computed quite differently in both methods.

The last step in the control design process involving an observer is to combine the control law, constructed in the previous section, with the observer.

\section{Combined Controller-Observer Compensator}

We start by combining a control law with a full-order observer\index{combine controller!with full-order observer}. We write the equations that govern the behavior of the dynamical system consisting of the plant model and the full-order observer. The resulting system's order is $2n$\index{plant and full-order observer!2$n$ order system}, and the equations that describe the system are
\begin{equation}
\left.\begin{array}{rll}
\left[\begin{array}{c}
\dot{\b x}(t)\\
\dot{\tilde{\b x}}(t)
\end{array}\right]&=&\left[\begin{array}{cc}
\b A & \b O\\
\b L\b C & \b A-\b L\b C
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\tilde{\b x}(t)
\end{array}\right]+\left[\begin{array}{c}
\b B\\
\b B
\end{array}\right]\b u(t)\\
\b y(t) &=& \left[\begin{array}{cc}
\b C & \b O
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\tilde{\b x}(t)
\end{array}\right]\end{array}\right\}
\label{eq:plaandesti}
\end{equation}
Suppose that we now apply the control law
\begin{equation}
\b u(t)=-\b K\tilde{\b x}(t)+\b v(t)
\label{eq:statfeefromesti}
\end{equation}
instead of the actual state-feedback control law. In the above, the vector $\b v$ denotes an external input signal. A schematic of a closed-loop system driven by the combined controller-observer compensator\index{compensator}\index{compensator!combined controller-observer} is shown in Figure~\ref{fig:obs_con}.
\begin{figure}
\centering
\includegraphics[scale=0.5]{obs_con.eps}
%\centerbmp{3.33in}{2.5in}{c:/mybook/obs_con.bmp}
\caption{Closed-loop system driven by the combined controller-observer compensator.}
\label{fig:obs_con}
\end{figure}
A model of the closed-loop system is obtained by combining equations~(\ref{eq:plaandesti}) and~(\ref{eq:statfeefromesti}),
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{\b x}(t)\\
\dot{\tilde{\b x}}(t)
\end{array}\right]&=&\left[\begin{array}{cc}
\b A &  -\b B\b K\\
\b L\b C & \b A-\b L\b C-\b B\b K
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\tilde{\b x}(t)
\end{array}\right]+\left[\begin{array}{c}
\b B\\
\b B
\end{array}\right]\b v(t)\\
\b y(t) &=& \left[\begin{array}{cc}
\b C & \b O
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\tilde{\b x}(t)
\end{array}\right].
\end{eqnarray*}
To analyze the above closed-loop system, it is convenient to perform a change of state variables\index{state variables!change} using the following transformation
\[
\left[\begin{array}{c}
\b x - \tilde{\b x}\\
\tilde{\b x}
\end{array}\right]=\left[\begin{array}{cc}
\b I_n & -\b I_n\\
\b O & \b I_n
\end{array}\right]\left[\begin{array}{c}
\b x\\
\tilde{\b x}
\end{array}\right].
\]
Note that
\[
\left[\begin{array}{cc}
\b I_n & -\b I_n\\
\b O & \b I_n
\end{array}\right]^{-1}=\left[\begin{array}{cc}
\b I_n & \b I_n\\
\b O & \b I_n
\end{array}\right].
\]
In the new coordinates the equations describing the closed-loop system are
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{\b x}(t) - \dot{\tilde{\b x}}(t)\\
\dot{\tilde{\b x}}(t)
\end{array}\right]&=&\left[\begin{array}{cc}
\b A -\b L\b C & \b O\\
\b L\b C & \b A-\b B\b K
\end{array}\right]\left[\begin{array}{c}
\b x(t) - \tilde{\b x}(t)\\
\tilde{\b x}(t)
\end{array}\right]+\left[\begin{array}{c}
\b O\\
\b B
\end{array}\right]\b v(t)\\
\b y(t) &=& \left[\begin{array}{cc}
\b C & \b C
\end{array}\right]\left[\begin{array}{c}
\b x(t) - \tilde{\b x}(t)\\
\tilde{\b x}(t)
\end{array}\right].
\end{eqnarray*}
Note that in the above system, the subsystem corresponding to the error component $\b e(t)=\b x(t) - \tilde{\b x}(t)$ is uncontrollable. Furthermore, the $2n$ poles of the closed-loop system are equal to the individual eigenvalues of both $\b A-\b L\b C$ and $\b A-\b B\b K$, which means that the design of the observer is separated from the construction of the control\index{observer design!separated from controller design} law. This is what is known as the {\em separation principle\/}\index{separation principle}. The closed-loop transfer function relating $\b Y(s)$ and $\b V(s)$ is
\begin{eqnarray*}
\b Y(s) &=& \left[\begin{array}{cc}
\b C & \b C
\end{array}\right]\left[\begin{array}{cc}
s\b I_n -\b A +\b L\b C & \b O\\
-\b L\b C & s\b I_n -\b A+\b B\b K
\end{array}\right]^{-1}\left[\begin{array}{c}
\b O\\
\b B
\end{array}\right]\b V(s)\\
&=& \b C\left(s\b I_n -\b A +\b B\b K \right)^{-1}\b B\b V(s).
\end{eqnarray*}
The above expression is identical to that for the closed-loop system if we applied the state-feedback control law $\b u(t)=-\b K\b x(t)+\b v(t)$. Thus, the combined controller-observer compensator\index{combined controller-observer compensator} yields the same closed-loop transfer function as the actual state-feedback control\index{actual state-feedback control} law.

We now briefly discuss the issue of the observer pole selection. Franklin, Powell, and Emami-Naeini~\cite[page~552]{franklin02} recommend that the real parts of the observer poles\index{observer poles!location reommendation}, that is, the real parts of the eigenvalues of the matrix $\b A-\b L\b C$, be a factor of 2 to 6 times deeper in the open left-half plane than the real parts of the controller poles which are the eigenvalues of the matrix $\b A-\b B\b K$. Such a choice ensures a faster decay of the observer error $\b e(t)=\tilde{\b x}(t)-\b x(t)$ compared with the desired controller dynamics. This in turn causes the controller poles\index{controller poles!dominate response} to dominate the closed-loop system response\index{closed-loop system response}. Because the observer poles represent a measure of the speed with which the error $\b e(t)=\tilde{\b x}(t)-\b x(t)$ decays to zero, one would tend to assign observer poles deep in the left-hand plane\index{left-hand plane}. However, fast decay requires large gains which may lead to saturation of some signals and unpredictable nonlinear effects. If the observer poles were slower than the controller poles, the closed-loop system response would be dominated by the observer, which is undesirable. As it is usual in engineering practice, the term compromise could be used to describe the process of constructing the final compensator structure.

We next analyze the combined controller-observer compensator\index{compensator}\index{compensator!combined controller-observer} that uses the reduced-order observer. The closed-loop system driven by this type of compensator also enjoys the separation property\index{reduced-order observer!separation property} as in the case of the full-order observer. To prove the above statement, we begin with writing the equations describing the closed-loop system,
\[
\left.\begin{array}{lll}
\dot{\b x}(t) &=& \b A\b x(t) +\b B\b u(t)\\
\dot{\b z}(t) &=& \b D\b z(t)+\b T\b B\b u(t)+\b G\b C\b x(t)\\
\b y(t) &=& \b C\b x(t)\\
\b u(t) &=& -\b K\tilde{\b x}(t)+\b v(t),
\end{array}\right\}
\]
where
\[
\tilde{\b x}=\left[\begin{array}{c}
\b T\\
\b C
\end{array}\right]^{-1}\left[\begin{array}{c}
\b z\\
\b y
\end{array}\right].
\]
Let
\[
\left[\begin{array}{c}
\b T\\
\b C
\end{array}\right]^{-1}=\left[\begin{array}{cc}
\b M &\b N
\end{array}\right],
\]
where $\b M\in\mb{\Bb R}^{n \times (n-p)}$ and $\b N\in\mb{\Bb R}^{n \times p}$. Note that
\[
\b M\b T+\b N\b C=\b I_n.
\]
Hence, the control input can be represented as
\begin{eqnarray*}
\b u(t) &=& -\b K\left[\begin{array}{cc}
\b M & \b N
\end{array}\right]\left[\begin{array}{c}
\b z(t)\\
\b y(t)
\end{array}\right]+\b v(t)\\
&=& -\b K\b M\b z(t)-\b K\b N\b y(t)+\b v(t).
\end{eqnarray*}
Using the above equations, and noting that $\b y(t)=\b C\b x(t)$, we represent equations that describe the closed-loop system as
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{\b x}(t)\\
\dot{\b z}(t)
\end{array}\right]&=&\left[\begin{array}{cc}
\b A & \b O\\
\b G\b C & \b D
\end{array}\right]\left[\begin{array}{c}
{\b x}(t)\\
{\b z}(t)
\end{array}\right]+\left[\begin{array}{c}
\b B\\
\b T\b B
\end{array}\right]\left(-\b K\b M\b z(t)-\b K\b N\b y(t)+\b v(t) \right)\\
&=& \left[\begin{array}{cc}
\b A-\b B\b K\b N\b C & -\b B\b K\b M\\
\b G\b C-\b T\b B\b K\b N\b C & \b D-\b T\b B\b K\b M
\end{array}\right]\left[\begin{array}{c}
{\b x}(t)\\
{\b z}(t)
\end{array}\right]+\left[\begin{array}{c}
\b B\\
\b T\b B
\end{array}\right]\b v(t)\\
\b y(t) &=& \left[\begin{array}{cc}
\b C & \b O
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\b z(t)
\end{array}\right].
\end{eqnarray*}
To proceed further, we perform a transformation of the state variable of the above system,
\[
\left[\begin{array}{c}
\b x\\
\b z-\b T\b x
\end{array}\right]=\left[\begin{array}{cc}
\b I_n & \b O\\
-\b T & \b I_{n-p}
\end{array}\right]\left[\begin{array}{c}
\b x\\
\b z
\end{array}\right].
\]
Note that
\[
\left[\begin{array}{cc}
\b I_n & \b O\\
-\b T & \b I_{n-p}
\end{array}\right]^{-1}=\left[\begin{array}{cc}
\b I_n & \b O\\
\b T & \b I_{n-p}
\end{array}\right].
\]
In the new coordinates the equations describing the closed-loop system become
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{\b x}(t)\\
\dot{\b z}(t)-\b T\dot{\b x}(t)
\end{array}\right]&=&\left[\begin{array}{cc}
\b A-\b B\b K\b N\b C-\b B\b K\b M\b T & -\b B\b K\b M\\
-\b T\b A+\b G\b C+\b D\b T & \b D
\end{array}\right]\left[\begin{array}{c}
{\b x}(t)\\
{\b z}(t)-\b T\b x(t)
\end{array}\right]\\
&{}&+\left[\begin{array}{c}
\b B\\
\b O
\end{array}\right]\b v(t)\\
\b y(t) &=& \left[\begin{array}{cc}
\b C & \b O
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\b z(t)-\b T\b x(t)
\end{array}\right].
\end{eqnarray*}
Taking into account the equations
\[
\b T\b A-\b D\b T-\b G\b C = \b 0\quad\mb{and}\quad
\b M\b T= \b I_n -\b N\b C,
\]
we obtain
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{\b x}(t)\\
\dot{\b z}(t)-\b T\dot{\b x}(t)
\end{array}\right]&=&\left[\begin{array}{cc}
\b A-\b B\b K & -\b B\b K\b M\\
\b O & \b D
\end{array}\right]\left[\begin{array}{c}
{\b x}(t)\\
{\b z}(t)-\b T\b x(t)
\end{array}\right]+\left[\begin{array}{c}
\b B\\
\b O
\end{array}\right]\b v(t)\\
\b y(t) &=& \left[\begin{array}{cc}
\b C & \b O
\end{array}\right]\left[\begin{array}{c}
\b x(t)\\
\b z(t)-\b T\b x(t)
\end{array}\right].
\end{eqnarray*}
It is now apparent that the separation principle\index{separation principle|see{combined controller-observer compensator}}\index{reduced-order observer!separation property} also holds if we use the reduced-order observer in constructing the compensator, that is, the selection of the gain matrix $\b K$ that assigns closed-loop poles is independent, separate, from the selection of the observer gain matrix $\b L$ that assigns the observer poles. Furthermore, the transfer function matrix relating $\b Y(s)$ and $\b V(s)$ in the closed-loop system with the reduced-order observer is exactly the same as the one that would be obtained using the actual state-feedback control law $\b u(t)=-\b K\b x(t)+\b v(t)$.
\begin{example}\label{ex:dcobserv}\rm
Consider a schematic of an armature-controlled DC motor\index{DC motor}\index{DC motor!armature-controlled} system, shown in Figure~\ref{fig:open_dc}, where the system parameters are: $R_a=5$~$\Omega$, $L_a=200$~mH, $K_b=0.1$~V/rad/sec, $K_i=0.1$~Nm/A, the gear ratio $N_1/N_2=1/50$. The armature inertia is $I_{armature}=2\times10^{-3}$~kg$\cdot$m$^2$. The load of $10$~kg is located at an effective radius of $0.2$~m. The gear inertia and friction are negligible.
\begin{figure}
\centering
\includegraphics[scale=0.57]{hw2fig2.eps}
%\vspace{3in}
%\centerbmp{4in}{3in}{c:/mybook/hw2fig2.bmp}
%\hskip1.2in\special{bmp:c:/mybook/hw2fig2.bmp x=4in y=3in}
\caption{Schematic of an armature-controlled DC motor system of Example~\ref{ex:dcobserv}.}
\label{fig:open_dc}
\end{figure}

We first construct a state-space model\index{state-space model!DC motor system} of the DC motor system. We start with writing the equation relating torque to angular acceleration:
\begin{equation}
T_m=I_{eq}\ddot{\theta},
\label{eq:mechtorq}
\end{equation}
where
\begin{eqnarray*}
I_{eq}&=&I_{armature}+\left(N_1/N_2 \right)^2 I_{l}\\
&=&2\times10^{-3}\,\mb{kg$\cdot$m}^2+(1/50)^2\times10\times(0.2)^2\,\mb{kg$\cdot$m}^2\\
&=&2.16\times10^{-3}\,\mb{kg$\cdot$m}^2.
\end{eqnarray*}
Kirchhoff's voltage law\index{Kirchhoff's voltage law} applied to the armature circuit\index{armature circuit}\index{circuit!armature} gives
\[
R_ai_a+L_a\frac{di_a}{dt}+e_b=e_a,
\]
where $e_b=K_b\frac{d\theta}{dt}$. The equation for the developed torque is
\begin{equation}
T_m = K_i i_a.
\label{eq:electrtor}
\end{equation}
Combining~(\ref{eq:mechtorq}) and~(\ref{eq:electrtor}) gives
\[
\ddot{\theta}=\frac{K_i}{I_{eq}} i_a.
\]
Let $x_1=i_a$, $x_2=\theta$, $x_3=\dot{\theta}=\omega$, $u=e_a$, and $y=\theta_l$. Taking into account the definition of the state variables, we represent the above modeling equations in state-space format:
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{x}_1\\
\dot{x}_2\\
\dot{x}_3
\end{array}\right] &=& \left[\begin{array}{ccc}
-\frac{R_a}{L_a} & 0 & -\frac{K_b}{L_a}\\
0 & 0 & 1\\
\frac{K_i}{I_{eq}} & 0 & 0
\end{array}\right]\left[\begin{array}{c}
{x}_1\\
{x}_2\\
{x}_3
\end{array}\right]+\left[\begin{array}{c}
\frac{1}{L_a}\\
0\\
0
\end{array}\right]u\\
y &=& \left[\begin{array}{ccc}
0 & \frac{N_1}{N_2} & 0
\end{array}\right]\left[\begin{array}{c}
{x}_1\\
{x}_2\\
{x}_3
\end{array}\right].
\end{eqnarray*}
Substituting the given parameter values, we get
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{x}_1\\
\dot{x}_2\\
\dot{x}_3
\end{array}\right] &=& \left[\begin{array}{ccc}
-25 & 0 & -0.5\\
0 & 0 & 1\\
46.296 & 0 & 0
\end{array}\right]\left[\begin{array}{c}
{x}_1\\
{x}_2\\
{x}_3
\end{array}\right]+\left[\begin{array}{c}
5\\
0\\
0
\end{array}\right]u=\b A\b x+\b b u\\
y &=& \left[\begin{array}{ccc}
0 & 0.02 & 0
\end{array}\right]\left[\begin{array}{c}
{x}_1\\
{x}_2\\
{x}_3
\end{array}\right]=\b c\b x.
\end{eqnarray*}
Our next step is to design a state-feedback controller $u=-\b k\b x + v$, such that the eigenvalues of $\b A-\b b\b k$ are
\[
-1+j,-1-j,-10.
\]
To allocate the poles into the desired locations, we first transform the system model into the controller companion form. We first form the controllability matrix
\[
\b{\cal U}=\left[\begin{array}{ccc}
\b b & \b A\b b & \b A^2\b b
\end{array}\right]=\left[\begin{array}{ccc}
5 & -125 & 3009.3\\
0 & 0 & 231.5\\
0 & 231.5 &-5787
\end{array}\right].
\]
The system is controllable. The last row of the inverse of the controllability matrix is
\[
\b q_1=\left[\begin{array}{ccc}
0 & 0.0043 & 0
\end{array}\right],
\]
and hence the transformation matrix we are seeking has the form
\[
\b T = \left[\begin{array}{c}
\b q_1\\
\b q_1\b A\\
\b q_1\b A^2
\end{array}\right]= \left[\begin{array}{ccc}
0 & 0.0043 & 0\\
0 & 0 & 0.0043\\
0.2 & 0 & 0
\end{array}\right].
\]
The system's matrices in the new coordinates are
\[
\tilde{\b A} = \b T\b A\b T^{-1}
= \left[\begin{array}{ccc}
0 & 1 & 0\\
0 & 0 & 1\\
0 & -23.148 & -25
\end{array}\right],
\]
\[
\tilde{\b b} = \b T\b b
= \left[\begin{array}{c}
0\\
0\\
1
\end{array}\right],
\]
and
\[
\tilde{\b c} = \b c\b T^{-1}
= \left[\begin{array}{ccc}
4.63 & 0 & 0
\end{array}\right].
\]
The desired closed-loop characteristic polynomial\index{characteristic polynomial} $\alpha_c(s)$ is
\[
\alpha_s(s) = (s+1-j)(s+1+j)(s+10)= s^3+12s^2+22s+20.
\]
We now find $\tilde{\b k}$ so that
\[
\tilde{\b A}-\tilde{\b b}\tilde{\b k}=\left[\begin{array}{ccc}
0 & 1 & 0\\
0 & 0 & 1\\
-20 & -22 & -12
\end{array}\right].
\]
We have
\[
\tilde{\b k}=\left[\begin{array}{ccc}
20 & -1.148 & -13
\end{array}\right],
\]
and
\[
\b k = \tilde{\b k}\b T=\left[\begin{array}{ccc}
-2.6 & 0.0864 & -0.005
\end{array}\right].
\]
Hence,
\[
\b A-\b b \b k = \left[\begin{array}{ccc}
-12 & -0.432 & -0.4752\\
0 & 0 & 1\\
46.294 & 0 & 0
\end{array}\right].
\]
The transfer function of the closed-loop system is
\[
\frac{{\cal L}(y(t))}{{\cal L}(v(t))}=\frac{Y(s)}{V(s)}=\b c\left( s\b I-\b A+\b b\b k\right)^{-1}\b b=\frac{4.6296}{s^3+12s^2+22s+20}.
\]
The unit-step response\index{unit-step response} of the closed-loop system is shown in Figure~\ref{fig:motcl}.
\begin{figure}
\centering
\includegraphics[scale=0.5]{dc_noest.eps}
%\vspace{4in}
%\centerline{\psfig{figure=c:/mybook/dc_noest.eps,height=3in}}
%\centering{\epsfig{file=c:/mybook/dc_noest.eps,height=3in}}
%\centerbmp{4in}{3in}{c:/ee680/motcl.bmp}
%\hskip.5in\special{bmp:c:/ee680/motcl.bmp x=5.33in y=4in}
\caption{Step response of the closed-loop DC motor system with state feedback.}
\label{fig:motcl}
\end{figure}


Next, we design a full-order observer\index{full-order observer}\index{observer!full-order} placing its poles at $\{-4, -5+2j, -5-2j\}$, and then synthesize the combined controller-observer compensator\index{combined controller-observer compensator!full-order observer}. To compute the observer gain vector $\b l$, we first transform the pair $(\b A, \b c)$ into the observer companion form. This is equivalent to transforming the pair $(\b A^{\top}, \b c^{\top})$ into the controller companion form. The transformation matrix that brings the pair $(\b A, \b c)$ into its observer companion form\index{observer companion form}\index{observer form} is
\[
\hat{\b Q}=\hat{\b T}^{\top}= \left[\begin{array}{ccc}
1.1 & -27 & 650\\
0 & 0 & 50\\
0 & 50 & -1250
\end{array}\right].
\]
The matrices $\b A$ and $\b c$ in the new coordinates have the form:
\[
\hat{\b A}=\hat{\b Q}^{-1}\b A\hat{\b Q}=\left[\begin{array}{ccc}
0 & 0 & 0\\
1 & 0 & -23.1481\\
0 & 1 & -25
\end{array}\right]\quad\mb{and}\quad
\hat{\b c}=\b c\hat{\b Q}=\left[\begin{array}{ccc}
0 & 0 & 1
\end{array}\right].
\]
The desired characteristic polynomial\index{characteristic polynomial!of observer} of the observer is
\[
\det\left(\b I_3-\b A+\b l\b c\right) = (s+4)(s+5-2j)(s+5+2j)= s^3+14s^2+69s+116.
\]
We now find $\hat{\b l}$ so that
\[
\hat{\b A}-\hat{\b l}\hat{\b c}=\left[\begin{array}{ccc}
0 & 0 & -116\\
1 & 0 & -69\\
0 & 1 & -14
\end{array}\right].
\]
We have
\[
\hat{\b l}=\left[\begin{array}{c}
116\\
45.8519\\
-11
\end{array}\right]\quad\mb{and therefore}\quad
\b l=\hat{\b Q}\hat{\b l}=\left[\begin{array}{c}
-8263\\
-550\\
16043
\end{array}\right].
\]
The dynamics of the full-order observer\index{full-order observer} are described by
\[
\dot{\tilde{\b x}}=(\b A-\b l\b c)\tilde{\b x}+\b b u+\b l y,
\]
that is,
\[
\dot{\tilde{\b x}}=\left[\begin{array}{ccc}
-25 & 165.2544 & -0.5\\
0 & 11 & 1\\
46.2963 & -320.8519 & 0
\end{array}\right]\tilde{\b x} + \left[\begin{array}{c}
5\\
0\\
0
\end{array}\right]u+\left[\begin{array}{c}
-8263\\
-550\\
16043
\end{array}\right]y.
\]

We connect the full-order observer to the DC motor\index{DC motor} system\index{system}\index{system!DC motor}, thus obtaining a closed-loop system with the combined controller-full-order-observer compensator\index{combined controller-observer compensator!full-order} in the loop as in Figure~\ref{fig:obs_con}. In Figure~\ref{fig:mobser}, we show a plot of $x_1$ and its estimate for the closed-loop system with the observer in the loop, where $v=0$, $\b x(0)=\left[\begin{array}{ccc}
1 & 0.2 & -0.1
\end{array}\right]^{\top}$, and $\tilde{\b x}(0)=\b 0$.

We point out that the step response of the closed-loop system with the combined controller-full-order-observer compensator in the loop as in Figure~\ref{fig:obs_con}, with zero initial conditions on the plant and the full-order observer, is identical to that shown in Figure~\ref{fig:motcl}.

\begin{figure}
\centering
\includegraphics[scale=0.4]{esti_fo.eps}
\caption{A plot of $x_1$ and its estimate versus time for the closed-loop system with the full-order observer in the loop.}
\label{fig:mobser}
\end{figure}


Our next part of this example is to design the reduced-order observer\index{observer}\index{observer!reduced-order}\index{reduced-order observer} using the design method 1. We choose the reduced-order observer's poles at $\{-5+2j, -5-2j\}$. The reduced-order observer dynamics\index{reduced-order observer!dynamics} are given by
\[
\dot{\b z}=\b D \b z+\b E u+ \b G y.
\]
Let
\[
\b G=\left[\begin{array}{c}
100\\
100
\end{array}\right].
\]
The observer's poles are supposed to be $-5+2j$ and $-5-2j$. Thus, the desired characteristic polynomial\index{characteristic polynomial!desired} of $\b D$ should be
\[
\det(s\b I_2-\b D)=s^2+10s+29.
\]
Let
\[
\b D=\left[\begin{array}{cc}
0 & 1\\
-29 & -10
\end{array}\right].
\]
We now solve the matrix equation,
\[
-\b D\b T+\b T\b A=\b G\b c,
\]
for $\b T$. We first convert the above equation in the format similar to that given by~(\ref{eq:abc_equieq}) in Section~\ref{sec:kroneckerpro} and then solve the resulting equation. Employing the following MATLAB's commands,\index{MATLAB's commands}
\begin{verbatim}
Gc=G*c;
t=(-kron(eye(3),D)+kron(A',eye(2)))\Gc(:);
T=[t(1:2) t(3:4) t(5:6)]
\end{verbatim}
we obtain
\[
\b T=\left[\begin{array}{ccc}
-0.5493 & 0.7586 & -0.2507\\
2.1271 & -2.0000 & 1.0332
\end{array}\right].
\]
Note that
\[
\det\left[\begin{array}{c}
\b T\\
\b c
\end{array}\right]=6.8691\times 10^{-4} \ne 0,
\]
and
\[
\left[\begin{array}{c}
\b T\\
\b c
\end{array}\right]^{-1}=\left[\begin{array}{ccc}
-30.0840 & -7.2980 & 411.3200\\
0 & 0 & 50\\
61.9338 & 15.9921 & -750
\end{array}\right].
\]
We also have
\[
\b E = \b T\b b= \left[\begin{array}{c}
-2.7463\\
10.6357
\end{array}\right].
\]
Hence, the dynamics of the reduced-order observer\index{reduced-order observer!dynamics of} are described by
\[
\dot{\b z}=\left[\begin{array}{cc}
0 & 1\\
-29 & -10
\end{array}\right]\b z+\left[\begin{array}{c}
-2.7463\\
10.6357
\end{array}\right]u+\left[\begin{array}{c}
100\\
100
\end{array}\right]y.
\]
An estimate of the entire state can be obtained from
\[
\hat{\b x} = \left[\begin{array}{c}
\b T\\
\b c
\end{array}\right]^{-1}\left[\begin{array}{c}
\b z\\
y
\end{array}\right]= \left[\begin{array}{ccc}
-30.0840 & -7.2980 & 411.3200\\
0 & 0 & 50\\
61.9338 & 15.9921 & -750
\end{array}\right]\left[\begin{array}{c}
\b z\\
y
\end{array}\right].
\]
A plot of $x_1$ and its estimate versus time for the closed-loop system with the combined controller-reduced-order-observer compensator\index{combined controller-observer compensator!reduced-order observer} is depicted in Figure~\ref{fig:mrobs}, where $v=0$, $\b x(0)=\left[\begin{array}{ccc}
1 & 0.2 & -0.1
\end{array}\right]^{\top}$, and $\b z(0)=\b 0$.
\begin{figure}
\centering
\includegraphics[scale=0.4]{esti_ro.eps}
\caption{A plot of $x_1$ and its estimate versus time for the closed-loop system with the reduced-order observer, designed using method 1, in the loop.}
\label{fig:mrobs}
\end{figure}

Our last part of this example is to construct the reduced-order observer\index{observer}\index{observer!reduced-order}\index{reduced-order observer!method 2} employing the design method 2. This reduced-order observer matrices are computed using~\eqref{eq:red_obs_deg_mats}. The state estimate is obtained from~\eqref{eq:state_esti_meth2}.
A plot of $x_1$ and its estimate versus time for the closed-loop system with the combined controller-reduced-order-observer compensator is depicted in Figure~\ref{fig:esti_ro_2}, where, as before, $v=0$, $\b x(0)=\left[\begin{array}{ccc}
1 & 0.2 & -0.1
\end{array}\right]^{\top}$, and $\b z(0)=\b 0$.
\begin{figure}
\centering
\includegraphics[scale=0.4]{esti_ro_2.eps}
\caption{A plot of $x_1$ and its estimate versus time for the closed-loop system with the reduced-order observer, designed using method 2, in the loop.}
\label{fig:esti_ro_2}
\end{figure}

Of course, for zero initial conditions, the step responses of the closed-loop systems with the full-order, as well as with the reduced-order observers in the loop, are the same as the step response of the closed-loop system with the state-feedback controller $u=-\b k\b x+v$. This follows from our analyses of the combined controller-observer compensators.
\end{example}\markex

\section{Notes}
For further reading on the subject of linear system theory\index{linear system!theory}, see Brockett~\cite{brockett70}, Wolovich~\cite{wolovich74}, Barnett~\cite{barnett75}, Kailath~\cite{kailath80}, Skelton~\cite{skelton88}, DeCarlo~\cite{decarlo89}, Rugh~\cite{rugh96}, Antsaklis and Michel~\cite{antsaklis97}, or Chen~\cite{ctchen99}. For more information on canonical forms, see the papers by Popov~\cite{popov72} and Denham~\cite{denham74}.

One may argue that Maxwell's~\cite{maxwell68} analysis\index{Maxwell's analysis!of Watt's governor} of Watt's governor constitutes the first work in linear system theory\index{Maxwell's analysis!first work in linear system theory}: the physical object, its linear model and a method of analysis. For example, MacFarlane~\cite[page~251]{macfarlane79} states that ``Maxwell's fundamentally important contribution lay in recognizing that the behavior of an automatic feedback control system in the vicinity of an equilibrium condition could be approximated by a linear differential equation, and hence the stability of the control system could be discussed in terms of the location of the roots of an associated algebraic equation.'' On the other hand, L.~Markus in~\cite[page~xxvii]{elworthy94} makes the following statement: ``But certainly Watt's application of the centrifugal governor\index{centrifugal governor} for regulating steam engines\index{regulating!steam engines} (1775) can be taken as the start of modern control engineering.\index{Watt's application!start of modern control}''

In Kalman's~\cite{kalman63} well-known 1963 paper, there is a theorem which states that the state space, ${\cal X}$, of a linear system model may be decomposed as a direct sum\index{linear system!decomposed as a direct sum}\index{Kalman decomposition}
\[
{\cal X}={\cal X}_A\oplus{\cal X}_B\oplus{\cal X}_C\oplus{\cal X}_D,
\]
where
\begin{eqnarray*}
{\cal X}_A &=& \mb{ states that are reachable but not observable}\\
{\cal X}_B &=& \mb{ states that are reachable and observable}\\
{\cal X}_C &=& \mb{ states that are neither reachable nor observable}\\
{\cal X}_D &=& \mb{ states that are not reachable but observable}
\end{eqnarray*}
This decomposition became,  to a certain extent, an icon of linear systems. For example, the logo on the covers of the old issues of the {\em International Journal of Systems Science} was the above decomposition. Many authors included Kalman's original decomposition algorithm in their textbooks on linear systems. Yet almost twenty years after Kalman's publication of the decomposition theorem,\index{decomposition theorem!Kalman} Boley~\cite{boley80} generated an example which revealed some shortcomings of Kalman's original algorithm. In his reply, Kalman~\cite{kalman82} revised his decomposition algorithm and fixed his original proof of the decomposition theorem.
\section{Exercises}
\begin{exercise}\rm{\bf (adapted from~\cite[page~94]{barnett75})} Consider the system, shown in Figure~\ref{fig:dsmdsmu}, which is composed of two masses moving on a smooth, that is, frictionless, horizontal plane.
\begin{figure}
\centering
\includegraphics[scale=0.5]{dsmdsmu.eps}
%\vspace{3in}
%\centerbmp{3.33in}{2.5in}{c:/mybook/dsmdsmu.bmp}
\caption{A mechanical system for Exercise~\ref{ex:dsmdsmu}.}
\label{fig:dsmdsmu}
\end{figure}
The springs are linear\index{spring!linear}, that is, they obey Hooke's law\index{Hooke's law},
\[
\mb{force}=k \times \mb{extension},
\]
where $k$ is a constant called the force constant of the spring. In addition to the springs, the masses are joined by linear dampers. In a linear damper\index{damper!linear}, the force is proportional to the velocity of one end of the damper relative to the other end. The proportionality constant is called the damping coefficient\index{damping coefficient}. In this exercise, damping coefficients are $b_1$ and $b_2$, respectively. A force $u$ is applied to the right end mass. Obtain the system's state space model in the form $\dot{\b x}=\b A\b x+\b b u$. Determine under what condition, in terms of $k_1$, the system model is controllable\index{system model!when controllable} for $m_1=m_2=1$~kg, $b_1=b_2=1$~Ns/m, and $k_2=1/4$~N/m.
\label{ex:dsmdsmu}
\end{exercise}
\begin{exercise}\rm
In the circuit shown in Figure~\ref{fig:scrrl}, take the state variables to be the voltage across the capacitor\index{capacitor} and the current through the inductor\index{inductor}. The source voltage $v_s$ is the control variable and the current $i$ is the system output. Obtain the state-space model of the this circuit\index{circuit!state-space model}. Obtain the condition, in terms of $R_1$, $R_2$, $C$, and $L$, under which the model is uncontrollable and unobservable. Find the transfer function of the circuit\index{circuit!transfer function} model.
\begin{figure}
\centering
\includegraphics[scale=0.5]{scrrl.eps}
%\vspace{3in}
%\centerbmp{4in}{3in}{c:/mybook/scrrl.bmp}
%\hskip1.2in\special{bmp:c:/mybook/scrrl.bmp x=4in y=3in}
\caption{Electric circuit for Exercise~\ref{ex:scrrl}.}
\label{fig:scrrl}
\end{figure}
\label{ex:scrrl}
\end{exercise}
\begin{exercise}\rm
In the circuit shown in Figure~\ref{fig:srlccl}, take the state variables to be the voltage across the capacitor\index{capacitor} $C_1$, the current through the inductor\index{inductor} $L_1$, and the current through the inductor $L_2$. The source current $i_s$ is the control variable and the current through the inductor $L_2$ is the system output. Obtain the state space model of this circuit\index{circuit!state-space model}. Analyze the circuit model controllability and observability properties. Find the transfer function of the circuit model\index{circuit!transfer function}.
\begin{figure}
\centering
\includegraphics[scale=0.5]{srlccl.eps}
%\vspace{3in}
%\centerbmp{4in}{3in}{c:/mybook/srlccl.bmp}
%\hskip1.2in\special{bmp:c:/mybook/srlccl.bmp x=4in y=3in}
\caption{Electric circuit for Exercise~\ref{ex:srlccl}.}
\label{fig:srlccl}
\end{figure}
\label{ex:srlccl}
\end{exercise}
\begin{exercise}\rm
For the system
\[
\dot{x}=x+u,
\]
find the set of points that can be steered to the origin $x=0$ by an admissible control\index{admissible control}\index{control!admissible} $|u|\le 1$.
\end{exercise}
\begin{exercise}\rm
\begin{itemize}\item[(a)] Find $e^{\b A t}$ for
\[
\b A=\left[\begin{array}{cc}
0 & 1\\
-a b & -a -b
\end{array}\right].
\]
\item[(b)] Given a dynamical system modeled by the differential equation\index{differential equation}
\[
\ddot{x}+2\dot{x}+x=\dot{r}+r,
\]
where $r=r(t)=\sin t$, and the initial conditions are $x(0)=1$ and $\dot{x}(0)=0$. Choose the state variables $x_1=x$ and $x_2=\dot{x}_1$. Represent the differential equation in state-space format. Solve for $x(t)$ for $t\ge 0$.
\end{itemize}
In both cases, verify your calculations using MATLAB's Symbolic Toolbox\index{MATLAB!Symbolic Toolbox}.
\end{exercise}
\begin{exercise}\rm
Find sufficient conditions, in terms of $a, b, c$, and $d$, for reachability\index{reachability} of the following pairs:
\begin{itemize}
\item[(a)]\[\b A=\left[\begin{array}{ccccc}
-1 & 1 & 0 & 0 & 0\\
0 & -1 & 1 & 0 & 0\\
0 & 0 & -1 & 0 & 0\\
0 & 0 & 0 & -2 & 1\\
0 & 0 & 0 & 0 & -2
\end{array}\right], \quad \b B=\left[\begin{array}{cc}
0 & 0\\
0 & 0\\
a & b\\
0 & 0\\
c & d
\end{array}\right];
\]
\item[(b)]\[\b A=\left[\begin{array}{ccccc}
-1 & 1 & 0 & 0 & 0\\
0 & -1 & 1 & 0 & 0\\
0 & 0 & -1 & 0 & 0\\
0 & 0 & 0 & -1 & 1\\
0 & 0 & 0 & 0 & -1
\end{array}\right], \quad \b B=\left[\begin{array}{cc}
0 & 0\\
0 & 0\\
a & b\\
0 & 0\\
c & d
\end{array}\right].
\]
\end{itemize}
\end{exercise}

\begin{exercise}\rm
A system composed of two subsystems connected in cascade is depicted in the block diagram shown in Figure~\ref{fig:cascont}. Take the state variables of the system to be: $x_1=y_1-u_1$ and $x_2=y_2$. Assume that the system input is $u=u_1$ and the system output is $y=y_2$. Obtain the state space model of the interconnected system. When is the system uncontrollable\index{uncontrollable!when}? Find the transfer function of the uncontrollable system\index{uncontrollable system!transfer function of}.
\begin{figure}
\centering
\includegraphics[scale=0.5]{cascont.eps}
%\vspace{3in}
%\centerbmp{4in}{3in}{c:/mybook/cascont.bmp}
%\hskip1.2in\special{bmp:c:/mybook/cascont.bmp x=4in y=3in}
\caption{A block diagram for Exercise~\ref{ex:cascont}.}
\label{fig:cascont}
\end{figure}
\label{ex:cascont}
\end{exercise}
\begin{exercise}\rm
\label{exe:exwbldia}
Derive a state-space description of a system represented by the block diagram given in Figure~\ref{fig:shw1_1}.
\begin{figure}
\centering
\includegraphics[scale=0.55]{shw1_1.eps}
%\vspace{3.5in}
%\centerbmp{4.67in}{3.5in}{c:/mybook/shw1_1.bmp}
%\hskip1in\special{bmp:c:/ee680/shw1_1.bmp x=4.67in y=3.5in}
\caption{A block diagram for Exercise~\ref{exe:exwbldia}.}
\label{fig:shw1_1}
\end{figure}
Construct a state-variable transformation\index{transformation!state-variable} $\b z=\b T\b x$ such that the matrix $\b T\b A\b T^{-1}$ has a diagonal form\index{diagonal form}\index{matrix!diagonal form of}. Find the eigenvalue of $\b T\b A\b T^{-1}$ corresponding to the noncontrollable state and the eigenvalue corresponding to the nonobservable\index{nonobservable} state. Find the transfer function of the system.
\end{exercise}

\begin{exercise}\rm %funwork5 ece 602 fall 11 p1
Consider a linear time-invariant (LTI) system model,
\begin{eqnarray*}
\dot{\b x}(t) &=& \left[\begin{array}{ccccccc}
-1 & 1 & 0 & 0 & 0 & 0 & 0\\
0 & -1 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & -1 & 0 & 0 & 0 & 0\\
0 & 0 & -1 & -1 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 1 & 0 & 0\\
0 & 0 & 0 & 0 & 0 & 1 & 0
\end{array}\right]\b x(t) + \left[\begin{array}{c}
0\\
1\\
-1\\
1\\
1\\
0\\
2
\end{array}\right]u(t)\\
\b y(t) &=& \left[\begin{array}{ccccccc}
1 & 0 & 2 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 2 & 3 & 0 & 0
\end{array}\right]\b x(t).
\end{eqnarray*}
\begin{itemize}
\item[{\bf (i)}] Use the PBH test to determine if the system is controllable\index{PBH test!controllable};
\item[{\bf (ii)}] Use the PBH test to determine if the system is observable\index{PBH test!observable}.
\end{itemize}
\end{exercise}


\begin{exercise}\label{exer:extarct_min_real}\rm Examples~\ref{ex:firstrealizsizes} and~\ref{ex:min_realiz_ex} are concerned with constructing realizations of the same transfer function matrix. Apply Theorem~\ref{thm_decomp} to extract a minimal realization\index{minimal realization} from the realization given in Example~\ref{ex:firstrealizsizes}. You can use MATLAB's function \verb!obsvf!\index{MATLAB's function!obsvf} to efficiently solve this part of the problem. Then compute an equivalent transformation\index{equivalent transformation}\index{transformation!equivalent} relating the obtained minimal realization with the minimal realization given in Example~\ref{ex:min_realiz_ex} as shown in~\eqref{eq:min_real_equival}.
\end{exercise}


\begin{exercise}\rm Examples~\ref{ex:differentrealizsizes} and~\ref{ex:min_realiz_ex} are concerned with constructing realizations of the same transfer function matrix. Apply a dual\index{dual} version of Theorem~\ref{thm_decomp} to extract a minimal realization from the realization given in Example~\ref{ex:differentrealizsizes}. You can use MATLAB's function \verb!ctrbf!\index{MATLAB's function!ctrbf} to efficiently solve this part of the problem. Then compute an equivalent transformation relating the obtained minimal realization with the minimal realization given in Example~\ref{ex:min_realiz_ex} as shown in~\eqref{eq:min_real_equival}. Finally, construct an equivalent transformation\index{equivalent transformation}\index{transformation!equivalent} relating the obtained minimal realization in this Exercise with the minimal realization given in Exercise~\ref{exer:extarct_min_real}.
\end{exercise}

\begin{exercise}\rm
{\bf (adapted from Barnett~\cite[page~95]{barnett75})} A simple representation of a vehicle suspension\index{vehicle suspension} system is shown in Figure~\ref{fig:sdsdapl}. Assume that the forces produced by the springs and dampers act at the end points $P$ and $Q$ and $x_1$ and $x_2$ are the displacements of these points from equilibrium. The force exerted by a damper is proportional to the velocity of one end of the damper relative to the other end and the springs obey Hooke's law\index{Hooke's law}. Assume that the mass of the platform can be neglected so that the spring motions can be regarded as independent. The control force $4 u$ is applied one quarter the way along from one end of the platform. Derive the two-dimensional state space model of this simple representation of a vehicle suspension system. Next, suppose that the ends of the platform are each given an initial displacement of 10 units, find a control law that returns the platform to equilibrium at $t=1$~sec.
\begin{figure}
\centering
\includegraphics[scale=0.5]{sdsdapl.eps}
%\vspace{3in}
%\centerbmp{4in}{3in}{c:/mybook/sdsdapl.bmp}
%\hskip1.2in\special{bmp:c:/mybook/sdsdapl.bmp x=4in y=3in}
\caption{A simple representation of a vehicle suspension system of Exercise~\ref{ex:sdsdapl}.}
\label{fig:sdsdapl}
\end{figure}
\label{ex:sdsdapl}
\end{exercise}

\begin{exercise}\rm
For the dynamical system model, $\dot{\b x}=\b A\b x+\b bu$, where
\[
\b A=\left[\begin{array}{cc}
0 & 1\\
1 & 0
\end{array}\right]\quad\mb{and}\quad \b b=\left[\begin{array}{c}
0\\
1
\end{array}\right],
\]
design a state-feedback controller that stabilizes the system about the operating state corresponding to the constant input $u=2$. The desired closed-loop poles are $-2$,~$-3$.
\end{exercise}
\begin{exercise}\label{ex:frosteerve}\rm
Consider the vehicle model\index{vehicle model} given in Subsection~\ref{subs:vehmod}. Let the input signal be $u=\delta_f$---the front wheel steer angle, and $\delta_r=0$. Compute the transfer function $C(s)/U(s)$.
Plot the vehicle response $Y$ versus $X$ for $X$ changing from $0\,\mb{m}$ to $100\,\mb{m}$, when the input $\delta_f$, in the vehicle coordinates, has the form $\delta_f(t)=0.0872\,h(t)\,\mb{rad}$, where $h(t)$ is the unit step function.

Suppose now that the plot of $\delta_f$ versus time, in the car coordinates, has the form shown in Figure~\ref{fig:step2}. Note that the values of $\delta_f$ are given in $\deg$. The value of $\delta_f$ changes form $-2.5\,\deg$ to $2.5\,\deg$. In your simulations you will need to convert $\deg$ to $\mb{rad}$.
\begin{figure}
\centering
\includegraphics[scale=0.45]{steer_a.eps}
%\centering \epsfig{file=steer_a.eps,height=2.5in}
%\vspace{4in}
%\centerbmp{5.33in}{4in}{c:/tony/step2.bmp}
%\hskip.7in\special{bmp:c:/tony/step2.bmp x=5.33in y=4in}
\caption{Time history of the front steer angle in the car coordinates of Exercise~\ref{ex:frosteerve}.}
\label{fig:step2}
\end{figure}
Plot the vehicle response $Y$ versus $X$ for $X$ changing from $0\,\mb{m}$ to $100\,\mb{m}$.


Construct the state-feedback controller $u=-\b k\b x+r$ such that $\mb{eig}(\b A-\b b \b k)=\{-2,-3+j,-3-j,-4\}$. Plot $u$ and $r$ versus time, and $Y$ versus $X$, when $r=0.0872\,h(t)\,\mb{rad}$.
\end{exercise}
\begin{exercise}\rm
Show that the controllability\index{controllability!invariant under} property is invariant under the following set of transformations:
\begin{itemize}
\item[(i)] nonsingular coordinate transformation in the state-space;
\item[(ii)] nonsingular transformation of the inputs;
\item[(iii)] state feedback;
\item[(iv)] output feedback.
\end{itemize}
\end{exercise}
\begin{exercise}\rm
Given the following model of a dynamical system
\begin{eqnarray*}
\dot{\b x}(t) &=& \left[ \begin{array}{cc}
0 & 2\\
1 & 0
\end{array}
\right]\b x(t) + \left[ \begin{array}{c}
1\\
0
\end{array}
\right]u(t)\\
y(t) &=& \left[ \begin{array}{cc}
0 & 1
\end{array}
\right]\b x(t).
\end{eqnarray*}
\begin{itemize}
\item[(a)] Design a full-order asymptotic observer\index{asymptotic observer!full-order}\index{full-order!asymptotic observer} for the above system with the observer poles located at $-2$ and $-3$. Write the equations of the observer dynamics. Note that the pair $(\b A, \b c)$ is already in the observer form\index{observer form}, which should facilitate your observer design\index{observer!design}.
\item[(b)] Denote the observer state vector by $\b z$. Let $u=-\left[\begin{array}{cc}
2 & 3
\end{array}
\right]\b z + v$. Find the transfer function of the closed-loop system $Y(s)/V(s)$.
\end{itemize}

\end{exercise}
\begin{exercise}\rm
Let
\begin{eqnarray*}
\dot{\b x} &=& \b A\b x + \b b u =\left[\begin{array}{cc}
-1 & 1\\
0 & 2
\end{array}\right]\b x + \left[\begin{array}{c}
1\\
1
\end{array}\right]u,\\
y &=& \b c\b x= \left[\begin{array}{cc}
1 & 0
\end{array}\right]\b x.
\end{eqnarray*}
\begin{itemize}
\item[(a)] Find the state transformation that transforms the pair $(\b A,\b c)$ into the observer form\index{observer form}.
\item[(b)] Find the representation of the dynamical system\index{system!in new coordinates} in the new coordinates.
\end{itemize}
\end{exercise}
\begin{exercise}\rm
For the following model of a dynamical system,
\begin{eqnarray*}
\dot{\b x} &=& \left[ \begin{array}{cc}
0 & 1\\
2 & 0
\end{array}
\right]\b x + \left[ \begin{array}{c}
1\\
0
\end{array}
\right]u\\
y &=& \left[ \begin{array}{cc}
1 & 0
\end{array}
\right]\b x + 2u,
\end{eqnarray*}
\begin{itemize}
\item[(a)] design a full-order observer\index{full-order observer} with its poles located at $-3$ and $-4$. Write the equations of the observer dynamics\index{observer!dynamics};
\item[(b)] denote the observer state by $\b z$. Let $u=-\left[ \begin{array}{cc}
3 & 2
\end{array}
\right]\b z + r$. Find the transfer function, $Y(s)/R(s)$, of the closed-loop system.
\end{itemize}
\end{exercise}
\begin{exercise}\rm
Given a dynamical system modeled by:
\begin{eqnarray*}
\dot{\b x} &=& \b A \b x + \b bu\\
y &=& \b c \b x,
\end{eqnarray*}
where
\[
\b A=\left[\begin{array}{cc}
1 & -3\\
4 & 2
\end{array}\right], \quad \b b=\left[\begin{array}{c}
1\\
1
\end{array}\right], \quad \b c=\left[\begin{array}{cc}
2 & 3
\end{array}\right].
\]
\begin{itemize}
\item[(a)] Design a reduced-order observer\index{reduced-order observer}
\[
\dot{z}=dz+eu+gy,
\]
where $d=-5$ and $g=1$.
\item[(b)] Write an expression for the estimated states.
\end{itemize}
\end{exercise}
\begin{exercise}\rm
For the plant
\begin{eqnarray*}
\left[\begin{array}{c}
\dot{x}_1\\
\dot{x}_2
\end{array}\right]&=&\left[\begin{array}{cc}
1 & -1\\
1 & -2
\end{array}\right]\left[\begin{array}{c}
x_1\\
x_2
\end{array}\right]+\left[\begin{array}{c}
2\\
1
\end{array}\right]u\\
y&=&\left[\begin{array}{cc}
0&1\end{array}\right]\left[\begin{array}{c}
x_1\\
x_2
\end{array}\right],
\end{eqnarray*}
\begin{itemize}
\item[(a)] Design the reduced-order observer\index{reduced-order observer} for $\b G=[1]$ and $\b D=[-2]$.
\item[(b)] Write the equations of the estimated state in terms of the plant's output and the observer state.
\end{itemize}

\end{exercise}
\begin{exercise}\label{ex:invpenoncart}\rm
Consider a dynamical system that consists of a cart with an inverted pendulum\index{inverted pendulum!on a cart}\index{cart!with inverted pendulum} (point mass\index{point mass} on a massless shaft\index{shaft!massless}) attached to it as depicted in Figure~\ref{fig:inv_pend_cart}.
\begin{figure}[h]
\centering
\includegraphics[scale=0.55]{inv_pnd.eps}
%\vspace{4in}
%\centerbmp{4in}{3in}{c:/mybook/inv_pnd.bmp}
\caption{An inverted pendulum moving on a cart of Exercise~\ref{ex:invpenoncart}.}
\label{fig:inv_pend_cart}
\end{figure}
\begin{itemize}
\item[\bf{(i)}] Obtain a nonlinear state-space of the system using the state variables
\[
x_1=x,\quad x_2=\dot{x},\quad x_3=\theta,\quad x_4=\dot{\theta}.
\]
Designate $x_1$ as the system output.
\item[\bf{(ii)}] Linearize the model about the operating point $\b x=\b 0$, $u=0$.
\item[\bf{(iii)}] Design a state feedback control law $u=-\b k\b x$ such that the closed-loop poles are located at
\[
-1, -2, -1\pm j
\]
\item[\bf{(iv)}] Write a simple MATLAB script\index{MATLAB!script} that animates the motion of the linearized closed-loop model of the inverted pendulum on the cart along with animation of the displacement $x$ and the angle $\theta$ data. The basic handle graphics of MATLAB\index{MATLAB!handle graphics}\index{handle graphics!MATLAB}\index{handle graphics!animation}\index{animationhandle graphics} can be used to write the script. A script contained in Example~4 in the book~\cite[page~208]{pratap06} can be helpful here. Alternatively, you can employ SIMULINK\index{SIMULINK}.
\end{itemize}
\end{exercise}

\begin{exercise}\label{exer:one-link_compensat}\rm
For the nonlinear model of the one-link robot manipulator\index{robot manipulator!one-link} of Subsection~\ref{subsection:one_link_robot}:
%In the derivation, assume that $L_a=100\;\mb{mH}$ and $g=9.8\;\mb{m/s}^2$. Represent the obtained third-order model in the form $\dot{\b x}=\b f(\b x,u)$, where $x_1=\theta_p$, $x_2=\dot{\theta}_p$ and $x_3=i_a$.
\begin{itemize}
\item[\bf{(a)}] Find the constant value of $u=u_{e}$ and $x_{3e}$ so that the state $\b x_{e}=\left[\begin{array}{ccc}
30 \pi/180 & 0 & x_{3e}
\end{array}\right]^{\top}$ becomes the equilibrium state\index{equilibrium state}, that is, the obtained $\b x_e$ and $u_e$ satisfy the equation
\[
\b 0=\b f(\b x_e,u_e).
\]
\item[\bf{(b)}] Linearize the nonlinear model\index{nonlinear model!robot manipulator}, $\dot{\b x}=\b f(\b x,u)$, about the operating point $\left[\begin{array}{cc}
\b x_e^{\top} & u_e
\end{array}\right]^{\top}$ to obtain
\[
\frac{d}{dt}\Delta \b x=\b A\Delta \b x+\b b\Delta u.
\]
where,
\[
\Delta \b x=\b x - \b x_e,\quad \Delta u=u-u_e ,
\]
and
\[
\b A=\frac{\partial \b f}{\partial \b x}(\b x_e, u_e)\quad\mb{and}\quad \b b= \frac{\partial \b f}{\partial u}(\b x_e, u_e).
\]
\item[\bf{(c)}] Design a state feedback\index{robot manipulator!state feedback} control law $\Delta u=-\b k\,\Delta \b x$ such that the closed-loop poles are located at
\[
-2, -2\pm j
\]
\item[\bf{(d)}] Implement the obtained control law on the nonlinear model, $\dot{\b x}=\b f(\b x,u)$. Write a MATLAB script that animates the dynamical behavior of the nonlinear closed-loop system along with animation of the angle $\theta_p$ and the input $u$ data.
\item[\bf{(e)}] Design a full-order observer for the linearized model. The observer's poles should be located at
\[
-5, -5\pm j
\]
\item[\bf{(f)}] Implement the combined controller-observer compensator\index{robot manipulator!combined controller-observer compensator} on the nonlinear model and write a MATLAB script that animates dynamic behavior of the nonlinear closed-loop system along with animation\index{animation!robot manipulator} of the angle $\theta_p$ and the input $u$ data.
\end{itemize}

\end{exercise}

\begin{exercise}\label{exer:two-link_compensat}\rm
For the nonlinear model of a double-link robot manipulator in Subsection~\ref{subsection:two_link_robot}, use the linearized model of this robot obtained in Exercise~\ref{exer:linearized_2_link} to
\begin{itemize}
\item[\bf{(a)}] design a state-feedback controller using the linearized model. Write a MATLAB script that animates the behavior of the closed-loop system comprised of the state-feedback controller driving the nonlinear model of the robot for different initial conditions;
\item[\bf{(b)}] use the linearized model to design a Luenberger observer. Implement and perform animation of the closed-loop system comprised of the combined controller-observer compensator driving the nonlinear model of the robot.
\end{itemize}
\end{exercise} 