\documentclass[12pt]{article} 

\usepackage{amsmath}    
\usepackage{amsfonts}  
\usepackage{amssymb}
\usepackage{graphicx}  
\usepackage{subfig}
\usepackage{tabularx}
\usepackage{listings}
\setlength{\parskip}{3pt plus 2pt}
\setlength{\parindent}{20pt}
\setlength{\oddsidemargin}{0.5cm}
\setlength{\evensidemargin}{0.5cm}
\setlength{\marginparsep}{0.75cm}
\setlength{\marginparwidth}{2cm}
\setlength{\marginparpush}{1.0cm}
\setlength{\textwidth}{165mm}
\setlength{\textheight}{9 true in}
\setlength{\topmargin}{-2cm}
\setlength{\footskip}{10pt}

\linespread{1.3}

\begin{document}

\pagestyle{empty}

%\begin{flushright}
%Name: \line(1,0){200}
%\end{flushright}
%\vskip1ex
\begin{center}{
\large{ \bf{ Homework 6 due April 16th,  \\  Numerical Linear Algebra, Spring 2018}}
}\end{center}

\begin{enumerate}
 \item (30pts) Chapter 12, problem 6. \\ Read the assignment carefully. Turn in your codes and plots. Annotate plots using functions 'title', 'xlabel', 'ylabel', 'legend'. Plot convergence curves for both methods on the same figure (make the curves different by varying 'LineSpec' settings). Generate several such figures for different size $n$ of the matrix $A$ and for different diagonal dominance factors $dd$.
 \vskip2ex
 \item (10pts) \emph{Mandatory} problem for MTH 465 students and \emph{bonus} problem for MTH 365 students: Chapter 12, problem 7. 
 \vskip2ex 
 \item (10pts) Given the linear system with $b = (7,2,5)^T$ and 
$$A = \begin{pmatrix} 1 & 2 & -2 \\ 1 & 1 & 1 \\ 2 & 2 & 1 \end{pmatrix}, $$
 show that the spectral radius of $T = I-M^{-1}A$ for Jacobi iteration is $\rho(T_J) = 0$ 
 and for the Gauss-Seidel method is $\rho(T_G) = 2$.
 \vskip2ex
 \item (30pts) Test the codes for Jacobi and Gauss-Seidel algorithms written for problem 1 for the following system: $b = (1,1,1)^T$ and 
$$A = \begin{pmatrix} 3 & -5 & 2 \\ 5 & 4 & 3 \\ 2 & 5 & 3 \end{pmatrix}. $$
For each method: 
\begin{enumerate}
 \item Use the maximum number of iterations (say, $1000$) as a stopping criteria.
  Start with initial guess $x = (0,0,0)^T$. 
 \item Plot the norms of the residual versus number of iterations. 
  Do it using $||\cdot||_2$, $||\cdot||_1$, and  $||\cdot||_{\infty}$. 
Plot the convergence curves on the same figure. 
(Annotate plots using functions 'title', 'xlabel', 'ylabel', 'legend'. 
Make the curves different by varying 'LineSpec' settings.) 
\item Report, if possible, the number of iterations needed for each method to converge. 
\item Justify your convergence results by computing the spectral radius of the corresponding matrix $T = I-M^{-1}A$ (where $M$ is an appropiate preconditioner) for each method. 
You can use Matlab to compute $T$ and its eigenvalues. 
\item Write a brief summary of your results (and turn in the plots).
\end{enumerate}
\vskip2ex
\item Consider the linear system with $b = (-1,7,-7)^T$ and 
$$A = \begin{pmatrix} 3 & -1 & 1 \\ -1 & 3 & -1 \\ 1 & -1 & 3 \end{pmatrix}. $$
 \begin{enumerate}
 \item Verify that the SOR method with value $\omega = 1.25$ of the relaxation parameter converges for this system.
 \item Compute the first iteration by the SOR method starting at the point $x= (0, 0, 0)^T$.
(You can do it by hand or write a Matlab code.)
\end{enumerate}

\end{enumerate}

\end{document}

   






