The assignment is due Thursday, March 5 in class.
Please e-mail your Matlab script(s) to
Problem 3.3, page 81 in the text.
Consider the heat equation on the unit square:
| ut + uxx + uyy = 0, | (x,y,t) in (0,1)2x(0,tF), |
| u(x,y,t) = 0, | along the boundary, |
| u0(x,y) = sin(x pi)sin(y pi). |
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:
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