is an option for iterative numerical computation functions that gives an expression to evaluate whenever a step is taken by the numerical method used.


  • The option setting is normally given as StepMonitor:>expr.
  • The :> is used instead of -> to avoid expr being immediately evaluated.
  • Whenever expr is evaluated, all variables in the numerical computation are assigned their current values.
  • Block[{var1=val1,},expr] is effectively used.


open allclose all

Basic Examples  (3)

Monitor steps taken for a numerical minimization with FindMinimum:

Count steps:

Use Reap and Sow to collect step data:

Show steps on a plot of the function:

Scope  (4)

Monitor the solution progress when solving the sine-Gordon PDE:

Monitor steps taken to numerically solve a system of equations:

Show steps on a surface plot of the functions:

Steps in parameter space for a nonlinear fit:

Sequence of plots showing the evolution of the model over the steps:

Plot the spatial (x) solution for time (t) steps used numerically solving a PDE with NDSolve:

Show the steps with a surface plot of the solution:

Applications  (4)

Show how precision is adapted for high-precision root finding:

The quadratic convergence of Newton's method allows eventual precision doubling at each step:

Investigate steps and evaluations for a numerical minimization:

Show evaluations in red, steps in yellow, and the final point in green:

Get step sizes for the numerical solution of an ODE with NDSolve:

Show the solution and step size as a function of t:

Compare steps, evaluations, and timing for different ODE integration methods in NDSolve:

Wolfram Research (2003), StepMonitor, Wolfram Language function,


Wolfram Research (2003), StepMonitor, Wolfram Language function,


@misc{reference.wolfram_2020_stepmonitor, author="Wolfram Research", title="{StepMonitor}", year="2003", howpublished="\url{}", note=[Accessed: 15-April-2021 ]}


@online{reference.wolfram_2020_stepmonitor, organization={Wolfram Research}, title={StepMonitor}, year={2003}, url={}, note=[Accessed: 15-April-2021 ]}


Wolfram Language. 2003. "StepMonitor." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2003). StepMonitor. Wolfram Language & System Documentation Center. Retrieved from