I find that with NDSolve[...]
while solving a partial differential equation, changing the MaxStepFraction
from 1/10
to say 1/60
, improves convergence.
Without going into too many details about the PDE itself, is the MaxStepFraction
the grid sized used? I generally find that when I use a large step fraction of say 1/30
instead of 1/60
, I get an error message that says:
NDSolve::eerr: Warning: Scaled local spatial error estimate of 1484.278641749214
at t = 240279.84981818125
in the direction of independent variable x is much greater than prescribed error tolerance. Grid spacing with 31 points may be too large to achieve the desired accuracy or precision. A singularity may have formed or you may want to specify a smaller grid spacing using the MaxStepSize or MinPoints method options. >>
Am I to understand that for a large step fraction, my equation either get's stiff (as the step size is large/grid is too coarse)?
EDIT 1:
My 4th order non-linear PDE generally looks like:
h_t + N(h[t,x],h[t,x]^2,h[t,x]^3,h[t,x]^4) = 0
Where N(...)
is the non-linear portion.
EDIT 2:
I used
Needs["DifferentialEquations`InterpolatingFunctionAnatomy`"];
and
hGrid = InterpolatingFunctionGrid[hSol];
{nX, nY, nT} =Drop[Dimensions[hGrid], -1]
Where hSol
is my interpolating function result that NDSolve
provides, and found that nx,ny and nT are respectively: 41,41,298 when I used MaxStepFraction->1/40
. So I am guessing, that MaxStepFraction->
does define the spatial grid.
Any thoughts? Comments?
MaximumStepFraction
is not mentioned in Mathematica’s documentation, and a Google search of the two terms together turns up your question as the only mention. Can you include some actual code, so we can see how you use it? $\endgroup$MaxStepFraction
and NOTMaximumStepFraction
. I've also included some more thoughts about this option in EDIT 2. $\endgroup$