OK, let me extend my comment to an answer. First of all, I'd like to point out that OP's observation
the zero boundary condition doesn't seem to hold
isn't really a problem here. Though ibcinc
warning does pop up, and the zero boundary condition is not exactly hold, the error is rather small in this case. For more info you may refer to the this post. The real problem here, is the eerr
warning pops up and the corresponding error is so large (it's 280235.11872106727
! ) that we cannot ignore it.
Then why does the estimated error so large? In short, this problem is quite similar with this one i.e. naive spatial discretization won't work for the PDE and we need to respect the conservation law in some way when discretizing. The simplest solution is to, as shown by Ulrich in his answer, turn to FiniteElement
method, but still, we can use TensorProductGrid
method. We just need to transform the PDE a little and set a low DifferenceOrder
:
With[{p = p[x, t], mid = mid[x, t]},
eq = D[p, t] == D[mid, x];
eqadd = mid == (4 x (x^2 - 1) + 0.1) p + D[p/b, x];]
ic = p[x, 0] == Exp[-x^2/2]/Sqrt[2 Pi];
icadd = mid[x, 0] == eqadd[[-1]] /. p -> Function[{x, t}, Evaluate@ic[[-1]]];
bc = {p[-3, t] == 0, p[3, t] == 0};
mol[n:_Integer|{_Integer..}, o_:"Pseudospectral"] := {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid", "MaxPoints" -> n,
"MinPoints" -> n, "DifferenceOrder" -> o}}
tst = NDSolveValue[{eq, eqadd, ic, icadd, bc}, p, {x, -3, 3}, {t, 0, 0.5},
Method -> mol[300, 2]]; // AbsoluteTiming
The eerr
warning still pops up, but the corresponding error (815.9
) isn't too large. Let's check how it looks like:
Plot3D[tst[i, j], {i, -3, 3}, {j, 0, 0.5}, PlotRange -> All, PlotPoints -> 200]

Plot[tst[i, 0.5], {i, -3, 3}, PlotRange -> All]

Looks reasonable, and it's consistent with that of FEM. Further check shows, the solution doesn't change significantly even if we make the grid denser, so it's probably reliable.
Update
Aha, the magic of Pseudospectral
seems to be effective for this problem:
b = 200;
pval = NDSolveValue[{D[p[x, t],
t] == (12 x^2 - 4) p[x, t] + (4 x (x^2 - 1) + 0.1) D[p[x, t], x] +
D[p[x, t]/b, {x, 2}], p[x, 0] == Exp[-x^2/2]/Sqrt[2 Pi], p[-3, t] == 0,
p[3, t] == 0}, p, {x, -3, 3}, {t, 0, 0.5}, Method -> mol[401]];
Plot[pval[i, 0.5], {i, -3, 3}, PlotRange -> All]
It's not necessary to modify the form of PDE even if TensorProductGrid
is chosen!