I have an issue with NDSolve for the case of a PDE with discontinuous initial/terminal condition. Consider the PDE solution
Z=z/.First[NDSolve[{
D[z[t,x],t] == z[t,x] D[z[t,x],x]-1/2 (1-t)^2 D[z[t,x],{x,2}],
z[1,x]==UnitStep[x],
z[t,-5000]==0,
z[t,5000]==1},
{z},{t,0,1},{x,-5000,5000}]]
The terminal condition is the discontinuous UnitStep function. When I plot the solution for t=1 now,
Plot[Z[1, x], {x, -10, 10}]
Mathematica has obviously smoothened the terminal condition (which was explicitly given by the UnitStep function).
Is it possible to disable this smoothing? Or at least, I want to have a smooth function that does not exceed 1 and does not go below 0.
Note: What I am not searching for is a solution like "increase the MaxSteps" or something similar. I am interested in options on how Mathematica processes the initial/terminal condition.
Thanks a lot for your help!!