Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Tuning & Debugging > StepMonitor >

StepMonitor

StepMonitor
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 is effectively used.
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:
Monitor steps taken for a numerical minimization with FindMinimum:
In[1]:=
Click for copyable input
Out[1]=
 
Count steps:
In[1]:=
Click for copyable input
Out[1]=
 
Use Reap and Sow to collect step data:
In[1]:=
Click for copyable input
Out[1]=
Show steps on a plot of the function:
In[2]:=
Click for copyable input
Out[2]=
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:
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:
New in 5
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF