FixedPoint
FixedPoint[f,expr]
starts with expr, then applies f repeatedly until the result no longer changes.
FixedPoint[f,expr,n]
stops after at most n steps.
Details and Options
- FixedPoint always returns the last result it gets.
- You can use Throw to exit from FixedPoint before it is finished.
- FixedPoint[f,expr] applies SameQ to successive pairs of results to determine whether a fixed point has been reached.
- FixedPoint[f,expr,…,SameTest->s] applies s to successive pairs of results.
Examples
open allclose allBasic Examples (3)
Options (2)
Applications (8)
Fixed point of a complex iteration:
Matrix-multiplication convergence:
Root of the current directory tree (the result will depend on computer system):
Find the minimum of with the steepest-descent method (vector notation):
Evaluate combinators [more info]:
Properties & Relations (3)
FixedPoint gives the last element of FixedPointList:
Apply rules repeatedly until the result no longer changes using ReplaceRepeated (//.):
FixedPoint is equivalent to a particular choice of arguments of NestWhile:
Possible Issues (2)
Calculations may not converge in a finite number of steps:
Providing a maximum number of iterations will guarantee termination:
Using a numerical test for convergence works in this case as well:
Convergence may fail in machine-precision computations due to oscillations in the final digits. Use a test function with a larger tolerance than SameQ to resolve this:
Text
Wolfram Research (1988), FixedPoint, Wolfram Language function, https://reference.wolfram.com/language/ref/FixedPoint.html (updated 1996).
CMS
Wolfram Language. 1988. "FixedPoint." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/FixedPoint.html.
APA
Wolfram Language. (1988). FixedPoint. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FixedPoint.html