Implementation of numerical method to solve the 1D diffusion equation with variable diffusivity and non-zero source terms.