Functions in Mathematica
are carefully set up so that you normally do not have to know how they work inside. But particularly for numerical functions that use iterative algorithms, it is sometimes useful to be able to monitor the internal progress of these algorithms.
Note the importance of using option:>expr
rather than option->expr
. You need a delayed rule :>
to make expr
be evaluated each time it is used, rather than just when the rule is given.
To take a successful step toward an answer, iterative numerical algorithms sometimes have to do several evaluations of the functions they have been given. Sometimes this is because each step requires, say, estimating a derivative from differences between function values, and sometimes it is because several attempts are needed to achieve a successful step.
There are often several different methods known for doing particular types of numerical computations. Typically Mathematica
supports most generally successful ones that have been discussed in the literature, as well as many that have not. For any specific problem, it goes to considerable effort to pick the best method automatically. But if you have sophisticated knowledge of a problem, or are studying numerical methods for their own sake, you may find it useful to tell Mathematica
explicitly what method it should use. Function reference pages list some of the methods built into Mathematica
; others are discussed in "Numerical and Related Functions"
or in advanced documentation.