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.
Details
- 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.
Examples
open allclose allBasic Examples (3)
Monitor steps taken for a numerical minimization with FindMinimum:
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:
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:
Text
Wolfram Research (2003), StepMonitor, Wolfram Language function, https://reference.wolfram.com/language/ref/StepMonitor.html.
CMS
Wolfram Language. 2003. "StepMonitor." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/StepMonitor.html.
APA
Wolfram Language. (2003). StepMonitor. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StepMonitor.html