Continue the discussion 2D+1 PDE problem.
Why the solution eventually becomes messy and show those warning messages.
Here is the code:
a = 1;
T = 10;
ωcb = -50;
ωct = 50;
ωb = -5;
ωt = 5;
A = 10;
γ = 0.1;
kT = 0.1;
φ=π/4;
mol[n_Integer, o_:"Pseudospectral"] := {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid", "MaxPoints" -> n,
"MinPoints" -> n, "DifferenceOrder" -> o}}
With[{u = u[t, θ, ω]},
eq = D[u, t] == -D[ω u, θ] - D[-A Sin[θ] u, ω] - γ kT D[u, ω] + 1/10 D[ω u, ω];
ic = u == EllipticTheta[3, (θ - φ)/2, E^(-a^2/2)]*
E^(-ω^2/(2 a^2))/(2 π)^(3/2) /. t -> 0];
ufun = NDSolveValue[{eq, ic, u[t, -π, ω] == u[t, π, ω], u[t, θ, ωcb] == u[t, θ, ωct]},
u, {t, 0, T}, {θ, -π, π}, {ω, ωcb, ωct},
Method -> mol[50]]; // AbsoluteTiming
(* {24.137131, Null} *)
plots = Table[
Plot3D[Abs[ufun[t, θ, ω]], {θ, -π, π}, {ω, ωb, ωt},
PlotRange -> All, AxesLabel -> Automatic, PlotPoints -> 50,
BoxRatios -> {Pi, ωb, 1}], {t, 0, T, .2}];
ListAnimate[plots]
It gives the following message:
NDSolveValue::mxst: Maximum number of 10000 steps reached at the point t == 6.689127286306131`.
InterpolatingFunction::dmval: Input value {6.8,-3.14146,-4.9998} lies outside the range of data in the interpolating function. Extrapolation will be used.
InterpolatingFunction::dmval: Input value {7.,-3.14146,-4.9998} lies outside the range of data in the interpolating function. Extrapolation will be used.
InterpolatingFunction::dmval: Input value {7.2,-3.14146,-4.9998} lies outside the range of data in the interpolating function. Extrapolation will be used.
General::stop: Further output of InterpolatingFunction::dmval will be suppressed during this calculation.
How can this happen? I try to enlarge the MinPoints/MaxPoints, but it makes it worse. Any obvious mistake?
Would it related to the Courant condition? If the time step is too large, is there any thumb rule to better control it?


NDSolvegave up att==6.689becauseMaxStepswas reached. The other messages indicate that evaluating the interpolating function after that point is based on extrapolation, hence the weird results. Possible simple solution: addMaxSteps->Infinityto yourNDSolve. – Chris K Aug 17 '18 at 17:30