Problems 8.1, 8.2, 8.3, 8.4

8.1

Stability of finite differences for the wave equation.

Python for 8.1: 1d wave eq

With damping:

With more realistic initial conditions:

This scheme generalizes very easily to two-dimensions:

Python for 2d wave eq

8.2

1D diffusion on 500 sites.

Explicit solutions:

Implicit solutions:

In fact, since the solution should be unconditionally stable, here is the result with another factor of 10 increase in time step:

8.3

Use the tridiagonal solver to implement 2d diffusion using the Alternating Direction Implicit method.

Python for 8.3

`python 8.3.py -dt 10. -nx 100 -nt 40 -filename sam-inverted.png`

8.4

Implement successive over-relaxation with Gauss-Seidel to solve the Laplace equation on a rectangular domain.

Python for 8.4

`python 8.4.py -alpha 1.99 -nt 1000 -nx 100`

If we take fewer time steps, we can qualitatively compare convergence for stable values of the relaxation parameter.

`python 8.4.py -alpha 1.9 -nt 200 -nx 100`

MAS.864 2014