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 > EvaluationMonitor >

EvaluationMonitor

EvaluationMonitor
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.
  • 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 is effectively used. »
Print information with every function evaluation used to find a root:
Count evaluations:
Use Reap and Sow to collect evaluation data:
Show the superlinear convergence of the method:
Print information with every function evaluation used to find a root:
In[1]:=
Click for copyable input
Out[1]=
 
Count evaluations:
In[1]:=
Click for copyable input
Out[1]=
 
Use Reap and Sow to collect evaluation data:
In[1]:=
Click for copyable input
Out[1]=
Show the superlinear convergence of the method:
In[2]:=
Click for copyable input
Out[2]=
Monitor the solution progress when solving the sine-Gordon PDE:
Evaluations for a numerical minimization:
Evaluations for computing a numerical integral with NIntegrate:
Show a plot of the evaluation position versus evaluation number:
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:
Count evaluations for doing a surface plot:
When the function is evaluated, it takes fewer evaluations since symbolic derivatives are used:
Evaluate any expression:
With a different starting value, the computation is stopped:
Distinguish between function and derivative evaluations in doing a numerical minimization:
Show function, gradient, and Hessian evaluations in blue, yellow and red, respectively:
Show where evaluations were done for part of a plot using a tooltip that indicates order:
Show number of evaluations required to find a root as a function of starting value:
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 Runge-Kutta method:
Use an adaptive order extrapolation method:
Compare the two methods. Beyond a goal of about 12, adaptive order is clearly superior:
Evaluations in parameter space for a nonlinear fit:
The evaluation points on a contour plot of the sum of squares:
Use a better starting value:
Compare the two fits with the data:
Evaluation done for EvaluationMonitor is scoped like Block:
This is effectively using Block with assignments of numerical values of the variable:
New in 5 | Last modified in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF