MA 625: Assignment 2

The assignment is due Thursday, March 5 in class.

Please e-mail your Matlab script(s) to

before class. Please bring to class the pencil and paper part and the code part.

Part I

Problem 3.3, page 81 in the text.

Part II

Consider the heat equation on the unit square:

The solution is smooth at the corners, hence the convergence analysis in the lectures and the text applies to this problem.

When you implement a solver make certain that your matrices are sparse. The discrete (elliptic) operator uxx + uyy on a (J+1)x(J+1) uniform grid (including the boundary grid points which you will eliminate to get a (J-1)2x(J-1)2 matrix) can be coded in Matlab using the following script:

Unfortunately, this produces a dense matrix a2d. Please come up with alternative method that is sparse. Do not forget the time discretization modification.

Code backward Euler and Crank-Nicolson in Matlab. Run your code out to tF=1 using at least 10 time steps. Run with J=5, 10, and 50 if you can. Use the following solvers: a direct solver, pcg, and bicgstab. For the pcg and bicgstab solvers make certain that you provide an initial guess on each time step and use 10-6 as the stopping criteria.

Write a report on what you did. Graph the final solution and the residual. You should include information about the costs (flops and memory), why you picked your delta t's, and draw some conclusions about the solution technique you found preferable.

I will give extra credit to whoever can run with the largest J. Any computer in the world that you have access to is fair game.

Cheers,
Craig C. Douglas