is an option to functions like NDSolve that specifies the maximum fraction of the total range to cover in a single step.
MaxStepFraction
is an option to functions like NDSolve that specifies the maximum fraction of the total range to cover in a single step.
Examples
open all close allBasic Examples (1)
Make sure that NDSolve uses at least 100 steps over the integration range:
NDSolve[{x''[t] + x[t] == Exp[-1000(t - π) ^ 2], x[0] == x'[0] == 0}, x, {t, 0, 20}, MaxStepFraction -> 1 / 100]Plot[Evaluate[First[x[t] /. %]], {t, 0, 20}]Applications (1)
Features with small relative size in the integration interval can be missed:
Table[Plot[Evaluate[y[x] /. NDSolve[{y''[x] + y[x] == Exp[-(1000 (x / L - 1 / 3)) ^ 2], y[0] == y'[0] == 0}, y, {x, L}]], {x, L / 4, L / 2}, PlotRange -> All], {L, {1, 10, 100, 1000}}]Use MaxStepFraction to ensure features are not missed, independent of interval size:
Table[Plot[Evaluate[y[x] /. NDSolve[{y''[x] + y[x] == Exp[-(1000 (x / L - 1 / 3)) ^ 2], y[0] == y'[0] == 0}, y, {x, L}, MaxStepFraction -> 0.001]], {x, L / 4, L / 2}, PlotRange -> All], {L, {1, 10, 100, 1000}}]Properties & Relations (1)
For an interval length l, MaxStepFraction->f is equivalent to MaxStepSize->(f l):
msf = NDSolve[{x''[t] + x[t] == Exp[-1000(t - π) ^ 2], x[0] == x'[0] == 0}, x, {t, 0, 20}, MaxStepFraction -> 1 / 100];mss = NDSolve[{x''[t] + x[t] == Exp[-1000(t - π) ^ 2], x[0] == x'[0] == 0}, x, {t, 0, 20}, MaxStepSize -> (20 1 / 100)];msf === mssSee Also
History
Introduced in 1999 (4.0)
Text
Wolfram Research (1999), MaxStepFraction, Wolfram Language function, https://reference.wolfram.com/language/ref/MaxStepFraction.html.
CMS
Wolfram Language. 1999. "MaxStepFraction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MaxStepFraction.html.
APA
Wolfram Language. (1999). MaxStepFraction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MaxStepFraction.html
BibTeX
@misc{reference.wolfram_2026_maxstepfraction, author="Wolfram Research", title="{MaxStepFraction}", year="1999", howpublished="\url{https://reference.wolfram.com/language/ref/MaxStepFraction.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_maxstepfraction, organization={Wolfram Research}, title={MaxStepFraction}, year={1999}, url={https://reference.wolfram.com/language/ref/MaxStepFraction.html}, note=[Accessed: 12-June-2026]}