%\setcounter{chapter}{8}
\chapter{Feedback Linearization}
In this chapter, we discuss methods that use vector fields in the control design for a class of nonlinear dynamical systems. The design process, as in the case of linear systems, involves three steps. The first step is the design of a state-feedback control law. The second step involves the design of a state estimator. The third step is to combine the first two steps to obtain a combined controller-estimator compensator.

\section{Plant Model}
Dynamic systems, that we consider in this chapter, are modeled by the equations
\begin{eqnarray}
\dot{\b x}&=&\b f(\b x)+\b G(\b x)\b u\label{eq:nonlinstsmo}\\
\b y &=& \b h(\b x)
\label{eq:nolioueq},
\end{eqnarray}
where $\b f:\mb{\Bb R}^n \to \mb{\Bb R}^n$, $\b G:\mb{\Bb R}^n \to \mb{\Bb R}^{n \times m}$, and the output map $\b h:\mb{\Bb R}^n \to \mb{\Bb R}^p$. Note that $\b G(\b x)$ may be written as $\b G(\b x)=\left[\begin{array}{cccc}
\b g_1(\b x) & \b g_2(\b x) & \cdots & \b g_m(\b x)
\end{array}\right]$ where $\b g_i:\mb{\Bb R}^n \to \mb{\Bb R}^n$, $i=1,2,\ldots,m$. We write $\b f\in {\cal C}^{\infty}$ if $\b f$ is in all ${\cal C}^k$ for $k=1,2,\ldots$. The functions $\b f$, $\b g_i$, and $\b h$ are assumed to be ${\cal C}^{\infty}$ vector fields on $\mb{\Bb R}^n$. We also assume that $\b f(\b 0)=\b 0$ and $\b h(\b 0)=\b 0$. We note that the linear system model $\dot{\b x}=\b A\b x+\b B\b u$, $\b y=\b C\b x$ is a special case of the above more general model. Indeed, we have $\b f(\b x)=\b A\b x$, $\b G(\b x)=\b B$, and $\b h(\b x)=\b C\b x$. We now give a simple example of a nonlinear dynamical system whose model fits into the above class of systems.
\begin{example}\rm
\label{ex:one_link}
The example comes from \.{Z}ak and MacCarley~\cite{zak86}. It is a simple model of a one-link robot manipulator. We will use it as a testbed for the proposed controllers throughout the chapter. The motion of the robot arm is controlled by a DC motor via a gear train as shown in Figure~\ref{fig:onelink}.
\begin{figure}
\vspace{3.5in}
\hskip1.2in\special{bmp:c:/mybook/onelink.bmp x=4.67in y=3.5in}
\caption{A diagram of a one-link manipulator controlled by a DC motor via a gear train.}
\label{fig:onelink}
\end{figure}
The DC motor is armature-controlled and its diagram is shown in Figure~\ref{fig:dcmotor}.
\begin{figure}
\vspace{3in}
\hskip1.4in\special{bmp:c:/mybook/dcmotor.bmp x=4in y=3in}
\caption{A diagram of an armature-controlled DC motor.}
\label{fig:dcmotor}
\end{figure}
We assume that the motor moment of inertia is negligible compared with that of the robot arm. We model the arm as a point mass $m$ attached to the end of a massless rod of length $l$. Hence the arm inertia is $I_a=ml^2$. We assume that the gear train has no backlash, and all connecting shafts are rigid. As can be seen from Figure~\ref{fig:onelink}, counterclockwise rotation of the arm is defined as positive and clockwise rotation as negative, while counterclockwise rotation of the motor shaft is defined to be negative, and clockwise rotation of the shaft as positive. The torque delivered by the motor is
\[
T_m=K_mi_a,
\]
where $K_m$ is the motor torque constant, and $i_a$ is the armature current. Thus, the torque applied to the pendulum is
\[
T_p=-NT_m=-NK_mi_a,
\]
where $N$ is the gear ratio. Applying Kirchhoff's voltage law to the armature circuit yields
\[
u=L_a\frac{d i_a}{dt}+Ri_a+e_b=L_a\frac{d i_a}{dt}+Ri_a+K_b N\frac{d\theta_p}{dt},
\]
where $K_b$ is the back emf constant. We use Newton's second law to write the equation modeling the pendulum dynamics. We obtain
\[
T_p=-ml^2\frac{d^2\theta_p}{dt^2}+mgl\sin \theta_p,
\]
where $g=9.8\;\mb{m}/\mb{s}^2$ is the gravitational constant. We can now construct a state-space model of the one-link robot. For this we choose the following state variables:
\[
x_1=\theta_p, \quad x_2=\frac{d\theta_p}{dt}=\omega_p,\quad x_3=i_a.
\]
Then, the model in state-space format is:
\begin{equation}
\left[\begin{array}{c}
\dot{x}_1\\
\dot{x}_2\\
\dot{x}_3
\end{array} \right] = \left[\begin{array}{c}
x_2\\
\frac{g}{l}\sin x_1+\frac{NK_m}{ml^2}x_3\\
-\frac{K_bN}{L_a}x_2-\frac{R_a}{L_a}x_3
\end{array}\right]+\left[\begin{array}{c}
0\\
0\\
\frac{1}{L_a}
\end{array}\right]u,
\label{eq:nomooolima}
\end{equation}
Reasonable parameters of the robot are: $l=1\,\mb{m}$, $m=1\,\mb{kg}$, $N=10$, $K_m=0.1\,\mb{Nm}/\mb{A}$, $K_b=0.1\,\mb{Vs}/\mb{rad}$, $R_a=1\,\Omega$, $L_a=100\,\mb{mH}$. With the above parameters the robot model takes the form:
\begin{equation}
\left[\begin{array}{c}
\dot{x}_1\\
\dot{x}_2\\
\dot{x}_3
\end{array} \right] = \left[\begin{array}{c}
x_2\\
9.8\,\sin x_1+x_3\\
-10\,x_2-10\,x_3
\end{array}\right]+\left[\begin{array}{c}
0\\
0\\
10
\end{array}\right]u.
\label{eq:nomoolinum}
\end{equation}
We assume that the output, $y$, is
\begin{equation}
y=x_1.
\label{eq:ouoonlima}
\end{equation}
\end{example}\markex

\section{Controller Form}
\label{sec:confofononl}
One of the objectives of this chapter, is to devise a method for constructing state-feedback stabilizing control laws. To construct such a law it is advantageous to work with an equivalent system model rather than with the original one. We thus first discuss a method for reducing a nonlinear system model into an equivalent form that is a generalization of the controller form known from linear system theory. In our subsequent discussion we will be using three types of {\em Lie derivatives}. They are:
\begin{enumerate}
\item Derivative of a vector field with respect to a vector field, also known as the {\em Lie bracket}.

Given the vector valued functions $\b f:\mb{\Bb R}^n \to \mb{\Bb R}^n$ and $\b g:\mb{\Bb R}^n \to \mb{\Bb R}^n$, where $\b f$ and $\b g$ are ${\cal C}^{\infty}$ vector fields. Their Lie bracket is defined as
\begin{equation}
[\b f,\b g]=\frac{\partial \b f}{\partial \b x}\b g-\frac{\partial \b g}{\partial \b x}\b f,
\label{eq:liebracde}
\end{equation}
where $\frac{\partial \b f}{\partial \b x}$ and $\frac{\partial \b g}{\partial \b x} $ are the Jacobian matrices of $\b f$ and $\b g$, respectively. Sometimes in the literature the negative of the above definition is used. For convenience we will also be using an alternative notation of the form
\begin{equation}
[\b f,\b g]=(\mb{ad}^1\b f,\b g).
\label{eq:altliebde}
\end{equation}
We define
\[
(\mb{ad}^k\b f,\b g)=[\b f,(\mb{ad}^{k-1}\b f,\b g)],
\]
where
\[
(\mb{ad}^0\b f,\b g)=\b g.
\]
For a single input linear system model, $\b f(\b x)=\b A\b x$ and $\b g(\b x)=\b b$. Hence,
\begin{eqnarray*}
(\mb{ad}^0\b f,\b g) &=& \b b\\
(\mb{ad}^1\b f,\b g) &=& \b A\b b\\
{}&\vdots{}\\
(\mb{ad}^k\b f,\b g) &=& \b A^k\b b.
\end{eqnarray*}
Thus, the controllability matrix of the linear system can be expressed in terms of Lie brackets as
\[
\left[\begin{array}{cccc}
\b b, & \b A\b b,&\ldots, & \b A^{n-1}\b b
\end{array}\right]=\left[\begin{array}{cccc}
(\mb{ad}^0\b f,\b g), & (\mb{ad}^1\b f,\b g),&\ldots, & (\mb{ad}^{n-1}\b f,\b g)
\end{array}\right].
\]
We will call the $n\times n$ matrix
\begin{equation}
\left[\begin{array}{cccc}
(\mb{ad}^0\b f,\b g), & (\mb{ad}^1\b f,\b g),&\ldots, & (\mb{ad}^{n-1}\b f,\b g)
\end{array}\right],
\label{eq:contrmasi}
\end{equation}
the controllability matrix of the single input nonlinear system modeled by
\begin{equation}
\dot{\b x}=\b f(\b x)+\b g(\b x)\b u.
\label{eq:sinosywo}
\end{equation}
\item Derivative of a function with respect to a vector field.

Let $h:\mb{\Bb R}^n \to \mb{\Bb R}$ be a ${\cal C}^{\infty}$ function on $\mb{\Bb R}^n$. Let $Dh=\nabla^T h$, where $\nabla h$ is the gradient (a column vector) of $h$ with respect to $\b x$. Then, the Lie derivative of the function $h$ with respect to the vector field $\b f$, denoted by $L_{\b f}h$ or $L_{\b f}(h)$, is defined as
\[
L_{\b f}h=L_{\b f}(h)=\langle \nabla h,\b f \rangle=Dh\,\b f=\frac{\partial h}{\partial x_1}f_1+\frac{\partial h}{\partial x_2}f_2+\cdots+\frac{\partial h}{\partial x_n}f_n.
\]
We use the following notation:
\begin{eqnarray*}
L_{\b f}^0 h &=& h\\
L_{\b f}^1 h &=& L_{\b f}h\\
L_{\b f}^2 h&=& L_{\b f}L_{\b f}h\\
{}&\vdots&{}\\
L_{\b f}^k h&=& L_{\b f}L_{\b f}^{k-1}h.
\end{eqnarray*}
\item Derivative of $Dh$ with respect to the vector field.

The Lie derivative of $Dh$ with respect to the vector field $\b f$, denoted $L_{\b f}(Dh)$, is defined as
\begin{equation}
L_{\b f}(Dh)=\left( \frac{\partial \nabla h}{\partial x}\b f\right)^T+Dh\frac{\partial \b f}{\partial x}.
\label{eq:lideofdhwf}
\end{equation}
Note that
\begin{equation}
L_{\b f}(Dh)=DL_{\b f}h=\nabla^TL_{\b f}h.
\label{eq:impproofdhf}
\end{equation}
\end{enumerate}
The above three Lie derivatives satisfy the {\em Leibniz formula\/},
\begin{equation}
\fbox{$\displaystyle L_{[\b f,\b g]}h=\langle \nabla h,[\b f,\b g]\rangle = L_{\b g}L_{\b f}h-L_{\b f}L_{\b g}h $}
\label{eq:lebniform}
\end{equation}

Our goal now is to construct a ${\cal C}^{\infty}$ state variable transformation
\[
\b z=\b T(\b x),\quad \b T(\b 0)=\b 0,
\]
for which there is a ${\cal C}^{\infty}$ inverse $\b x={\b T}^{-1}(\b z)$, such that system model $\dot{\b x}=\b f(\b x)+\b g(\b x)u$ in the new coordinates has the form
\begin{equation}
\left[\begin{array}{c}
\dot{z}_1\\
\dot{z}_2\\
\vdots\\
\dot{z}_{n-1}\\
\dot{z}_n
\end{array}\right]=\left[\begin{array}{c}
{z}_2\\
{z}_3\\
\vdots\\
{z}_{n}\\
\tilde{f}_n(z_1,z_2,\ldots,z_n)
\end{array}\right]+\left[\begin{array}{c}
0\\
0\\
\vdots\\
0\\
1
\end{array}\right]u.
\label{eq:contrfosi}
\end{equation}
A ${\cal C}^{\infty}$ transformation $\b z=\b T(\b x)$ such that $\b T(\b 0)=\b 0$ and for which there is a ${\cal C}^{\infty}$ inverse $\b x={\b T}^{-1}(\b z)$ is called a {\em diffeomorphism\/}. We now derive a method for constructing the desired transformation. Suppose that such a transformation exists. Differentiating $\b z(t)$ with respect to time $t$ gives
\begin{equation}
\dot{\b z}(t) = \frac{\partial \b T}{\partial \b x}\dot{\b x}
= \frac{\partial \b T}{\partial \b x}\left( \b f(\b x)+\b g(\b x)u \right).
\label{eq:zdotxadot}
\end{equation}
Comparing the right hand sides of~(\ref{eq:contrfosi}) and~(\ref{eq:zdotxadot}), we obtain
\begin{equation}
\left.\frac{\partial \b T}{\partial \b x}\b f (\b x)\right\arrowvert_{\b x={\b T}^{-1}(\b z)}=\left[\begin{array}{c}
{z}_2\\
{z}_3\\
\vdots\\
{z}_{n}\\
\tilde{f}_n(z_1,z_2,\ldots,z_n)
\end{array}\right],
\label{eq:firpaofzdo}
\end{equation}
and
\begin{equation}
\left.\frac{\partial \b T}{\partial \b x}\b g (\b x)\right\arrowvert_{\b x={\b T}^{-1}(\b z)}=\left[\begin{array}{c}
0\\
0\\
\vdots\\
0\\
1
\end{array}\right].
\label{eq:secopaofzd}
\end{equation}
We first consider~(\ref{eq:firpaofzdo}). We have
\[
\left[\begin{array}{c}
{z}_2\\
{z}_3\\
\vdots\\
{z}_{n}\\
\tilde{f}_n(z_1,z_2,\ldots,z_n)
\end{array}\right]=\left[\begin{array}{c}
{T}_2\\
{T}_3\\
\vdots\\
{T}_{n}\\
\tilde{f}_n(z_1,z_2,\ldots,z_n)
\end{array}\right]
\]
because $\b z=\b T(\b x)$. We conclude that
\[
\frac{\partial T_i}{\partial \b x}\b f(\b x)=T_{i+1},\quad i=1,2,\ldots,n-1,
\]
or equivalently
\[
T_{i+1}=L_{\b f}T_i,\quad i=1,2,\ldots,n-1.
\]
Therefore, the transformation $\b z=\b T(\b x)$ has the form
\begin{equation}
\b T=\left[\begin{array}{c}
T_1\\
L_{\b f}T_1\\
\vdots\\
L_{\b f}^{n-2}T_1\\
L_{\b f}^{n-1}T_1
\end{array}\right].
\label{eq:tratafuofx}
\end{equation}
The above means that the problem of constructing the desired transformation $\b z=\b T(\b x)$ is reduced to finding its first component $T_1$. The remaining components of $\b T$ can be successively computed using $T_1$. To specify $T_1$, we use~(\ref{eq:secopaofzd}), which we represent componentwise as
\[
L_{\b g}T_i=0,\quad i=1,2,\ldots,n-1,
\]
and
\[
L_{\b g}T_n=1.
\]
Note that $L_{\b g}T_1=0$ can be represented as
\[
\frac{\partial T_1}{\partial \b x}(\mb{ad}^0\b f,\b g)=0.
\]
Next, consider the relation $L_{\b g}T_2=0$. We will show that
\begin{equation}
L_{\b g}T_2=\frac{\partial T_1}{\partial \b x}(\mb{ad}^1\b f,\b g)=0.
\label{eq:secldefcf}
\end{equation}
By the Leibniz formula,
\begin{eqnarray}
L_{\b g}T_2 &=& L_{\b g}L_{\b f}T_1\nonumber\\
&=& L_{\b f}L_{\b g}T_1+L_{[\b f,\b g]}T_1\nonumber\\
&=& L_{[\b f,\b g]}T_1,
\label{eq:reofleifor}
\end{eqnarray}
because $L_{\b g}T_1=0$, and hence $L_{\b f}L_{\b g}T_1=0$. Using~(\ref{eq:reofleifor}), we obtain~(\ref{eq:secldefcf}). Continuing in this manner, we get
\[
\frac{\partial T_1}{\partial \b x}(\mb{ad}^i\b f,\b g)=0,\quad i=0,1,\ldots,n-2,
\]
and
\[
\frac{\partial T_1}{\partial \b x}(\mb{ad}^{n-1}\b f,\b g)=1.
\]
We represent the above $n$ equations in matrix form as
\begin{eqnarray*}
{}&{}&\frac{\partial T_1}{\partial \b x}\left[\begin{array}{cccc}
(\mb{ad}^0\b f,\b g),& (\mb{ad}^1\b f,\b g),&\ldots,&(\mb{ad}^{n-1}\b f,\b g)
\end{array}\right]\\
&=&\left[\begin{array}{cccc}
L_{\b g}T_1,& L_{(\mb{ad}^1\b f,\b g)}T_1,&\ldots,&L_{(\mb{ad}^{n-1}\b f,\b g)}T_1
\end{array}\right]\\
&=&\left[\begin{array}{cccc}
0 & 0 & \cdots & 1
\end{array}\right].
\end{eqnarray*}
Thus the derivative of $T_1$, that is, the row vector $\frac{\partial T_1}{\partial \b x}$, is the last row of the inverse of the controllability matrix, provided the controllability matrix is invertible. We denote the last row of the inverse of the controllability matrix by $\b q(\b x)$. Then, the problem we have to solve is to find $T_1:\mb{\Bb R}^n \to \mb{\Bb R}$ such that
\begin{equation}
\frac{\partial T_1(\b x)}{\partial \b x}=\b q(\b x),\quad T_1(\b 0)=0,
\label{eq:solvfoqwzic}
\end{equation}
or equivalently
\begin{equation}
\nabla T_1=\b q^T(\b x),\quad T_1(\b 0)=0.
\label{eq:eqreofsofqwoic}
\end{equation}
The above problem can be viewed as finding a potential function $T_1$ for a given vector field $\b q^T$. A necessary and sufficient condition for a given vector field to have a potential function is given by Theorem~\ref{thm:nascfopofu} on page~\pageref{thm:nascfopofu}. We will show that if $\b q^T$ has a potential function, then the resulting state variable transformation is a diffeomorphism. Before we proceed with the proof, we first illustrate the results obtained so far with a numerical example.
\begin{example}\rm
Consider the nonlinear system model from Example~\ref{ex:one_link}. The controllability matrix of this system model is
\[
\left[\begin{array}{ccc}
(\mb{ad}^0\b f,\b g),& (\mb{ad}^1\b f,\b g),&(\mb{ad}^{2}\b f,\b g)
\end{array}\right]=\left[\begin{array}{ccc}
0 & 0 & 10 \\
0 & 10 & -100 \\
10 & -100 & 900 
\end{array}\right].
\]
The above controllability matrix is of full rank on $\mb{\Bb R}^3$. The last row of its inverse is
\[
\b q=\left[\begin{array}{ccc}
0.1 & 0 & 0
\end{array}\right].
\]
Hence,
\[
T_1=0.1\,x_1.
\]
Having obtained $T_1$, we construct the desired transformation $\b z=\b T(\b x)$, where
\[
\b T(\b x)=\left[\begin{array}{c}
T_1\\
L_{\b f}T_1\\
L_{\b f}\left(L_{\b f}T_1\right)
\end{array}\right]=\left[\begin{array}{c}
0.1\,x_1\\
0.1\,x_2\\
0.98\sin x_1+0.1x_3
\end{array}\right].
\]
Note that the inverse transformation $\b x={\b T}^{-1}(\b z)$ exists and has the form
\[
{\b T}^{-1}(\b z)=\left[\begin{array}{c}
10\,z_1\\
10\,z_2\\
10z_3-9.8\sin (10\,z_1)
\end{array}\right].
\]
Furthermore,
\[
\frac{\partial \b T}{\partial \b x}=\left[\begin{array}{ccc}
0.1 & 0 & 0\\
0 & 0.1 & 0\\
0.98\cos x_1 & 0 & 0.1
\end{array}\right].
\]
Applying the transformation $\b z=\b T(\b x)$ to the model of the one-link robot manipulator yields
\begin{eqnarray}
\dot{\b z} &=& \left.\frac{\partial \b T}{\partial \b x} \b f(\b x)\right\arrowvert_{\b x={\b T}^{-1}(\b z)}+\left.\frac{\partial \b T}{\partial \b x}\b g(\b x)\right\arrowvert_{\b x={\b T}^{-1}(\b z)}u\nonumber\\
&=& \left[\begin{array}{c}
z_2 \\
z_3 \\
9.8\sin (10z_1)+\left( 9.8\cos (10z_1)-10\right)z_2 - 10 z_3 
\end{array}\right]+\left[\begin{array}{c}
0 \\
0 \\
1 
\end{array}\right]u.
\label{eq:onliincofo}
\end{eqnarray}
\end{example}\markex

We will now show that if there is a potential function for $\b q^T(\b x)$, then the resulting transformation is indeed a diffeomorphism. By construction $\b T$ is of ${\cal C}^{\infty}$ class, and $\b T(\b 0)=\b 0$. We now show that $\b T$ is locally ${\cal C}^{\infty}$-invertible. By the Inverse Function Theorem, stated on page~\pageref{thm:meavalthfmap}, if the Jacobian matrix of $\b T$ evaluated at $\b 0$ is invertible, then $\b T$ is locally ${\cal C}^{\infty}$-invertible. The Jacobian matrix of $\b T$ is
\[
D\b T=\left[\begin{array}{c}
DT_1\\
DL_{\b f}T_1\\
\vdots\\
DL_{\b f}^{n-2}T_1\\
DL_{\b f}^{n-1}T_1
\end{array}\right].
\]
We compute the product of the above Jacobian matrix and the controllability matrix
\[
\left[\begin{array}{cccc}
(\mb{ad}^0\b f,\b g), & (\mb{ad}^1\b f,\b g),&\ldots, & (\mb{ad}^{n-1}\b f,\b g)
\end{array}\right]
\]
to get
\[
\left[\begin{array}{c}
DT_1\\
DL_{\b f}T_1\\
\vdots\\
DL_{\b f}^{n-2}T_1\\
DL_{\b f}^{n-1}T_1
\end{array}\right] \left[\begin{array}{cccc}
(\mb{ad}^0\b f,\b g), & (\mb{ad}^1\b f,\b g),&\ldots, & (\mb{ad}^{n-1}\b f,\b g)
\end{array}\right].
\]
Performing multiplications yields
\begin{eqnarray*}
{}&{}&D\b T\left[\begin{array}{cccc}
(\mb{ad}^0\b f,\b g), & (\mb{ad}^1\b f,\b g),&\ldots, & (\mb{ad}^{n-1}\b f,\b g)
\end{array}\right]\\
&{}&\qquad =\left[\begin{array}{cccc}
L_{\b g}T_1, & L_{(\mb{ad}^1\b f,\b g)}T_1,&\ldots, & L_{(\mb{ad}^{n-1}\b f,\b g)}T_1\\
L_{\b g}L_{\b f}T_1, & L_{(\mb{ad}^1\b f,\b g)}L_{\b f}T_1,&\ldots, & L_{(\mb{ad}^{n-1}\b f,\b g)}L_{\b f}T_1\\
\vdots & \vdots & {} & \vdots\\
L_{\b g}L_{\b f}^{n-1}T_1, & L_{(\mb{ad}^1\b f,\b g)}L_{\b f}^{n-1}T_1,&\ldots, & L_{(\mb{ad}^{n-1}\b f,\b g)}L_{\b f}^{n-1}T_1
\end{array}\right]\\
&{}&\qquad =\left[\begin{array}{cccc}
L_{\b g}T_1, & L_{(\mb{ad}^1\b f,\b g)}T_1,&\ldots, & L_{(\mb{ad}^{n-1}\b f,\b g)}T_1\\
L_{\b g}T_2, & L_{(\mb{ad}^1\b f,\b g)}T_2,&\ldots, & L_{(\mb{ad}^{n-1}\b f,\b g)}T_2\\
\vdots & \vdots & {} & \vdots\\
L_{\b g}T_n, & L_{(\mb{ad}^1\b f,\b g)}T_n,&\ldots, & L_{(\mb{ad}^{n-1}\b f,\b g)}T_n
\end{array}\right]\\
&{}&\qquad =\left[\begin{array}{cccc}
L_{\b g}T_1, & L_{(\mb{ad}^1\b f,\b g)}T_1,&\ldots, & L_{(\mb{ad}^{n-1}\b f,\b g)}T_1\\
L_{(\mb{ad}^1\b f,\b g)}T_1,&L_{(\mb{ad}^2\b f,\b g)}T_1, &\ldots, & L_{(\mb{ad}^{n}\b f,\b g)}T_1\\
\vdots & \vdots & {} & \vdots\\
L_{(\mb{ad}^{n-1}\b f,\b g)}T_1,&L_{(\mb{ad}^n\b f,\b g)}T_1, &\ldots, & L_{(\mb{ad}^{2n-2}\b f,\b g)}T_1
\end{array}\right]\\
&{}&\qquad =\left[\begin{array}{ccccc}
0, & 0, & \ldots,&0,& 1\\
0, & 0, & \ldots,&1,&x\\
\vdots & \vdots & {} & \vdots&\vdots\\
1,& x,& \ldots,& x,&x
\end{array}\right],
\end{eqnarray*}
where we use $x$ to denote ``don't care'' elements. It follows from the above that at $\b x =\b 0$ the Jacobian matrix $D\b T$ is invertible, that is,
\[
\mb{rank}\,D\b T(\b 0)=n.
\]
In conclusion, a diffeomorphic state variable transformation exists, in a neighborhood of $\b x=\b 0$, if
\begin{enumerate}
\item in a neighborhood of $\b x=\b 0$,
\[
\mb{rank}\left[\begin{array}{cccc}
(\mb{ad}^0\b f,\b g), & (\mb{ad}^1\b f,\b g),&\ldots, & (\mb{ad}^{n-1}\b f,\b g)
\end{array}\right]=n,
\]
\item \[\b q(\b x)=\left[\begin{array}{ccccc}
0, & 0,& \ldots,&0,&1
\end{array}\right]\left[\begin{array}{cccc}
(\mb{ad}^0\b f,\b g), & (\mb{ad}^1\b f,\b g),&\ldots, & (\mb{ad}^{n-1}\b f,\b g)
\end{array}\right]^{-1}\] has a potential function in a neighborhood of $\b x=\b 0$, that is, $\b q^T(\b x)$ is a conservative vector field in a neighborhood of $\b x=\b 0$.
\end{enumerate}

The above method of transforming a class of single input nonlinear systems into the controller form can be generalized to multi input systems in a similar way as in the linear case discussed in Subsection~\ref{subsec:controform}. We will illustrate the method with a numerical example.
\begin{example}\rm
Consider the model of the permanent stepper motor given by~(\ref{eq:nomoopmstep}). We first represent the model as
\begin{equation}
\dot{\b x}=\b f(\b x)+\b g_1 u_1 + \b g_2 u_2,
\label{eq:twoinrepopm}
\end{equation}
where
\[
\b f(\b x)=\left[\begin{array}{c}
x_2\\
-K_1x_2-K_2x_3\sin(K_3x_1)+K_2x_4\cos(K_3x_1)\\
K_4x_2\sin(K_3x_1)-K_5x_3\\
-K_4x_2\cos(K_3x_1)-K_5x_4
\end{array}\right],\; \b g_1=\left[\begin{array}{c}
0 \\
0 \\
1 \\
0 
\end{array}\right],\;\mb{and}\; \b g_2=\left[\begin{array}{c}
0\\
0\\
0\\
1
\end{array}\right].
\]
We next form the controllability matrix for the above model to get
\begin{equation}
\left[\begin{array}{cccccccc}
\b g_1&\b g_2&\left( \mb{ad}^1\b f,\b g_1\right)&\left(\mb{ad}^1\b f,\b g_2\right)&\left(\mb{ad}^2\b f,\b g_1\right)&\left(\mb{ad}^2\b f,\b g_2\right)&\left(\mb{ad}^3\b f,\b g_1\right)&\left(\mb{ad}^3\b f,\b g_2\right)
\end{array}\right],
\label{eq:comafopmsm}
\end{equation}
where, for example,
\[
\left( \mb{ad}^1\b f,\b g_1\right)=\left[\begin{array}{c}
0\\
-K_2\sin(K_3 x_1)\\
-K_5\\
0
\end{array}\right],\quad \left( \mb{ad}^1\b f,\b g_2\right)=\left[\begin{array}{c}
0\\
K_2\cos(K_3 x_1)\\
0\\
-K_5
\end{array}\right],
\]
\begin{eqnarray}
{}&{}&\left( \mb{ad}^2\b f,\b g_1\right)\nonumber\\
&{}&\qquad =\left[ \b f,\left(\mb{ad}^1\b f,\b g_1\right)\right] =\frac{\partial \b f}{\partial \b x}\left(\mb{ad}^1\b f,\b g_1\right)-\frac{\partial \left(\mb{ad}^1\b f,\b g_1\right)}{\partial \b x}\b f\nonumber\\
&{}&\qquad =\left [\begin {array}{c} -{K_2}\,\sin({K_3}\,{x_1})
\\\noalign{\medskip}{K_1}\,{K_2}\,\sin({K_3}\,{x_1})+{ 
K_2}\,{K_5}\,\sin({K_3}\,{x_1})+{K_2}\,{K_3}\,{x_2}\,\cos({K_3}\,{x_1
})\\\noalign{\medskip}-{K_4}\,{K_2}\,\sin^2({K_3}\,{
x_1})+{K_5}^{2}\\\noalign{\medskip}{K_4}\,{K_2}\cos({
K_3}\,{x_1})\,\sin({K_3}\,{x_1})\end {array}
\right ],
\label{eq:adtwfgo}
\end{eqnarray}
and
\begin{eqnarray}
{}&{}&\left( \mb{ad}^2\b f,\b g_2\right)\nonumber\\
&{}&\qquad =\left[ \b f,\left(\mb{ad}^1\b f,\b g_2\right)\right] =\frac{\partial \b f}{\partial \b x}\left(\mb{ad}^1\b f,\b g_2\right)-\frac{\partial \left(\mb{ad}^1\b f,\b g_2\right)}{\partial \b x}\b f\nonumber\\
&{}&\qquad =\left [\begin {array}{c} {K_2}\,\cos({K_3}\,{x_1})
\\\noalign{\medskip}-{K_1}\,{K_2}\,\cos({K_3}\,{x_1})-{ 
K_2}\,{K_5}\,\cos({K_3}\,{x_1})+{K_2}\,{K_3}\,{x_2}\,\sin({K_3}\,{x_1
})\\\noalign{\medskip}{K_4}\,{K_2}\cos({
K_3}\,{x_1})\,\sin({K_3}\,{x_1})\\\noalign{\medskip}-{K_4}\,{K_2}\,\cos^2({K_3}\,{
x_1})+{K_5}^{2}\end {array}
\right ].
\label{eq:adtwfgtw}
\end{eqnarray}
Observe that
\begin{equation}
\left(\mb{ad}^1\b f,\b g_2\right)=-K_5\cot(K_3\,x_1)\,\b g_1-K_5\,\b g_2-\cot(K_3\,x_1)\left(\mb{ad}^1\b f,\b g_1\right).
\label{eq:lideofadfgt}
\end{equation}
Proceeding from left to right and using~(\ref{eq:lideofadfgt}), we select linearly independent columns from the controllability matrix~(\ref{eq:comafopmsm}). The PM stepper motor system is controllable since we have found four linearly independent columns, $\b g_1$, $\left(\mb{ad}^1\b f,\b g_1\right)$, $\left(\mb{ad}^2\b f,\b g_1\right)$, and $\b g_2$ in its controllability matrix. Thus, the controllability indices of the PM stepper motor system are $d_1=3$ and $d_2=1$. Therefore, the controller form of the PM stepper motor model is
\begin{equation}
\left[\begin{array}{c}
\dot{z}_1\\
\dot{z}_2\\
\dot{z}_3\\
\dot{z}_4
\end{array}\right]=\left[\begin{array}{c}
{z}_2\\
{z}_3\\
\tilde{f}_3(z_1,z_2,z_3,z_4)\\
\tilde{f}_4(z_1,z_2,z_3,z_4)
\end{array}\right]+\left[\begin{array}{cc}
0 & 0\\
0 & 0\\
\tilde{g}_{31} &\tilde{g}_{32}\\
\tilde{g}_{41}& \tilde{g}_{42}
\end{array}\right]\left[\begin{array}{c}
u_1\\
u_2
\end{array}\right],
\label{eq:pmstemoincofo}
\end{equation}
where the elements $\tilde{g}_{ij}$ may depend on $z_k$, $k=1,2,3,4$, and
\begin{equation}
\det\,\left[\begin{array}{cc}
\tilde{g}_{31} &\tilde{g}_{32}\\
\tilde{g}_{41}& \tilde{g}_{42}
\end{array}\right]\ne 0.
\label{eq:nodeoltrim}
\end{equation}
The transformation we are looking for has the form,
\begin{equation}
\b z=\b T(\b x)=\left[\begin{array}{c}
T_1\\
T_2\\
T_3\\
T_4
\end{array}\right]=\left[\begin{array}{c}
T_1\\
L_{\b f}T_1\\
L_{\b f}^2 T_1\\
T_4
\end{array}\right],
\label{eq:traofpmsm}
\end{equation}
where $T_1$ and $T_4$ are functions that we have to find. There is no unique solution for $T_1$ and $T_4$. Differentiating $\b z=\b T(\b x)$ and using~(\ref{eq:twoinrepopm}) yields
\begin{eqnarray}
\dot{\b z}&=&\frac{\partial \b T}{\partial \b x}\dot{\b x}\nonumber\\
&=&\left.\frac{\partial \b T}{\partial \b x}\b f (\b x)\right\arrowvert_{\b x={\b T}^{-1}(\b z)}+u_1\left.\frac{\partial \b T}{\partial \b x}\b g_1 (\b x)\right\arrowvert_{\b x={\b T}^{-1}(\b z)}+u_2\left.\frac{\partial \b T}{\partial \b x}\b g_2 (\b x)\right\arrowvert_{\b x={\b T}^{-1}(\b z)}
\label{eq:derofzwitwi}
\end{eqnarray}
where
\[
\frac{\partial \b T}{\partial \b x}=D\b T=\left[\begin{array}{c}
DT_1\\
DT_2\\
DT_3\\
DT_4
\end{array}\right].
\]
Comparing~(\ref{eq:pmstemoincofo}) and~(\ref{eq:derofzwitwi}), we obtain
\begin{equation}
z_2=T_2=DT_1 \b f =L_{\b f}T_1,\quad z_3=T_3=DT_2 \b f=L_{\b f}T_2,
\label{eq:relbetzafi}
\end{equation}
and
\begin{eqnarray}
{}&{}& L_{\b g_1}T_1=0,\quad L_{\b g_1}T_2=L_{\b g_1}L_{\b f}T_1=0,\label{eq:derfogone}\\
&{}& L_{\b g_2}T_1=0,\quad L_{\b g_2}T_2=L_{\b g_2}L_{\b f}T_1=0.\label{eq:lderfogt}
\label{eq:relsfoing}
\end{eqnarray}
Applying the Leibniz formula~(\ref{eq:lebniform}) to the right hand sides of~(\ref{eq:derfogone}) and~(\ref{eq:lderfogt}) gives
\[
L_{\b f}L_{\b g_1}T_1=L_{[\b f,\b g_1]}T_1,
\]
and
\[
L_{\b f}L_{\b g_2}T_1=L_{[\b f,\b g_2]}T_1.
\]
Since, by~(\ref{eq:derfogone}) and~(\ref{eq:lderfogt}), $L_{\b g_1}T_1=0$ and $L_{\b g_2}T_1=0$, therefore we can write
\begin{equation}
D T_1 \left[\begin{array}{cccc}
\b g_1 & \left( \mb{ad}^1\b f,\b g_1\right) & \b g_2 & \left( \mb{ad}^1\b f,\b g_1\right)
\end{array}\right]=\b 0,
\label{eq:getalltog}
\end{equation}
that is,
\[
\left[\begin{array}{cccc}
\frac{\partial T_1}{\partial x_1}&\frac{\partial T_1}{\partial x_2}&\frac{\partial T_1}{\partial x_3}&\frac{\partial T_1}{\partial x_4}
\end{array}\right]
\left[\begin{array}{cccc}
0 & 0 & 0 & 0\\
0 & -K_2\sin(K_3x_1) & 0 & K_2 \cos(K_3 x_1)\\
1 & -K_5 & 0 &0\\
0 & 0 & 1 & -K_5
\end{array}\right]=\left[\begin{array}{cccc}
0 & 0 & 0 & 0
\end{array}\right].
\]
By inspection, a nontrivial solution to the above is
\begin{equation}
D T_1 =\left[\begin{array}{cccc}
\frac{\partial T_1}{\partial x_1}&0&0&0
\end{array}\right],
\label{eq:nosotofone}
\end{equation}
where the function $T_1$  may only be a function of $x_1$ for $D T_1$ to be integrable. We will specify $T_1$ later. To proceed, we note that by~(\ref{eq:traofpmsm}) and~(\ref{eq:derofzwitwi}),
\begin{equation}
\left[\begin{array}{cc}
\tilde{g}_{31} &\tilde{g}_{32}\\
\tilde{g}_{41}& \tilde{g}_{42}
\end{array}\right]=\left[\begin{array}{cc}
\left(D T_3\right) \b g_1 &\left(D T_3\right)\b g_2\\
\left( D T_4\right)\b g_1& \left( D T_4\right)\b g_2
\end{array}\right],
\label{eq:expsfoinma}
\end{equation}
Using the structure of the state transformation~(\ref{eq:traofpmsm}) and the Leibniz formula~(\ref{eq:lebniform}), we express the element $\tilde{g}_{31}=\left( D T_3\right)\b g_1$ as
\begin{eqnarray}
\left( D T_3\right)\b g_1&=&L_{\b g_1}L_{\b f}T_2\nonumber \\
&=& L_{[\b f,\b g_1]}T_2 + L_{\b f}L_{\b g_1}T_2\nonumber\\
&=& L_{[\b f,\b g_1]}T_2,
\label{exprgtoaf}
\end{eqnarray}
since $L_{\b g_1}T_2=0$ and therefore $L_{\b f}L_{\b g_1}T_2=0$. Observing that $T_2=L_{\b f}T_1$, employing the Leibniz formula, and taking into account the fact that $L_{\b g_1}T_1=0$, we get
\begin{eqnarray}
L_{[\b f,\b g_1]}T_2&=&L_{[\b f,\b g_1]}L_{\b f}T_1\nonumber\\
&=& L_{[\b f,[\b f,\b g_1]]}T_1+L_{\b f}L_{\b f}T_1\nonumber\\
&=& L_{[\b f,[\b f,\b g_1]]}T_1\nonumber\\
&=& D T_1\left( \mb{ad}^2\b f,\b g_1\right).
\label{eq:suexfttia}
\end{eqnarray}
Hence,
\begin{equation}
\tilde{g}_{31}=D T_1\left( \mb{ad}^2\b f,\b g_1\right).
\label{eq:exfgtoadt}
\end{equation}
Similarly, we find
\begin{equation}
\tilde{g}_{32}=D T_1\left( \mb{ad}^2\b f,\b g_2\right).
\label{eq:exfgttadt}
\end{equation}
Substituting~(\ref{eq:adtwfgo}), (\ref{eq:adtwfgtw}), and~(\ref{eq:nosotofone}) into~(\ref{eq:exfgtoadt}) and~(\ref{eq:exfgttadt}), we find
\begin{equation}
\tilde{g}_{31}=-\frac{\partial T_1}{\partial x_1}K_2\,\sin(K_3 x_1),
\label{eq:compgtro}
\end{equation}
and
\begin{equation}
\tilde{g}_{32}=\frac{\partial T_1}{\partial x_1}K_2\,\cos(K_3 x_1).
\label{eq:compgtrto}
\end{equation}
Substituting the above expressions into~(\ref{eq:nodeoltrim}) yields
\begin{eqnarray}
\tilde{g}_{31}\tilde{g}_{42}-\tilde{g}_{32}\tilde{g}_{41}&=&\left(D T_1\left( \mb{ad}^2\b f,\b g_1\right)\right)\left(\left( D T_4\right)\b g_2\right)-\left(D T_1\left( \mb{ad}^2\b f,\b g_2\right)\right)\left(\left( D T_4\right)\b g_1\right)\nonumber\\
&=&-\frac{\partial T_1}{\partial x_1}K_2\,\sin(K_3 x_1)\frac{\partial T_4}{\partial x_4}-\frac{\partial T_1}{\partial x_1}K_2\,\cos(K_3 x_1)\frac{\partial T_4}{\partial x_3}\nonumber\\
&\ne& 0.
\label{eq:nosininma}
\end{eqnarray}
Suppose that we choose
\begin{equation}
\frac{\partial T_1}{\partial x_1}=\frac{1}{K_2},\quad \frac{\partial T_4}{\partial x_3}=\cos(K_3x_1),\quad\mb{and}\quad\frac{\partial T_4}{\partial x_4}=\sin(K_3x_1).
\label{eq:makingdemo}
\end{equation}
Substituting~(\ref{eq:makingdemo}) into~(\ref{eq:nosininma}) gives
\[
\det\,\left[\begin{array}{cc}
\tilde{g}_{31} &\tilde{g}_{32}\\
\tilde{g}_{41}& \tilde{g}_{42}
\end{array}\right]=-1.
\]
Using~(\ref{eq:nosotofone}), (\ref{eq:makingdemo}), and~(\ref{eq:traofpmsm}), we obtain
\begin{equation}
\left.\begin{array}{ccl}
T_1 &=& x_1/K_2\\
T_2&=&L_{\b f}T_1=x_2/K_2\\
T_3&=&L_{\b f}T_2 = -\frac{K_1}{K_2}x_2-x_3\sin(K_3 x_1)+x_4\cos(K_3 x_1)\\
T_4&=& x_3\,\cos(K_3 x_1)+x_4\,\sin(K_3 x_1)
\end{array}\right\}
\label{eq:expefotrt}
\end{equation}
The Jacobian matrix of $\b T$ is
\begin{equation}
D\b T=\left[\begin{array}{cccc}
1/K_2 & 0 & 0 & 0\\
0 & 1/K_2 & 0 & 0\\
-K_3 x_3\,\cos(K_3 x_1)-K_3 x_4\,\sin(K_3 x_1) & -K_1/K_2 & -\sin(K_3 x_1) & \cos(K_3 x_1)\\
-K_3 x_3\,\sin(K_3 x_1)+K_3 x_4\,\cos(K_3 x_1)&0& \cos(K_3 x_1) & \sin(K_3 x_1)
\end{array}\right]
\label{eq:jacooftb}
\end{equation}
We have
\begin{equation}
\b T(\b 0)=\b 0\quad \mb{and}\quad \det\, D \b T =-1/K_2^2 \ne 0\quad\mb{for all}\quad \b x\in \mb{\Bb R}^4,
\label{eq:globtransc}
\end{equation}
which means that we were able to find a global transformation into the controller form. The inverse, $\b x=\b T^{-1}(\b z)$ is
\begin{equation}
\left.\begin{array}{ccl}
x_1 &=& K_2z_1\\
x_2 &=& K_2z_2\\
x_3 &=& -K_1z_2\,\sin(K_3K_2 z_1)-z_3\,\sin(K_3K_2z_1)+z_4\,\cos(K_3K_2z_1) \\
x_4 &=& K_1z_2\,\cos(K_3K_2 z_1)+z_3\,\cos(K_3K_2z_1)+z_4\,\sin(K_3K_2z_1)
\end{array}\right\}
\label{eq:invofstr}
\end{equation}
We transform the PM stepper motor model into the new coordinates using~(\ref{eq:traofpmsm}), (\ref{eq:expefotrt}), and (\ref{eq:expefotrt}). We obtain
\begin{eqnarray}
\left[\begin{array}{c}
\dot{z}_1\\
\dot{z}_2\\
\dot{z}_3\\
\dot{z}_4
\end{array}\right]&=&\left[\begin{array}{c}
z_2\\
z_3\\
-K_2K_3z_2z_4-K_1z_3-K_2K_4z_2-K_5z_3-K_5K_1z_2\\
K_2K_3z_2z_3+K_1K_2K_3z_2^2-K_5z_4
\end{array}\right]\nonumber\\
&{}&\qquad +\left[\begin{array}{cc}
0 & 0\\
0 & 0\\
-\sin(K_3K_2 z_1) & \cos(K_3K_2 z_1)\\
\cos(K_3K_2 z_1) & \sin(K_3K_2 z_1)
\end{array}\right]\left[\begin{array}{c}
u_1\\
u_2
\end{array}\right].
\label{eq:pmstepinnco}
\end{eqnarray}
\end{example}\markex
\section{State-Feedback Control}

\section{Observer Form}
In this section, we discuss the problem of transforming of a class of nonlinear systems into an observer form, which is then used to construct state estimators for these systems. We first consider single output nonlinear systems of the form given by~(\ref{eq:nolioueq}), that is, the dynamical system models described by
\begin{equation}
\left.\begin{array}{ccl}
\dot{\b x} & = & \b f(\b x)+\b G(\b x)\b u\\
y&=&h(\b x)
\end{array}\right\}
\label{eq:nonsoutsobfo}
\end{equation}
First, we analyze the case of unforced system when $\b u=\b 0$. In such a  case~(\ref{eq:nonsoutsobfo}) redeuces to
\begin{equation}
\left.\begin{array}{ccl}
\dot{\b x} & = & \b f(\b x)\\
y&=&h(\b x)
\end{array}\right\}
\label{eq:nonsoutnoin}
\end{equation}

We desire to find a state variable transformation, written as $\b x=\b T(\b z)$ such that the model~(\ref{eq:nonsoutnoin}) in the $\b z$-coordinates is
\begin{equation}
\left.\begin{array}{ccl}
\dot{\b z} &=& \left[\begin{array}{ccccc}
0 & 0 & \cdots & 0 & 0\\
1 & 0 & \cdots & 0 & 0\\
\vdots &{}&\ddots& {}&\vdots\\
0&0&\cdots&1&0
\end{array}\right]\b z+\left[\begin{array}{c}
\alpha_0(y)\\
\alpha_1(y)\\
\vdots\\
\alpha_{n-1}(y)
\end{array}\right]=\b A\b z+\b{\alpha}(y)=\tilde{\b f}(\b z),\\
y&=&\left[\begin{array}{ccccc}
0&0&\cdots &0&1
\end{array}\right]\b z=\b c\b z.\end{array}\right\}
\label{eq:obserforfsosy}
\end{equation}
It is easy to verify that the state $\tilde{\b z}$ of the dynamical system
\begin{equation}
\dot{\tilde{\b z}}=\left(\b A-\b l\b c\right)\tilde{\b z}+\b{\alpha}(y)+\b ly,
\label{eq:obserforsinosy}
\end{equation}
will asymptotically converge to the state $\b z$ of~(\ref{eq:nonsoutnoin}) if the matrix $\b A-\b l\b c$ is asymptotically stable. The error $\b e=\tilde{\b z}-\b z$ dynamics are described by
\begin{equation}
\dot{\b e}=\left(\b A-\b l\b c\right)\b e,\quad \b e(t_0)=\tilde{\b z}(t_0)-\b z(t_0)
\label{eq:errodynosoe}
\end{equation}
We will now derive a sufficiency condition for the existence of a state variable transformation that brings~(\ref{eq:nonsoutnoin}) into the observer form~(\ref{eq:obserforfsosy}).

Taking the derivative of $\b x=\b T(\b z)$ with respect to time yields
\begin{equation}
\dot{\b x}=\frac{\partial \b T}{\partial \b z}\dot{\b z}=\frac{\partial \b T}{\partial \b z}\tilde{\b f}(\b z),
\label{eq:timderoftr}
\end{equation}
where we represent the Jacobian matrix of $\b T(\b z)$, denoted $\frac{\partial \b T}{\partial \b z}$, as
\begin{equation}
\frac{\partial {\b T}}{\partial \b z}=D\b T=\left[\begin{array}{ccc}
\frac{\partial {\b T}}{\partial z_1}&\cdots &\frac{\partial {\b T}}{\partial z_n}
\end{array}\right]
\label{eq:deroftasafz}
\end{equation}
Equating the right-hand sides of $\dot{\b x}=\b f(\b x)$ and~(\ref{eq:timderoftr}) yields
\begin{equation}
\b f(\b x)=\b f(\b T(\b z))=\frac{\partial \b T}{\partial \b z}\tilde{\b f}(\b z).
\label{eq:funfoxandz}
\end{equation}
Taking the partial derivative of~(\ref{eq:funfoxandz}) with respect to $z_k$ yields
\begin{equation}
\fbox{$\displaystyle \frac{\partial \b f(\b T(\b z))}{\partial z_k}=\frac{\partial \left( \frac{\partial \b T}{\partial \b z}\right)}{\partial z_k}\tilde{\b f}(\b z)+\frac{\partial \b T}{\partial \b z}\frac{\partial \tilde{\b f}(\b z)}{\partial z_k} $}
\label{eq:pardeofwzk}
\end{equation}
On the other hand, using the Chain Rule gives
\begin{equation}
\frac{\partial \b f(\b T(\b z))}{\partial z_k}=\frac{\partial \b f}{\partial \b x}\frac{\partial \b T(\b z)}{\partial z_k}.
\label{eq:padefchru}
\end{equation}
Using~(\ref{eq:funfoxandz}), the first term on the right-hand side of~(\ref{eq:pardeofwzk}) evaluates to
\begin{equation}
\frac{\partial \left( \frac{\partial \b T}{\partial \b z}\right)}{\partial z_k}\tilde{\b f}(\b z)=\frac{\partial \left( \frac{\partial \b T}{\partial \b z_k}\right)}{\partial \b z}\tilde{\b f}(\b z)=\frac{\partial \left( \frac{\partial \b T}{\partial \b z_k}\right)}{\partial \b z}\frac{\partial \b x}{\partial \b x}\tilde{\b f}(\b z)=\frac{\partial \left( \frac{\partial \b T}{\partial \b z_k}\right)}{\partial \b x}\frac{\partial \b T(\b z)}{\partial \b z}\tilde{\b f}(\b z)=\frac{\partial \left( \frac{\partial \b T}{\partial \b z_k}\right)}{\partial \b x}\b f(\b x).
\label{eq:fiteonrsofpf}
\end{equation}
Using~(\ref{eq:obserforfsosy}) and~(\ref{eq:deroftasafz}), we evaluate the second term on the right-hand side of~(\ref{eq:pardeofwzk}) to get
\begin{equation}
\frac{\partial \b T}{\partial \b z}\frac{\partial \tilde{\b f}(\b z)}{\partial z_k}=\left\{\begin{array}{lcl}
\frac{\partial \b T}{\partial z_{k+1}}&\mb{for}&k=1,2,\ldots,n-1\\
\frac{\partial \b T}{\partial \b z}\frac{\partial \tilde{\b f}(\b z)}{\partial z_n}&\mb{for}& k=n.
\end{array}\right.
\label{eq:seteofrchratf}
\end{equation}
Using the above and substituting~(\ref{eq:padefchru}) and~(\ref{eq:fiteonrsofpf}) into~(\ref{eq:pardeofwzk}) gives
\begin{equation}
\fbox{$\displaystyle \frac{\partial \b T}{\partial z_{k+1}}=\frac{\partial \b f}{\partial \b x}\frac{\partial \b T(\b z)}{\partial z_k}-\frac{\partial \left( \frac{\partial \b T}{\partial \b z_k}\right)}{\partial \b x}\b f(\b x),\quad k=1,2,\ldots,n-1 $}
\label{eq:patwrtzkpo}
\end{equation}
and
\begin{equation}
\frac{\partial \b T}{\partial \b z}\frac{\partial \tilde{\b f}(\b z)}{\partial z_n}=\frac{\partial \b f}{\partial \b x}\frac{\partial \b T(\b z)}{\partial z_n}-\frac{\partial \left( \frac{\partial \b T}{\partial \b z_n}\right)}{\partial \b x}\b f(\b x)
\label{eq:padetwrxn}
\end{equation}
We now employ the Lie-derivative notation introduced in Section~\ref{sec:confofononl} to express~(\ref{eq:patwrtzkpo}) and~(\ref{eq:padetwrxn}) in an alternative way. Using~(\ref{eq:liebracde}) and~(\ref{eq:altliebde}), we express~(\ref{eq:patwrtzkpo}) as
\begin{equation}
\frac{\partial \b T}{\partial z_{k+1}}=\left[\b f,\frac{\partial \b T}{\partial z_k}\right]=\left(\mb{ad}^1\b f,\frac{\partial \b T}{\partial z_k}	 \right),\quad k=1,2,\ldots,n-1,
\label{eq:altptwxpolb}
\end{equation}
and similarly
\begin{equation}
\frac{\partial \b T}{\partial \b z}\frac{\partial \tilde{\b f}(\b z)}{\partial z_n}=\left[\b f,\frac{\partial \b T}{\partial z_n}\right]=\left(\mb{ad}^1\b f,\frac{\partial \b T}{\partial z_n}	 \right)
\label{eq:inasimffon}
\end{equation}
Observe that
\begin{eqnarray*}
\frac{\partial \b T}{\partial z_2}&=&\left(\mb{ad}^1\b f,\frac{\partial \b T}{\partial z_1}	 \right),\\
\frac{\partial \b T}{\partial z_3}&=&\left(\mb{ad}^1\b f,\frac{\partial \b T}{\partial z_2}	 \right)=\left(\mb{ad}^2\b f,\frac{\partial \b T}{\partial z_1}	 \right),\\
\vdots &{}& \qquad\vdots
\end{eqnarray*}
and in general
\begin{equation}
\fbox{$\displaystyle\frac{\partial \b T}{\partial z_k}=\left(\mb{ad}^{k-1}\b f,\frac{\partial \b T}{\partial z_1}	 \right),\quad k=1,2,\ldots,n $}
\label{eq:iterafoth}
\end{equation}
With the aid of the above, we express all the columns of the Jacobian matrix~(\ref{eq:deroftasafz}) of $\b T(\b z)$ in terms of the starting vector $\partial \b T/\partial z_1$. We obtain,
\begin{equation}
\frac{\partial \b T}{\partial \b z}=\left[\begin{array}{cccc}
\left(\mb{ad}^0\b f,\frac{\partial \b T}{\partial z_1}	 \right)&\left(\mb{ad}^1\b f,\frac{\partial \b T}{\partial z_1}	 \right)&\cdots&\left(\mb{ad}^{n-1}\b f,\frac{\partial \b T}{\partial z_1}	 \right)
\end{array}\right]
\label{eq:jacintstv}
\end{equation}
To obtain an expression for the starting vector $\partial \b T/\partial z_1$, we use the output equation
\begin{equation}
y=h(\b x)=z_n.
\label{eq:oueqyanzn}
\end{equation}
We use the Chain Rule when taking the partial derivative of~(\ref{eq:oueqyanzn}) with respect to $\b z$ to get
\begin{equation}
\frac{\partial h(\b x)}{\partial \b x}\frac{\partial \b T}{\partial \b z}=\left[\begin{array}{ccccc}
0&0&\cdots&0&1
\end{array}\right].
\label{eq:padeoywbz}
\end{equation}
We use~(\ref{eq:lideofdhwf}) to express the first component on the left-hand side of the above as
\begin{equation}
\frac{\partial h(\b x)}{\partial \b x}\frac{\partial \b T}{\partial z_1}=L_{\b f}^0(Dh)\frac{\partial \b T}{\partial z_1}=0.
\label{eq:fstcoofdh}
\end{equation}
Using the Leibniz formula, we express the second component of the left-hand side of~(\ref{eq:padeoywbz}) as
\begin{eqnarray}
\frac{\partial h(\b x)}{\partial \b x}\frac{\partial \b T}{\partial z_2}&=&\left\langle \nabla h, \left[\b f,\frac{\partial \b T}{\partial z_1}\right]\right\rangle\nonumber\\
&=& L_{\frac{\partial \b T}{\partial z_1}}L_{\b f}h-L_{\b f}L_{\frac{\partial \b T}{\partial z_1}}h\nonumber\\
&=&L_{\frac{\partial \b T}{\partial z_1}}L_{\b f}h,
\label{eq:secoofdh}
\end{eqnarray}
since $\frac{\partial h(\b x)}{\partial \b x}\frac{\partial \b T}{\partial z_1}=0$ by~(\ref{eq:fstcoofdh}). We use~(\ref{eq:impproofdhf}) to represent~(\ref{eq:secoofdh}) as
\begin{eqnarray}
L_{\frac{\partial \b T}{\partial z_1}}L_{\b f}h&=&D L_{\b f}h \frac{\partial \b T}{\partial z_1}\nonumber\\
&=& L_{\b f}^1(Dh) \frac{\partial \b T}{\partial z_1}\nonumber\\
&=&0.
\label{eq:secousado}
\end{eqnarray}
By repeated application of the Leibniz formula and~(\ref{eq:jacintstv}), we express~(\ref{eq:padeoywbz}) equivalently as
\begin{equation}
\left[\begin{array}{c}
L^0_{\b f}(D h)(\b x)\\
L^1_{\b f}(D h)(\b x)\\
\vdots\\
L^{n-2}_{\b f}(D h)(\b x)\\
L^{n-1}_{\b f}(D h)(\b x)
\end{array}\right]\frac{\partial \b T}{\partial z_1}=\left[\begin{array}{c}
0\\
0\\
\vdots\\
0\\
1
\end{array}\right]
\label{eq:obsermaforsonn}
\end{equation}
The matrix
\begin{equation}
\left[\begin{array}{c}
L^0_{\b f}(D h)(\b x)\\
L^1_{\b f}(D h)(\b x)\\
\vdots\\
L^{n-2}_{\b f}(D h)(\b x)\\
L^{n-1}_{\b f}(D h)(\b x)
\end{array}\right]
\label{eq:obmannlsy}
\end{equation}
is called the observability matrix of the nonlinear system model~(\ref{eq:nonsoutnoin}). It follows from~(\ref{eq:obsermaforsonn}) that the starting vector $\partial \b T/\partial z_1$ is equal to the last column of the inverse of the observability matrix given by~(\ref{eq:obmannlsy}).

We now discuss the case of transforming into the observer form a nonlinear system model with inputs described by~(\ref{eq:nonsoutsobfo}). In this case, we can proceed as recommended by Krener and Respondek~\cite[Section~6]{krener85}. First transform the unforced system into observer form~(\ref{eq:obserforfsosy}). Then, check if the vector field $\b G(\b x)\b u$ is transformed into the form
\begin{equation}
\left.\b G(\b x)\right\arrowvert_{\b x=\b T(\b z)}\b u=\b{\beta}(y,\b u).
\label{eq:trsguinbyu}
\end{equation}
If this is the case, then set
\[
\b{\gamma}(y,\b u)=\b{\alpha}(y)+\b{\beta}(y,\b u).
\]
The above means that the system with inputs is transformed into the observer form,
\begin{equation}
\left.\begin{array}{ccl}
\dot{\b z} &=& \b A\b z+\b{\gamma}(y,\b u)\\
y&=&\b c\b z
\end{array}\right\}
\label{eq:obsforfosywins}
\end{equation}
where the matrices $\b A$ and $\b c$ are as in~(\ref{eq:obserforfsosy}). If the unforced system cannot be transformed into observer form or $\b G(\b x)\b u$ does not transform into~(\ref{eq:trsguinbyu}), then the original system~(\ref{eq:nonsoutsobfo}) cannot be transformed into observer form~(\ref{eq:obsforfosywins}).
\begin{example}\rm
Consider the system consisting of an inverted pendulum controlled by an armature-controlled DC motor that we analyzed in Example~\ref{ex:one_link}. The observability matrix for the system is
\begin{equation}
\left[\begin{array}{c}
L^0_{\b f}(D h)(\b x)\\
L^1_{\b f}(D h)(\b x)\\
L^{2}_{\b f}(D h)(\b x)
\end{array}\right]=\left[\begin{array}{ccc}
1 & 0 & 0\\
0 & 1 & 0\\
9.8 \cos(x_1) & 0 & 1
\end{array}\right].
\label{eq:obsermaslm}
\end{equation}
The starting vector $\partial \b T/\partial z_1$ is the last column of the inverse of the above observability matrix. We have
\begin{equation}
\partial \b T/\partial z_1=\left[\begin{array}{c}
0\\
0\\
1
\end{array}\right].
\label{eq:strvecfol}
\end{equation}
We will now find the Jacobian matrix of the desired transformation:
\begin{equation}
\frac{\partial \b T}{\partial \b z}=\left[\begin{array}{ccc}
\left(\mb{ad}^0\b f,\frac{\partial \b T}{\partial z_1}	 \right)&\left(\mb{ad}^1\b f,\frac{\partial \b T}{\partial z_1}	 \right)&\left(\mb{ad}^{2}\b f,\frac{\partial \b T}{\partial z_1}	 \right)
\end{array}\right]=\left[\begin{array}{ccc}
0 & 0 & 1\\
0 & 1 & -10\\
1 & -10 & 90
\end{array}\right].
\label{eq:jamaotfsim}
\end{equation}
Therefore, we can take
\begin{equation}
\b x=\b T(\b z)=\left[\begin{array}{ccc}
0 & 0 & 1\\
0 & 1 & -10\\
1 & -10 & 90
\end{array}\right]\b z.
\label{eq:trfosili}
\end{equation}
Note that $\b T(\b 0)=\b 0$. The inverse transformation is
\begin{equation}
\b z=\b T^{-1}\b x=\left[\begin{array}{ccc}
10 & 10 & 1\\
10 & 1 & 0\\
1 & 0 & 0
\end{array}\right]\b x.
\label{eq:invtrsiman}
\end{equation}
The system in the new coordinates is
\begin{eqnarray*}
\dot{\b z}&=&\left.\frac{\partial \b T^{-1}}{\partial \b x}\b f (\b x)\right\arrowvert_{\b x={\b T}(\b z)}+\left.\frac{\partial \b T^{-1}}{\partial \b x}\b g(\b x)\right\arrowvert_{\b x={\b T}(\b z)}u\\
&=&\left[\begin{array}{ccc}
0&0&0\\
1&0&0\\
0&1&0
\end{array}\right]\b z+\left[\begin{array}{c}
98\sin(y)+10 u\\
9.8\sin(y) - 10 y\\
-10y
\end{array}\right]\\
y&=&\left[\begin{array}{ccc}
0&0&1
\end{array}\right]\b z=z_3.
%\label{eq:simainncoo}
\end{eqnarray*}
\end{example}\markex
