Mathematical and Computational Methods for Engineers

E155B, Spring 2002

Problem Set #8

(Iterative methods, Jacobi and Gauss-Seidel)

Date: 5/22/2002 Due: 5/29/2002

Reading: Kreyszig 17.5 (differentiation only), 18.3, 19.4

Problem 1 The following ordinary differential equation can be discretized using finite differences as follows: . Assuming an exponential solution of the form obtain a non-linear algebraic equation for l. Using Taylor series, show that that the solution of this equation is accurate to second order in h.

Problem 2 Solve the following system in two different ways.

a) Write a short MATLAB script to solve for using the Jacobi iteration. Start with as your initial guess. Determine the number of iterations required to converge to the solution with an error of less than 1%. Submit a hard copy of your script.

b) Repeat the exercise in part a) now using the Gauss-Seidel iteration.

Problem 3 In class we discussed two different iteration methods: Jacobi and Gauss-Seidel. As it turns out, it is possible to get an improvement in the convergence speed over the standard Gauss-Seidel method by modifying the matrix M in such a way as to reduce the magnitude of the largest eigenvalue of , the parameter that generally limits the speed of convergence. This method is referred to as the method of successive overrelaxation (SOR).

a) The typical Gauss-Seidel iteration is given by where M=L+D is the lower triangular part of A. The goal is to introduce an overrelaxattion parameter w (w > 1) and replace the standard Gauss-Seidel correction: by a larger correctionin the hope of speeding up convergence. Show that that this method yields the following iteration scheme:

where

i.e. show that it is equivalent to the standard Gauss-Seidel iteration with the diagonals of M modified by a factor of 1/w.

b) For determinein terms of w using the algorithm developed in part a). Determine an equation for the eigenvalues of B. Solve for the value of w that minimizes these eigenvalues. [Hint: the two eigenvalues must be identical at the optimum condition].

c) Based on your result in part b) comment on the speed of convergence of this scheme in comparison to the Jacobi and Gauss-Seidel iterations (these were worked out in class for the same matrix A).

Problem 4 A square 1m x 1m plate is shown below. Three of its edges are held at 0 Co while its upper edge is exposed to a heat reservoir at T=100 Co

a) Using separation of variables determine the steady-state temperature distribution T(x,y) along the plate. [Hint: this problem was worked out in one of the lectures].

b) Write a MATLAB script to implement the Gauss-Seidel iteration and solve for T(x,y) numerically. Experiment with N=M=10 and N=M=20 grid points. In each case iterate on the solution until it changes by no more than 1% at every grid point. Create a surface plot of the temperature distribution and, separately, the error between the numerical solution and the exact analytical solution for the two cases.