## Diffusion Equation with a Discontinuity
This equation has an analytical solution, even though the initial and boundary conditions have a discontinuinity. How can I modify the input so can solve the equation ? Robert Knapp (rknapp@wolfram.com) suggests changing the initial condition from to . The discretization used in the -direction uses finite difference
formulas. Such formulas typically do poorly on discontinuities, so the result may not be
correct. The message means that the error estimate that However, for this problem, the given solution is probably reasonable because the diffusion tends to smooth out the discontinuity quickly. If the solution is not correct, it is because the finite differences were not able to catch the discontinuity well enough. One way to increase the number of grid points without swamping your computer's memory is to use an unevenly spaced grid.
This method has the advantage that the grid spacing is close where it needs to be.
Also, the solution is around ten times faster than that using the uniform grid. However,
the method is not without potential problems. First, highly irregular spacing can cause
artifacts of the grid to show up in numerical solutions. Second, for some problems, the
discontinuity may move, leaving the place where the grid is spaced most closely. The
method does not yet have adaptive gridding, though that is a future possibility. Third,
when you specify the grid, |