Diffusion Equation with a DiscontinuityQ: I would like to solve the following standard diffusion equation: This equation has an analytical solution, even though the initial and boundary
conditions have a discontinuinity. How can I modify the input so Robert Knapp (rknapp@wolfram.com) suggests
changing the initial condition from The discretization used in the 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, Mathematica does not check that it is fine enough to
meet the |