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.278641749214at 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)?


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.


I used



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?

  • $\begingroup$ 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$
    – F'x
    Commented Mar 28, 2012 at 16:35
  • $\begingroup$ @F'x I apologize. I am getting careless. I meant MaxStepFraction and NOT MaximumStepFraction. I've also included some more thoughts about this option in EDIT 2. $\endgroup$
    – dearN
    Commented Mar 28, 2012 at 16:45

1 Answer 1


The documentation is fairly clear on this:

MaxStepFraction is an option to functions like NDSolve that specifies the maximum fraction of the total range to cover in a single step.

In simpler terms, you can think of MaxStepFraction as the inverse of the number of intervals in the total range, whereas MaxStepSize is the length of an interval. The following graphic should make the difference clear:

enter image description here

So in other words, setting MaxStepFraction = 1/10 and setting MaxStepSize = L/10 will give you the same result. The documentation linked above also has an example that demonstrates this:

  • $\begingroup$ This makes sense, thank you. $\endgroup$
    – dearN
    Commented Mar 28, 2012 at 17:48
  • $\begingroup$ Not that simple. MaxStepFraction seems to override MaxStepSize. Here is an example that adjusting MaxStepSize doesn't have effect but adjusting MaxStepFraction does: mathematica.stackexchange.com/a/291395/1871 $\endgroup$
    – xzczd
    Commented Oct 11, 2023 at 5:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.