This assignment is due Thursday, February 11 in class.
Please e-mail your Matlab script(s) to
Do problem 2.3 in the text.
Consider the heat equation:
| ut = uxx, | (x,t) in (0,1)x(0,tF), |
| u(0,t) = u(1,t) = 0, | |
| u0(x) = sin(x pi). |
Code the Forward Euler scheme in Matlab.
Let the number of points in the x direction equal 33 and 513 (thus mesh
spacings in x of 1/32 and 1/512).
Choose a ratio of the spacing in t to the square of the spacing in x to be
.25, .5, and 1.0
Run the procedure for 50 time steps.
Report the error, the operation count (Matlab's flop variable will do), and
draw some concrete conclusions.
Using Matlab again, write an implicit theta solver for 0<theta<1
for the heat equation in Part II.
Make certain that you use a tridiagonal solver that is efficient.
Choose the same delta t's as in Part II.
Roughly, how many points in the x direction does it take to match the error at
the end of 50 time steps when
Cheers,
Craig C. Douglas