% Sample file for SIAM's plain TeX macro package.
%
\input siamptex.sty

% author defined macros included for illustrative purposes only.
% symbols for real numbers, complex, ... (\Bbb font from AMS-TeX
% fonts v2.x also useable)

\def\fR{{\bf R}}
\def\fC{{\bf C}}
\def\fK{{\bf K}}

% misc. operators
\def\Span {\mathop{\hbox{\rm span}}\nolimits}
\def\Range{\mathop{\hbox{\rm Range}}\nolimits}
\def\Det  {\mathop{\hbox{\rm det}}}
\def\Re   {\mathop{\hbox{\rm Re}}}
\def\Im   {\mathop{\hbox{\rm Im}}}
\def\Deg  {\mathop{\hbox{\rm deg}}}

% misc.

\def\Kr{\hbox{\bf  K}}
\def\K {     {      K}}
\def\sT{\hbox{$\cal T$}}
\def\sB{\hbox{$\cal B$}}

\def\bmatrix#1{\left[ \matrix{#1} \right]}

% Each of the following commands have to be filled in with
% something. If the data is unknown, the arguments can be
% left blank.

\topmatter
\journal{SIAM J. E{\smc XAMPLE} F{\smc ILES}}
\vol{1}
\no{1, pp.~000--000}
\date{October 1993}
\copyyear{1993}
\code{000}


\title SAMPLE FILE FOR SIAM PLAIN \TeX\ MACRO
PACKAGE\endtitle

\shorttitle{SIAM MACRO EXAMPLE}

\recdate{*}{May 1, 1992; accepted by the editors Month, x,
xxxx. This work was supported by the Society for Industrial
and Applied Mathemtics, Philadelphia, Pennsylvania}

\author Paul Duggan\fnmark{$^{\dag}$} \and Various A.~U.
Thors\fnmark{$^{\ddag}$}\endauthor

\address{$^{\dag}$}{Composition Department, Society for
Industrial and Applied Mathematics, 3600 University City
Science Center, Philadelphia, Pennsylvania, 19104-2688
({\tt [email protected]})}

\address{$^{\ddag}$}{Various affiliations, supported by
various foundation grants}

\abstract{An example of SIAM \TeX\ macros is presented.
Various aspects of composing manuscripts for SIAM's journals
are illustrated with actual examples from accepted
manuscripts. SIAM's stylistic standards are adhered to
throughout, and illustrated.}

\keywords polynomials, SI model\endkeywords

\subjclass 33H40, 35C01\endsubjclass

% if there is only one AMS subject number, the
% command \oneclass should precede the \subjclass command.

\endtopmatter

\heading{1}{Introduction and examples}
This paper presents a sample file for the use of SIAM's
\TeX\ macro package. It illustrates the features of the
macro package, using actual examples culled from various
papers published in SIAM's journals. This sample will provide
examples of how to use the
macros to generate standard elements of journal papers,
e.g., equations, theorems, or figures. This paper also
serves as an exmple of SIAM's stylistic preferences for the
formatting of such elements as bibliographic references,
displayed equations, and aligned equations, among others.
Some special circumstances are not dealt with this the
sample file; for that information, please see the
associated documentation file.

{\it Note}. This paper is not to be read in any form for
content. The conglomeration of equations, lemmas, and other
text elements were put together solely for typographic
illustrative purposes.

For theoretical reasons, it is desirable to find characterizations of the
conditions of breakdown of the algorithms that are based on the key {\it
spaces} $\Kr_n(r^{(0)},A)$ and $\Kr_n(\tilde r^{(0)},A^*)$ rather than
the {\it formulas} for the algorithms.  In particular, we will
characterize breakdown of the three Lanczos algorithms in terms of the
{\it moment matrices} $\K_n(\tilde r^{(0)},A^*)^*\K_n(r^{(0)},A)$ and
$\K_n(\tilde r^{(0)},A^*)^*A\K_n(r^{(0)},A)$.  Here we define the matrix
$\K_n(v,A)=\bmatrix{v&Av&\cdots&A^{n-1}v\cr}$, a matrix whose columns span
the Krylov space $\Kr_n(v,A)$.

The following three theorems give exact conditions for breakdown of the
above algorithms.  Detailed proofs may be found in [3].  A
result similar to Theorem 2 is found in [1]; see also [5].


\thm{Theorem 1 {\rm (Lanczos--Orthodir breakdown)}}
Suppose Lanczos/Orthodir has successfully generated
$u^{(n-1)}\not=u$.  Then the following are equivalent:

\meti{$\bullet$} The algorithm does not break down at step $n$.

\meti{$\bullet$} The matrix $\K_n(\tilde r^{(0)},A^*)^*A\K_n(r^{(0)},A)$
is nonsingular.

\meti{$\bullet$} There exists a unique iterate $u^{(n)}$ satisfying $(2)$.
\endthm


\thm{Theorem 2 {\rm (Lanczos--Orthomin breakdown)}}
Suppose Lanczos/Orthomin has successfully generated $u^{(n-1)}\not=u$.
Then the following are equivalent:

\meti{$\bullet$} The algorithm breaks down at step $n$.

\meti{$\bullet$} Either
$\K_{n-1}(\tilde r^{(0)},A^*)^*\K_{n-1}(r^{(0)},A)$ or
$\K_n(\tilde r^{(0)},A^*)^*A\K_n(r^{(0)},A)$ is singular.
\endthm


\prop{Proposition 3 {\rm (zero sets of polynomials)}}
Let $\fK=\fR$ or $\fC$.  If $P$ is a complex nonzero polynomial in the
variables $x_1,x_2,\ldots ,x_N\in\fK$, then $P(x)\not=0$ for almost every
$x=(x_1,x_2,\ldots,x_N)\in \fK^N$.
\endprop

\prf{Proof}
If $\fK=\fR$ and $P$ is nonzero, then either $\Re P(z)$ or $\Im P(z)$
is a nonzero (real) polynomial; if $\fK=\fC$, we may decompose each $x_i$
into real and imaginary parts, giving $2N$ variables, and consider the
real polynomial $P(x)^*P(x)$.  In any case, we may assume without loss of
generality that $P$ is a nonzero real polynomial of real variables.

We know that for any point $x$, the polynomial $P$ is the zero polynomial
if and only if the polynomial and all its derivatives are zero at $x$.
Let $V_0$ denote the set of zeros of $P$ in $\fR^N$.  Suppose the set
$V_0$ has nonzero measure.  We know from integration theory (see, for
example, [6, pp.\ 128f]) that almost every point of $V_0$ is
a point of density in each of the $N$ coordinate directions.  We recall
that $x\in\fR$ is a point of density of a measurable subset
$S\subseteq\fR$ if for any sequence of intervals $I_n$ such that
$x\in I_n$ with measure $m(I_n)\rightarrow 0$ we have
$m(S\cap I_n)/m(I_n)\rightarrow 1$.

It is easily seen that at such points in $V_0$, the first
partial derivatives of $P$ must necessarily be zero.  Let $V_1$ be the
points of $V_0$ where all first derivatives are also zero.  We have just
shown that $V_0$ and $V_1$ both have the same nonzero measure.  The
argument
may be repeated for $V_1$ to show all second partial derivatives of $f$
are zero at almost every point of $V_0$, and so forth, resulting in the
fact that $P$ and all its derivatives are zero on a set which has nonzero
measure.  The proof is completed by selecting any one of these points.
\qquad\endproof

\thm{Theorem 4 {\rm (Lanczos breakdown, iterate $n$)}}
Let $\fK=\fR$ or $\fC$, $A, \tilde Z\in\fK^{N\times N}$, and $n\leq d(A)$.
Then exactly one of the following three conditions holds for the Lanczos
method with $\tilde r^{(0)}=\tilde Z^* r^{(0)}$.

\meti{\rm (i)} Hard breakdown at step $n$ occurs for every vector
$r^{(0)}\in\sT_n(A)\cap\fK^N$ $($and thus at least for almost every
$r^{(0)}\in\fK^N)$.

\meti{\rm (ii)} Hard breakdown at step $n$ occurs for a nonempty measure-zero
set of vectors $r^{(0)}\in\sT_n(A)\cap\fK^N$
$($and thus a nonempty measure-zero set of vectors in $\fK^N)$.

\meti{\rm (iii)} Hard breakdown at step $n$ occurs for no vectors
$r^{(0)}\in\sT_n(A)\cap\fK^N$ $($and thus for at most a measure-zero set of
vectors in $\fK^N)$.

Furthermore, the same result holds if ``hard breakdown'' is replaced by
``soft breakdown'' in the statement of this theorem.
\endthm


\prf{Proof}
For vectors $r^{(0)}\in\sT_n(A)\cap\fK^N$, breakdown is equivalent to
singularity of an appropriate moment matrix.  The set $\sT_n(A)\cap\fK^N$
amounts to almost
every vector in $\fK^N$.  Now, by Corollary 5, the set $S_n$ of vectors in
$\fK^N$ for which the moment matrix of dimension $n$ is singular is either
the set of all vectors or a subset of measure zero.  If the moment matrix
is singular for every vector (i.e., $S_n=\fK^N$), then it is singular for
every vector in $\sT_n(A)\cap\fK^N$, giving case (i) above.  Otherwise the
set $S_n$ is measure zero in $\fK^N$.  Thus
$\sB_n\equiv S_n\cap(\sT_n(A)\cap\fK^N)$ is of measure zero
and is either empty or nonempty.
\qquad\endproof

\heading{2}{Tables and figures}
In Tables 1 and 2 we consider the unpreconditioned problem and also the (left)
ILU- and MILU-preconditioned problem (see [2] and [4]).  Runs for which
convergence was not possible in ITMAX iterations are labeled by (--).


\topinsert
\hbox{\vbox{ \eightpoint
{\parindent 0pt
\centerline{\smc Table 1}
\centerline{\it Model problem, $h^{-1}=128$, {\rm ITMAX=3000}.
           Number of iterations.}\vskip 6pt
\hfil\vbox{\offinterlineskip
\hrule
\halign{&\vrule#&\strut\ \hfil#\ \cr
height2pt&\omit&&\omit&&\omit&&\omit&&\omit
&&\omit&&\omit&&\omit&&\omit&&\omit&&\omit&\cr
&{\rm method $\backslash$ Dh: } &
                  &0&&2${}^{-3}$&&2${}^{-2}$&&2${}^{-1}$&&2${}^{0}$&
          &2${}^{1}$&&2${}^{ 2}$&&2${}^{ 3}$&&2${}^{ 4}$&&2${}^{5}$&\cr
height2pt&\omit&&\omit&&\omit&&\omit&&\omit
&&\omit&&\omit&&\omit&&\omit&&\omit&&\omit&\cr
\noalign{\hrule}
height2pt&\omit&&\omit&&\omit&&\omit&&\omit
&&\omit&&\omit&&\omit&&\omit&&\omit&&\omit&\cr
&{GMRES}($\infty$) \hfill &
& 290&& 269&& 245&& 220&& 200&& 189&& 186&& 189&& 207&& 249&\cr
&{BCG} \hfill &
& 308&& 341&& 299&&1518&& -- && -- && -- && -- && 533&& -- &\cr
&{BCG}{\rm, random $u^{(0)}$} \hfill &
& 309&& 354&& 300&& 310&& 313&& 301&& 299&& 302&& 290&& 293&\cr
&{BCGNB} \hfill &
& 308&& 353&& 284&& 338&& 253&& 240&& 243&& 240&& 302&& 962&\cr
&{CGS} \hfill &
& 272&& 254&& 222&& -- && -- && -- && -- && -- && -- && -- &\cr
&{CGS}{\rm, random $u^{(0)}$} \hfill &
& 193&& 189&& 200&& 192&& 193&& 175&& 225&& 212&& 216&& 197&\cr
&{CGSNB} \hfill &
& 272&& 284&& 212&& 196&& 151&& 162&& 158&& 173&& 156&& 256&\cr
height1pt&\omit&&\omit&&\omit&&\omit&&\omit
&&\omit&&\omit&&\omit&&\omit&&\omit&&\omit&\cr
} \hrule}\hfil}}}
\endinsert


\topinsert

\hbox{\vbox{ \eightpoint
{\parindent 0pt
\centerline{\smc Table 2}

\centerline{\it Model Problem, $h^{-1}=128$,}
\centerline{\it {\rm MILU}-preconditioning, {\rm ITMAX=500.}
Number of iterations.}

\medskip

\hfil\vbox{\offinterlineskip
\hrule
\halign{&\vrule#&\strut\ \hfil#\ \cr
height2pt&\omit&&\omit&&\omit&&\omit&&\omit
&&\omit&&\omit&&\omit&&\omit&&\omit&&\omit&\cr
&{\rm Method $\backslash$ Dh: } &
                  &0&&2${}^{-3}$&&2${}^{-2}$&&2${}^{-1}$&&2${}^{0}$&
          &2${}^{1}$&&2${}^{ 2}$&&2${}^{ 3}$&&2${}^{ 4}$&&2${}^{5}$&\cr
height2pt&\omit&&\omit&&\omit&&\omit&&\omit
&&\omit&&\omit&&\omit&&\omit&&\omit&&\omit&\cr
\noalign{\hrule}
height2pt&\omit&&\omit&&\omit&&\omit&&\omit
&&\omit&&\omit&&\omit&&\omit&&\omit&&\omit&\cr
&{\rm {GMRES}($\infty$)} \hfill &
&  27&&  25&&  24&&  26&&  28&&  28&&  25&&  19&&  14&&  10&\cr
&{\rm {GMRES}($\infty$), random $u^{(0)}$} \hfill &
&  33&&  29&&  28&&  29&&  31&&  31&&  29&&  24&&  19&&  14&\cr
&{\rm {BCG}} \hfill &
&  31&&  27&&  29&&  33&&  30&&  37&&  30&&  23&&  15&&  10&\cr
% &{BCG}, random $u^{(0)}$, $\gamma=.1$ \hfill &
% &  35&&  30&&  31&&  35&&  40&&  37&&  34&&  27&&  20&&  15&\cr
&{\rm {BCG}, random $u^{(0)}$} \hfill &
&  38&&  34&&  33&&  37&&  44&&  40&&  38&&  29&&  23&&  18&\cr
&{\rm {BCGNB}} \hfill &
&  28&&  27&&  29&&  30&&  34&&  35&&  30&&  23&&  15&&  10&\cr
&{\rm {CGS}} \hfill &
&  21&&  18&&  17&&  20&&  22&&  22&&  19&&  15&&   9&&   6&\cr
&{\rm {CGS}, random $u^{(0)}$} \hfill &
&  24&&  18&&  20&&  22&&  22&&  23&&  21&&  16&&  12&&   9&\cr
&{\rm {CGSNB}} \hfill &
&  21&&  18&&  17&&  20&&  22&&  27&&  20&&  15&&   9&&   6&\cr
height1pt&\omit&&\omit&&\omit&&\omit&&\omit
&&\omit&&\omit&&\omit&&\omit&&\omit&&\omit&\cr
} \hrule}\hfil}}}
\endinsert

We make the following observations about these runs.

\meti{$\bullet$} For the unpreconditioned problem, the standard
{BCG} and {CGS} algorithms break down in a number of cases, but the use
of random $u^{(0)}$ or the use of {BCGNB} or {CGSNB}
resulted in convergence.  Furthermore, the iteration counts for the
algorithms {BCG} and {BCGNB} are in
general comparatively close to those of the ``best'' method,
{GMRES}($\infty$), while these algorithms have short economical
recurrences, unlike {GMRES}($\infty$).  This underscores the
importance of the Lanczos algorithms as economical solution techniques.

\meti{$\bullet$} For the ILU-preconditioned problems, in most cases
all methods worked well.  For the case of $Dh=1$, {BCG} gave
an excessive number of iterations, but this was remedied significantly
by {BCGNB} and much more so
by the use of random $u^{(0)}$.  Similarly, {CGS} could
not converge, but {CGSNB} and {CGS} with random
$u^{(0)}$ both converged.

\meti{$\bullet$} For all of the MILU-preconditioned problems, all of
the Lanczos-type algorithms performed quite well.  In particular, the
{BCG} algorithm gave approximately the same number of
iterations as {GMRES}($\infty$).

Figures 1 and 2 give representative plots of the convergence behavior of the
algorithms for the case of $h^{-1}=128$, $Dh=4$, and no preconditioning.
These results show that the new algorithms keep the residual size
better behaved than the standard {BCG} and {CGS}
algorithms over the course of the run.

\topinsert
\vskip 3.2in
\centerline{\eightpoint\smc Fig.~1. \it Residual
behavior: $h^{-1}=128$, $Dh=4$.}
\endinsert


\topinsert
\vskip 3.2in
\centerline{\eightpoint\smc Fig.~2. \it  Residual
behavior: $h^{-1}=128$, $Dh=4$.}
\endinsert

We now consider a more difficult class of finite difference problems,
namely, central finite differencing applied to the Dirichlet problem
$$ -u_{xx}(x,y) - u_{yy}(x,y) +
  D[(y-\textstyle{1\over 2}\displaystyle) u_x(x,y) +
    (x-\textstyle{1\over 3}\displaystyle)
    (x-\textstyle{2\over 3}\displaystyle) u_y(x,y)], $$
$$ - 43\pi^2u(x,y) = G(x,y) \quad {\rm on}\ \Omega=[0,1]^2,$$
$$u(x,y) = 1 + xy \quad \hbox{\rm on}\ \partial\Omega,$$
with $G(x,y)$ chosen as before so that the true solution is $u(x,y)=1+xy$.
Again, we let $h$ denote the mesh size in each direction.  For $D=0$
and $h$ small, the matrix generated by this problem is a symmetric
indefinite matrix with 16 distinct negative eigenvalues and the rest
of the spectrum positive.

The standard conjugate residual algorithm applied to this problem with
$h^{-1}=128$ and $D=0$ requires 766 iterations to converge to
$||r^{(n)}||/||b||<\zeta=10^{-6}$.  In any case, this is a difficult
problem to solve.

 \def\qed{\vrule height8pt width4pt depth0pt\par\medskip}
 \def\Zero{{\bf 0}}
 \def\dis{\displaystyle}
 \def\b{\beta}
 \def\r{\rho}
 \def\X{{\bf X}}
 \def\Y{{\bf Y}}
 \def\bb{{\bar \beta}}
  \def\tbcr{\theta\bb c_h \rho_h}
 \def\ep{\varepsilon}



Figures 3(a) and 3(b) show the compartmental diagrams for SI models without
and with deaths due to the disease, for  the situation in which the infectious
period has only one stage. Figures 4(a) and 4(b) give the corresponding models
with $m$ stages of infection. Venereal
warts, caused by the human papilloma virus, and ordinary herpes are examples
of sexually transmitted diseases without deaths
due to the disease, although both are not quite SI diseases because of
partial immunity. AIDS is the example of an SI disease with death due to
the disease. Although our main focus is on the latter, we present results
on SI models without deaths due to the
disease because the simplification in the dynamics of such models
throws light on the case with disease-related deaths.

\topinsert
\vskip 2in
\centerline{\eightpoint {\smc Fig.} 3(a). SI {\it model for subgroup $i$, without death
due to the disease.}}
\vskip 2in
\centerline{\eightpoint {\smc Fig.} 3(b). SI {\it model with death due to the disease.}}
\endinsert

\topinsert
\vskip 2in
\centerline{\eightpoint {\smc Fig.} 4(a). SI {\it model without deaths due to the
disease with $m$ stages of infection.}}
\vskip 2in
\centerline{\eightpoint {\smc Fig.} 4(b). SI {\it model with deaths due to the disease,
with $m$ stages of infection.}}
\endinsert

\heading{3}{Equations and alignments}
The equations for the system follow directly from the definitions and the
compartmental diagrams. For one infected stage with no disease-related
deaths, the equations are
$$ \dot X_i=-X_ig_i-\mu X_i+U_i, \leqno(1)$$
$$ \dot Y_i=X_ig_i-\mu Y_i. \leqno(2)$$
If there are multiple stages to the infection, (2) is replaced by
(3)--(5) as follows:
$$\leqalignno{\dot Y_{i1}&=X_ig_i-(k+\mu)Y_{i1}, &(3)\cr
\dot Y_{ir}&=kY_{i,r-1}-(k+\mu)Y_{ir},\qquad  r=2,\ldots,m-1 &(4)\cr
\dot Y_{im}&=kY_{i,m-1}-\mu Y_{im}. &(5)\cr }$$



\heading{3.1}{The SI model with structured mixing}
In this subsection we write the equations for the SI model with
structured mixing, with one infected stage and with deaths due to the
disease. The equations for multiple infected stages follow easily, as do
those for SI models without death due to the disease. Recall that $f_{is}$
gives  the fraction of population subgroup $i$'s
contacts that are made in activity group $s$. The total contact rate of
susceptibles from population subgroup $i$ in activity group $s$ must be
$c_iX_if_{is}$. Let $\rho_{ij}(s)$ be the fraction of the contacts of group
$i$ that are with members of group $j$, within activity group $s$.
Assuming random allocation of the susceptibles and infecteds from each
population subgroup to the activity groups, the fraction infected in group
$j$ in activity group $s$ must be $Y_j/N_j$, giving
$$ c_iX_if_{is}\rho_{ij}(s)\beta_j{Y_j \over N_j}\leqno(6)  $$
for the rate at which susceptibles in $i$ are infected by contacts
with infecteds from $j$ in activity group $s$. Thus, in this case, $g_i$ is
given by
$$
g_i=c_i\sum_sf_{is}\sum_j\rho_{ij}(s)\beta_j{Y_j \over N_j},
\leqno(7)
$$
and (1a) and (1b) become
$$  \dot X_i=-c_iX_i\sum_sf_{is}\sum_j\rho_{ij}(s)\beta_j{Y_j \over
N_j}-\mu X_i+U_i, \leqno(8)  $$
$$  \dot Y_i=c_iX_i\sum_sf_{is}\sum_j\rho_{ij}(s)\beta_j{Y_j \over
N_j}-(\mu+k)Y_i. \leqno(9)  $$

\heading{3.2}{Structured mixing within  activity groups}
If the mixing within activity groups is proportional mixing, then
$\rho_{ij}(s)$ is given by (10):
$$\rho_{ij}(s)={f_{js}c_jN_j\over \sum_pf_{ps}c_pN_p}, \leqno(10)$$
and (8) and (9) become (11) and (12):
$$\dot X_i=-c_iX_i\sum_sf_{is}{\sum_jf_{js}c_j\beta_jY_j \over
\sum_jf_{js}c_jN_j}-\mu X_i+U_i \leqno(11)$$
$$\dot Y_i=c_iX_i\sum_sf_{is}{\sum_jf_{js}c_j\beta_jY_j \over
\sum_jf_{js}c_jN_j}-(k+\mu)Y_i. \leqno(12)$$

Expressions (11) and (12) show an important consequence of death due
to the disease. If there are no deaths due to the disease, $N_j$ is
constant on the asymptotically stable invariant subspace $U_j=\mu
N_j$ for all $j$, and the first term, the nonlinear term, in
(11) and (12) is a sum of {\it quadratic} terms. If there are deaths
due to the disease, $N_j$ is no longer constant and the first term is
a sum of rational expressions, each homogeneous of degree one. This
observation extends to SIS, SIR, and SIRS models.



\Refs


\ref 1\\
{\smc R. Fletcher}, {\it Conjugate gradient methods for indefinite
systems}, in Numerical Analysis Dundee 1975, G.~A. Watson, ed.,
Springer-Verlag, New York, Lecture Notes in Math. 506,
1976, pp. 73--89.
\endref


\ref 2\\
{\smc I. Gustafsson}, {\it Stability and rate of convergence of
modified incomplete Cholesky factorization methods}, Ph.D. thesis,
Chalmers University of Technology and the University of Goteborg,
Goteborg, Sweden, 1979.
\endref


\ref 3\\
{\smc W.~D. Joubert}, {\it Generalized conjugate gradient and
Lanczos methods for the solution of nonsymmetric systems of linear
equations},  Ph.D. thesis and Report
CNA-238, Center for Numerical Analysis, University of Texas,
Austin, TX, January 1990.
\endref


\ref 4\\
{\smc J.~A. Meijerink and H.~A. van der Vorst}, {\it An iterative
solution method for linear systems of which the coefficient matrix is
a symmetric $M$-matrix}, Math. Comp., 31 (1977), pp.~148--162.
\endref



\ref 5\\
{\smc Y.~Saad}, {\it The Lanczos biorthogonalization algorithm and
other oblique projection methods for solving large unsymmetric systems},
SIAM J. Numer. Anal., 19 (1982), pp. 485--506.
\endref


\ref 6\\
{\smc S. Saks}, {\it The Theory of the Integral}, G.~E. Stechert,
New York, 1937.
\endref

\ref 7\\
{\smc M. Tinkham}, {\it Introduction to
Superconductivity}, McGraw-Hill, New York, 1975.
\endref

\bye