\documentclass[11pt]{article}

\usepackage{alltt}
\input{../../sty/preamble}

\begin{document}
\begin{center}
{\bf
TAO - Toolkit for Advanced Optimization
        
Tutorial and Exercises

\vspace{0.25in}

Workshop on the ACTS Toolkit

October 10--13, 2001

National Energy Research Scientific Computing Center
}
\end{center}
\vspace{0.25in}

\begin{enumerate}

\item Locate the TAO and PETSc documentation at 
\begin{alltt}
http://www.mcs.anl.gov/tao/docs/
http://www.mcs.anl.gov/petsc/docs/
\end{alltt}

\item Set the environmental variables
\begin{center}
\begin{tabular}{ll}
\texttt{TAO\_DIR} & \texttt{/usr/local/pkg/acts/TAO/1.2} \\
\texttt{PETSC\_DIR} & \texttt{/usr/local/pkg/acts/PETSc/petsc-2.1.0} \\
\texttt{PETSC\_ARCH} & \texttt{t3e} \\
\end{tabular}
\end{center}

\item Copy into your directory the programs
\begin{alltt}
$TAO_DIR/src/unconstrained/examples/tutorials/minsurf1.c
$TAO_DIR/src/unconstrained/examples/tutorials/minsurf2.c
$TAO_DIR/src/unconstrained/examples/tutorials/makefile 
\end{alltt}

\item
This set of exercises is based on the \textit{Example programs}
listed in the TAO web page under Tutorials. Locate these programs
and note that these examples are linked with the TAO documentation.
Read the documentation for \texttt{TaoCreate()}.

\item Run a simple example with \texttt{minsurf1}. You first need
to make the program using 

\quad \texttt{ make BOPT=O\_c++ minsurf1}

and then execute the program with

\qquad \texttt{mpiexec -n 1 minsurf1 -tao\_monitor}

What is the funtion value at the final iterate? 
How many iterates were used to reach the solution? 
Use the runtime option \texttt{-tao\_view}
to determine the solver.
\item 
Run \texttt{minsurf1} again but using other solvers.
You can change the solver by modifying the arguments of \texttt{TaoCreate()}
or by using the runtime option \texttt{-tao\_method}.
What is the function value at the final iterate?
How many iterates were used to reach
the solution?  What was the final accuracy?

\item 
Change the starting vector \texttt{x}.  The routine {\tt
MSA\_InitialPoint()} calculates a starting point, so after this
routine, and before the {\tt TaoSetInitialVector()} routine, set the
vector {\tt x} equal to zero with the PETSc routine {\tt VecSet()}.
How did the starting point affect the convergence?

\item 
Use \texttt{VecView(x,PETSC\_VIEWER\_STDOUT\_WORLD)} to view the solution
vector.

\item
Add bounds to your problem. You need to create two vectors, with the
same dimension and structure as the variable vector, to store the
lower and upper bounds of the variable.  Set the vector of upper
bounds equal to $1.0$ and the vector of lower bounds to $0.0$.  Use
{\tt TaoSetVariablesBounds()} to set the bounds on the problem.  Be
sure to destroy these vectors after you are finished using them.

\item Solve the bound constrained problem using 
\texttt{tao\_blmvm} and \texttt{tao\_tron}.
Did these bounds affect the solution? 

\item Run the problem {\tt minsurf2.c} on two processors and view the
output.


%  \item Write a program that finds the minimum of the function 
%  \[ 
%   f(x,y)=(1.5-x(1-y))^2+(2.25-x(1-y^2))^2+(2.625-x(1-y^3))^2.
%  \]
%  Can you find the global solution at $(3,0.5)$?

\item Write a program that finds the minimum of the function
\[
 f(x,y,z) =  x^2 - x y  + 0.75 y^2 + 0.5 z^2 + 4 x - 4 y - 2 z 
\]
Where is the minimum?  Answer: $(-1, 2, 2)$

Now minimize the same function subject to the constraint that
$x \geq 0$.  
Where is the minimum? Answer: $(0, 8/3, 2)$.


\end{enumerate}

\end{document}  
