\documentstyle[12pt]{article}
\renewcommand{\baselinestretch}{1.5}
\setlength{\oddsidemargin}{.0in}
\setlength{\textwidth}{6.5in}
\setlength{\topmargin}{-.25in}
\setlength{\textheight}{8.5in}
\newtheorem{thm}{Theorem}
\newtheorem{defn}{Definition}
\newtheorem{example}{Example}
\newtheorem{lemma}{Lemma}
\newtheorem{proposition}{Proposition}
\newtheorem{algorithm}{Algorithm}
\newcommand{\mb}{\mbox}
\newcommand{\bm}{\boldmath}
\def\b#1{\mb{\bm$#1$}}
\newfont{\Bb}{msbm10 scaled\magstep1}
\begin{document}
\section{Identification Using Adaptive Linear Element (Adaline)}
The adaptive linear element, abbreviated adaline, is shown in Figure~\ref{fig:adaline}.
\begin{figure}
\vspace{3in}
\hskip1.5in\special{eps:c:/mybook/adaline.eps y=3in}
\caption{Adaline.}
\label{fig:adaline}
\end{figure}
To describe its operation, we first explain symbols used in our discussion. Let $\b x(t)=\left[\begin{array}{cccc}
x_1(t) & x_2(t) & \cdots & x_n(t)
\end{array}\right]^T$ denote the adaline input. We assume that for all $t$
\[
\|\b x(t)\|=\sqrt{x_1^2(t)+\cdots + x_2^2(t)} \le B_x,
\]
where $B_x>0$ is known positive constant and $\|\cdot \|=\|\cdot\|_2$, that is, throughout whenever we write $\|\cdot\|$ we mean the Euclidean norm $\|\cdot \|_2$. We also assume that for all $t$,
\[
\|\dot{\b x}(t)\|_2=\sqrt{\dot{x}_1^2(t)+\cdots + \dot{x}_2^2(t)} \le B_{\dot{x}},
\]
The weight vector $\b w(t)=\left[\begin{array}{cccc}
w_1(t) & w_2(t) & \cdots & w_n(t)
\end{array}\right]^T$. The bias weight $w_{n+1}(t)$ is connected to a constant input equal to 1. We define $\tilde{\b x}(t)$ to be an augmented input vector that includes the constant input to the bias weight, that is,
\[
\tilde{\b x}(t)=\left[\begin{array}{ccccc}
x_1(t) & x_2(t) & \cdots & x_n(t) & x_{n+1}(t)
\end{array}\right]^T.
\]
Note that
\[
\left\Arrowvert \tilde{\b x}(t) \right\Arrowvert_2^2=\tilde{\b x}^T(t)\tilde{\b x}(t)=\left\Arrowvert \b x(t) \right\Arrowvert_2^2 +1,
\]
and hence $\tilde{\b x}(t)$ is bounded away from zero for all times. The augmented vector $\tilde{\b x}(t)$ is bounded, for all $t$, if and only if $\b x(t)$ is bounded. We denote a bound of $\tilde{\b x}(t)$ by $B_{\tilde{x}}$, that is, $\left\Arrowvert \tilde{\b x}(t) \right\Arrowvert \le B_{\tilde{x}}$ for all $t$. Observe that $\left\Arrowvert \dot{\tilde{\b x}}(t) \right\Arrowvert = \left\Arrowvert \dot{\b x}(t) \right\Arrowvert$. Thus, we can take $B_{\dot{\tilde{x}}}=B_{\dot{x}}$. Similarly, we define an augmented weight vector,
\[
\tilde{\b w}(t)=\left[\begin{array}{ccccc}
w_1(t) & w_2(t) & \cdots & w_n(t) & w_{n+1}(t)
\end{array}\right]^T.
\]
We assume that for all $t$,
\[
\left\Arrowvert \tilde{\b w}(t) \right\Arrowvert \le B_{\tilde{w}}
\]
for some constant $B_{\tilde{w}}>0$. The output, $y(t)$, of the adaline is a linear combination of its inputs, that is,
\[
y(t)=\tilde{\b x}^T(t)\tilde{\b w}(t).
\]
We denote by $y_d(t)$ the desired output of the adaline. We assume that
\[
\left| y_d(t)\right|\le B_y\quad\mb{and}\quad \left| \dot{y}_d(t)\right|\le B_{\dot{y}}
\]
for some positive constants $B_y$ and $B_{\dot{y}}$. Let
\[
e(t)=y(t)-y_d(t)
\]
denote the error signal. The error dynamics are described by
\begin{eqnarray}
\dot{e} &=& \dot{y}-\dot{y}_d\nonumber\\
&=& \dot{\tilde{\b w}}^T\tilde{\b x}+\tilde{\b w}^T\dot{\tilde{\b x}}-\dot{y}_d.
\label{eq:err_dyna}
\end{eqnarray}
Our objective is to devise adaptation algorithm for the weights $w_i(t)$, $i=1,2,\ldots,n+1$, so that the error $e(t)$ converges to zero in finite time, say $t_h$, and $e(t)=0$ for $t>t_h$. Sira-Ram{\'{\i}}rez and Colina-Morles~\cite{sira95} showed that we can achieve our objective if we adapt the weights according to the adaptation law,
\begin{equation}
\fbox{$\displaystyle \dot{\tilde{\b w}}=-k\frac{\tilde{\b x}}{\tilde{\b x}^T\tilde{\b x}}\,\mb{sign}(e(t)) $}
\label{eq:adaptlawforwtil}
\end{equation}
where the gain $k>0$ is sufficiently large. We now state and prove the theorem of Sira-Ram{\'{\i}}rez and Colina-Morles~\cite{sira95}.
\begin{thm}
If the weight vector $\tilde{\b w}$ is adapted according to~(\ref{eq:adaptlawforwtil}), where
\[
k>B_{\tilde{w}}B_{\dot{x}}+B_{\dot{y}},
\]
then for arbitrary initial error $e(0)$ the error signal $e(t)$ converges to zero in finite time, say $t_h$, such that
\[
t_h\le \frac{|e(0)|}{k-B_{\tilde{w}}B_{\dot{x}}-B_{\dot{y}}}
\]
and $e(t)=0$ for $t>t_h$.
\label{thm:adaforfth}
\end{thm}
{\bf Proof}\quad Recall that the error dynamics are governed by~(\ref{eq:err_dyna}), where the vector $\tilde{\b w}(t)$ is adapted according to~(\ref{eq:adaptlawforwtil}). Consider the following Lyapunov function candidate
\[
V(e)=\frac{1}{2}e^2(t).
\]
The time derivative of $V$ evaluated on the solutions of~(\ref{eq:err_dyna}) is
\begin{eqnarray}
\dot{V}(e) &=& e\dot{e}\nonumber\\
&=& e\left( \dot{\tilde{\b w}}^T\tilde{\b x}+\tilde{\b w}^T\dot{\tilde{\b x}}-\dot{y}_d\right).
\label{eq:vdotforerrada}
\end{eqnarray}
Substituting~(\ref{eq:adaptlawforwtil}) into the above and taking into account that
\[
\mb{sign(e)}=\frac{e}{|e|}=\frac{|e|}{e},
\]
we obtain
\begin{eqnarray}
\dot{V} &=& -k|e| + e\left(\tilde{\b w}^T\dot{\tilde{\b x}}-\dot{y}_d \right)\nonumber\\
&\le& -k|e| +|e|\left( B_{\tilde{w}}B_{\dot{\tilde{x}}}+B_{\dot{y}}\right)\nonumber\\
&=& \left(-k+ B_{\tilde{w}}B_{\dot{\tilde{x}}}+B_{\dot{y}}\right)|e|\nonumber\\
&<& 0\quad\mb{for all}\quad e\ne 0\quad\mb{and}\quad k>B_{\tilde{w}}B_{\dot{\tilde{x}}}+B_{\dot{y}},
\label{vdotsmalforallt}
\end{eqnarray}
which means that $e(t)\to 0$ as $t$ increases. It follows from our discussion above that we can take $B_{\dot{\tilde{x}}}=B_{\dot{x}}$. We now show that for some finite time $t_h$, we have $e(t_h)=0$ and $e(t)=0$ for $t>t_h$. For this substitute~(\ref{eq:adaptlawforwtil}) into~(\ref{eq:err_dyna}) to get
\begin{equation}
\dot{e}=-k\,\mb{sign}(e)+\tilde{\b w}^T\dot{\tilde{\b x}}-\dot{y}_d.
\label{eq:erreqafsub}
\end{equation}
Integrating the above from $t=0$ to $t\le t_h$ gives
\begin{equation}
e(t)-e(0)=-kt\,\mb{sign}(e(0))+\int_0^t \left( \tilde{\b w}^T(\tau)\dot{\tilde{\b x}}(\tau)-\dot{y}_d(\tau)\right)d\tau .
\label{eq:aftintoth}
\end{equation}
At $t=t_h$, we have $e(t_h)=0$ and therefore for $t=t_h$ the above equation takes the form
\begin{equation}
-e(0)=-kt_h \,\mb{sign}(e(0))+\int_0^{t_h} \left( \tilde{\b w}^T(t)\dot{\tilde{\b x}}(t)-\dot{y}_d(t)\right)dt .
\label{eq:erratth}
\end{equation}
Multiplying both sides of the above by $-\mb{sign}(e(0))$ yields
\begin{eqnarray}
|e(0)|&=&kt_h-\mb{sign}(e(0))\int_0^{t_h} \left( \tilde{\b w}^T(t)\dot{\tilde{\b x}}(t)-\dot{y}_d(t)\right)dt\nonumber\\
&\ge& \left(k-\left( B_{\tilde{w}}B_{\dot{x}}+B_{\dot{y}}\right) \right) t_h.
\label{eq:afmulbysign}
\end{eqnarray}
Thus, the time $t_h$ at which $e(t)$ reaches zero value for the first time satisfies the inequality
\[
t_h \le \frac{|e(0)|}{k-\left( B_{\tilde{w}}B_{\dot{x}}+B_{\dot{y}}\right)}.
\]
Because for $e(t)\ne 0$ we have $\frac{d}{dt}e^2(t)<0$, we are guaranteed that we also have $e(t)=0$ for $t>t_h$. The proof of the theorem is now complete.\\
\hspace*{5.5in} $\Box$

If the time derivative $\tilde{\b x}(t)$ is available, then we can use it in an adaptation law of $\tilde{\b w}$. Using $\tilde{\b x}(t)$ in an adaptation law allows us to reduce the gain $k$ and the bound on time $t_h$ when the error $e(t)$ becomes zero. One such adaptation strategy that includes $\tilde{\b x}(t)$ was proposed by Sira-Ram{\'{\i}}rez and Colina-Morles~\cite{sira95}. We present this strategy in the following theorem.
\begin{thm}
If the adaptation law for the augmented weight vector is chosen as
\begin{equation}
\fbox{$\displaystyle \dot{\tilde{\b w}}(t)=-\frac{\tilde{\b x}(t)\dot{\tilde{\b x}}^T(t)}{\tilde{\b x}^T(t)\tilde{\b x}(t)}\tilde{\b w}(t)-k\frac{\tilde{\b x}(t)}{\tilde{\b x}^T(t)\tilde{\b x}(t)}\,\mb{sign}(e(t)) $}
\label{eq:adalfwwxd}
\end{equation}
where $k>B_{\dot{y}}$, then for any given initial error $e(0)$, the error $e(t)$ converges to zero in finite time $t_h$ such that
\begin{equation}
t_h \le \frac{|e(0)|}{k-B_{\dot{y}}}
\label{eq:finthwxd}
\end{equation}
end $e(t)=0$ for $t>t_h$.
\label{thm:adawxdo}
\end{thm}
{\bf Proof}\quad The proof of this theorem is analogous to the proof of Theorem~\ref{thm:adaforfth}. The only difference is that (\ref{eq:erreqafsub}) becomes
\begin{equation}
\dot{e}=-k\,\mb{sign}(e)-\dot{y}_d.
\label{eq:rederreq}
\end{equation}
\hspace*{5.5in} $\Box$

When using the adaline for control purposes, the signal to be processed by the adaline is first passed through a prefilter as shown in Figure~\ref{fig:pre_ada}.
\begin{figure}
\vspace{1.5in}
\hskip1in\special{eps:c:/mybook/pre_ada.eps y=1.5in}
\caption{Prefilter connection to adaline.}
\label{fig:pre_ada}
\end{figure}
The prefilter is described by the equation, $\dot{\b x}=\b A\b x+\b b r$, where $r$ is the signal to be processed. The matrix $\b A$ of the prefilter is chosen to be asymptotically stable. Recall that the inputs to the adaline are the components of the augmented vector $\tilde{\b x}$ where the $(n+1)$-st component is equal to one. Thus, $\dot{x}_{n+1}=0$. Taking this into account, the prefiltered inputs to the adaline can be modeled as
\begin{equation}
\dot{\tilde{\b x}}=\tilde{\b A}\tilde{\b x}+\tilde{\b b}r,
\label{eq:prefinta}
\end{equation}
where
\[
\tilde{\b A}=\left[\begin{array}{cc}
\b A & \b 0\\
\b 0^T & 0
\end{array}\right]\quad\mb{and}\quad \tilde{\b b}=\left[\begin{array}{c}
\b b\\
0
\end{array}\right].
\]
Note that $\dot{\tilde{\b x}}$ is available to us in the architecture shown in Figure~\ref{fig:pre_ada}. Thus, we can employ the adaptation strategy given by~(\ref{eq:adalfwwxd}), which results in the following description of the structure depicted in Figure~\ref{fig:pre_ada}:
\begin{equation}
\left.\begin{array}{lll}
\dot{\tilde{\b x}}&=& \tilde{\b A}\tilde{\b x}+\tilde{\b b}r\\
\dot{\tilde{\b w}}&=&-\frac{\tilde{\b x}\dot{\tilde{\b x}}^T}{\tilde{\b x}^T\tilde{\b x}}\tilde{\b w}-k\frac{\tilde{\b x}}{\tilde{\b x}^T\tilde{\b x}}\,\mb{sign}(e)\\
y&=& \tilde{\b x}^T\tilde{\b w}
\end{array}\right\}
\label{eq:combdescaf}
\end{equation}
We now demonstrate, on a numerical example, how the adaline system modeled by~(\ref{eq:combdescaf}) can be applied to forward and inverse dynamics identification of dynamical systems. The nonlinear plant model is taken from Sira-Ram{\'{\i}}rez and Colina-Morles~\cite{sira95}. This plant is model has the form
\begin{equation}
\left.\begin{array}{lll}
\dot{\alpha}&=&p+\frac{\sin(\alpha)}{l}u\\
\dot{p} &=& \left( \frac{g}{l}-\frac{u^2}{l^2}\cos(\alpha)\right)-\frac{u}{l}p\cos(\alpha)\\
\dot{z}&=&u\\
y_p &=& \alpha
\end{array}\right\}
\label{eq:kapitsamo}
\end{equation}
The parameters $g$ and $l$ have the values: $g=9.81$\,\,\,m/sec$^2$ and $l=0.7$\,\,\,m. The plant input is labeled as $u$ while the plant output is $y_p$. We first concern ourselves with forward dynamics identification of the above plant. A block diagram of forward dynamics identification scheme is depicted in Figure~\ref{fig:forward}.
\begin{figure}
\vspace{2in}
\hskip2in\special{eps:c:/mybook/forward.eps y=2in}
\caption{Forward dynamics identifier scheme.}
\label{fig:forward}
\end{figure}
The input to the plant is
\[
u(t)=A_1+A_2\cos\left(\frac{t}{2\epsilon}\right)+A_3\sin\left(\frac{t}{\epsilon}\right),
\]
where $A_1=0.4$, $A_2=2$, $A_3=3$, and $\epsilon=0.05$. The prefilter equation~(\ref{eq:prefinta}) in our example has the form
\[
\dot{\tilde{\b x}}=\left[\begin{array}{cccc}
0 & 1 & 0 & 0\\
0 & 0 & 1 & 0\\
-1 & -3 & -3 & 0\\
0 & 0 & 0 & 0
\end{array}\right]\tilde{\b x}+\left[\begin{array}{c}
0\\
0\\
1\\
0
\end{array}\right]u.
\]
Thus, the adaline has total four weights, including the bias weight. In our simulations we use the following approximated of the sign function,
\begin{equation}
\mb{sign}\,(e(t))\approx \frac{e(t)}{|e(t)|+\delta},
\label{eq:sign_approx}
\end{equation}
where $\delta=0.05$. We used the above approximation to eliminate chattering and speed up the simulations. We used $k=10$. The performance of the adaline as a forward dynamics identifier of the dynamical system modeled by~(\ref{eq:kapitsamo}) is shown in Figure~\ref{fig:sim_for}. 
\begin{figure}
\vspace{3in}
\hskip1.25in\special{eps:c:/mybook/sim_for.eps y=3in}
\caption{Simulation results of forward dynamics identification of~(\ref{eq:kapitsamo}).}
\label{fig:sim_for}
\end{figure}
Increasing the gain $k$ results in more accurate identification, that is, the error $e(t)$ goes to zero faster. Furthermore, the effects of using the approximation~(\ref{eq:sign_approx}) are reduced for higher gain $k$.

In our next experiment, we employed the adaline as an inverse dynamics identifier using the scheme shown in Figure~\ref{fig:inve_id}.
\begin{figure}
\vspace{2in}
\hskip2in\special{eps:c:/mybook/inve_id.eps y=2in}
\caption{Inverse dynamics identifier scheme.}
\label{fig:inve_id}
\end{figure}
The results of our simulation are depicted in Figure~\ref{fig:inv_sim}. Here we used $k=90$. Increasing the gain $k$ decreases the identification error as well as reduces the effects of the approximation of the sign function.
\begin{figure}
\vspace{3in}
\hskip1.25in\special{eps:c:/mybook/inv_sim.eps y=3in}
\caption{Simulation results of inverse dynamics identification of~(\ref{eq:kapitsamo}).}
\label{fig:inv_sim}
\end{figure}
\bibliography{brain,root2,mybook}
\bibliographystyle{plain}
\end{document}