Write a program to solve a 1D diffusion problem on a lattice of 500 sites, with an initial condition of zero at all the sites, except the central site which starts at the value 1.0. Take D = ∆x = 1, and use fixed boundary conditions set equal to zero.
(a) Use the explicit finite difference scheme, and look at the behavior for ∆t = 1, 0.5, and 0.1. What step size is required by the Courant condition?
Use SOR to solve Laplace’s equation in 2D, with boundary conditions uj,1 = u1,k = 0, uN,k = −1, uj,N = 1, and explore how the convergence rate depends on α, and how the best choice for α depends on the lattice size.