I am experiencing trouble when trying to solve a PDE for various parameter values within mathematica: The PDE in principle can easily be solved numerically, however the stepsize of the spatial discretization (method of lines) has to be altered depending on the choice of parameters for NDSolve to converge. The code is as follows,
Sol[a_, b_] := Sol[a, b] = NDSolve[{PDE[a, b], BC}, P, {x, xmin, xmax}, {\[Phi], 0, 2*Pi}, {t, 0, tmax}, MaxStepFraction -> {1/200, 1/20, 1/10}, Method -> {"BDF", "MaxDifferenceOrder" -> 2}, EvaluationMonitor :> (CurrTime = t;), InterpolationOrder -> All] where $P(x,\phi,t)$ is the unknown function entering the PDE. Unfortunately, the xStepFraction of $\frac{1}{200}$ is not small enough for some values of $a$ and $b$, for some other values it must however not be chosen too small (otherwise NDSolve does not converge). I know that up to now mathematica does not provide adaptive grid refinement for the method of lines. In addition, the right xStepFraction does depend rather arbitrarily on $a$ and $b$, so I cannot define a function $\text{xStepFraction}(a,b)$.
So, my question is, whether it is possible to construct some kind of grid refinement, say to run NDSolve with a rather coarse grid spacing, and if NDSolve returns an error message like
NDSolve::eerr: Warning: scaled local spatial error estimate of 220.4370802734196` at t = 0.1646666008001777` in the direction of independent variable x is much greater than the prescribed error tolerance. Grid spacing with 201 points may be too large to achieve the desired accuracy or precision. A singularity may have formed or a smaller grid spacing can be specified using the MaxStepSize or MinPoints method options. >> to automatically reduce the xStepFraction. Any help would be highly appreciated.
