Homework 5, due midnight Friday, May 9¶

1 Wave equation by finite differences¶

(a) Using the standard 3-point differences for $u_{tt}$ and $u_{xx}$, write down the time stepping formula for the wave equation $u_{tt} = c^2 u_{xx}$ for the case that the time step is as large as it can be without instability. I'm asking for an explicit formula for $u_{j+1}$ in terms of other grid values.

(b) Entirely by hand, use your formula from part (a) to fill in the blanks below. image.png

(c) Repeat parts (a) and (b) for the case that $k^2$ is twice as large. ($k$ is the time step.)

2 Laplace via SOR¶

Grid (equal horizontal and vertical spacings) and BCs: image.png

(a) What is the solution for the interior grid values using the usual FD approximations?

(b) What is the SOR matrix, $T_\omega$?

(c) What is the optimal value of $\omega$ for this problem?

(d) What is the spectral radius of $T_\omega$ at this optimal value?

(e) Based on your answer to (d), about how many iterations would it take to get 8 digits of accuracy if your initial errors were about 0.1?

For maximum credit, show all your work.

3 Spectral differentiation¶

(a) What is the matrix of the DFT for $n=4$?

(b) What is the DFT of the vector ${\bf{x}} = [2,3,3,2]^T$?

(c) What is the spectral derivative of the vector ${\bf{x}}$?

(d) Make a plot of the band-limited trigonometric interpolant for ${\bf{x}}$ and check that its slope at the grid points matches your answer to (c).

In [ ]: