WOLFRAM

is an option for various numerical computation and plotting functions that gives an expression to evaluate whenever functions derived from the input are evaluated numerically.

Details

  • The option setting is normally given as EvaluationMonitor:>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 all

Basic Examples  (4)Summary of the most common use cases

Print information with every function evaluation used to find a root:

Out[1]=1

Count evaluations:

Out[1]=1

Use Reap and Sow to collect evaluation data:

Out[1]=1

Show the superlinear convergence of the method:

Out[2]=2

Monitor the time integration of a wave equation:

Out[1]=1

Scope  (5)Survey of the scope of standard use cases

Monitor the solution progress when solving the sineGordon PDE:

Out[1]=1

Evaluations for a numerical minimization:

Out[1]=1
Out[2]=2

Evaluations for computing a numerical integral with NIntegrate:

Out[2]=2

Show a plot of the evaluation position versus evaluation number:

Out[3]=3

Evaluations for solving a differential equation with NDSolve with a extrapolation method:

A plot shows that with this method, not all evaluations are on the solution curve:

Out[2]=2

Count evaluations for doing a surface plot:

Out[2]=2

When the function is evaluated, it takes fewer evaluations since symbolic derivatives are used:

Out[3]=3

Generalizations & Extensions  (2)Generalized and extended use cases

Evaluate any expression:

Out[1]=1

With a different starting value, the computation is stopped:

Out[2]=2

Distinguish between function and derivative evaluations in doing a numerical minimization:

Out[1]=1

Show function, gradient, and Hessian evaluations in blue, yellow and red, respectively:

Out[2]=2

Applications  (6)Sample problems that can be solved with this function

Show where evaluations were done for part of a plot using a tooltip that indicates order:

Out[1]=1

Show number of evaluations required to find a root as a function of starting value:

Out[2]=2

Compare evaluations required for different local minimization methods:

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

Steps and evaluations as a function of PrecisionGoal and AccuracyGoal in NDSolve:

Use a fixed order explicit RungeKutta method:

Out[2]=2

Use an adaptive order extrapolation method:

Out[3]=3

Compare the two methods. Beyond a goal of about 12, adaptive order is clearly superior:

Out[4]=4

Evaluations in parameter space for a nonlinear fit:

Out[3]=3

The evaluation points on a contour plot of the sum of squares:

Out[4]=4

Use a better starting value:

Out[5]=5
Out[6]=6

Compare the two fits with the data:

Out[7]=7

Properties & Relations  (1)Properties of the function, and connections to other functions

Evaluation done for EvaluationMonitor is scoped like Block:

Out[2]=2

This is effectively using Block with assignments of numerical values of the variable:

Out[4]=4
Wolfram Research (2003), EvaluationMonitor, Wolfram Language function, https://reference.wolfram.com/language/ref/EvaluationMonitor.html (updated 2007).
Wolfram Research (2003), EvaluationMonitor, Wolfram Language function, https://reference.wolfram.com/language/ref/EvaluationMonitor.html (updated 2007).

Text

Wolfram Research (2003), EvaluationMonitor, Wolfram Language function, https://reference.wolfram.com/language/ref/EvaluationMonitor.html (updated 2007).

Wolfram Research (2003), EvaluationMonitor, Wolfram Language function, https://reference.wolfram.com/language/ref/EvaluationMonitor.html (updated 2007).

CMS

Wolfram Language. 2003. "EvaluationMonitor." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/EvaluationMonitor.html.

Wolfram Language. 2003. "EvaluationMonitor." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/EvaluationMonitor.html.

APA

Wolfram Language. (2003). EvaluationMonitor. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EvaluationMonitor.html

Wolfram Language. (2003). EvaluationMonitor. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EvaluationMonitor.html

BibTeX

@misc{reference.wolfram_2025_evaluationmonitor, author="Wolfram Research", title="{EvaluationMonitor}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/EvaluationMonitor.html}", note=[Accessed: 25-March-2025 ]}

@misc{reference.wolfram_2025_evaluationmonitor, author="Wolfram Research", title="{EvaluationMonitor}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/EvaluationMonitor.html}", note=[Accessed: 25-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_evaluationmonitor, organization={Wolfram Research}, title={EvaluationMonitor}, year={2007}, url={https://reference.wolfram.com/language/ref/EvaluationMonitor.html}, note=[Accessed: 25-March-2025 ]}

@online{reference.wolfram_2025_evaluationmonitor, organization={Wolfram Research}, title={EvaluationMonitor}, year={2007}, url={https://reference.wolfram.com/language/ref/EvaluationMonitor.html}, note=[Accessed: 25-March-2025 ]}