MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: FixedPoint


On Wed, 16 Nov 2005, Scott wrote:

> Anybody know how to get FixedPoint to reveal how many iterations it had
> to perform before it found the fixed point; i.e. what n was when SameQ
> was satisfied and FixedPoint exited.

[...]

There's the FixedPointList function that gives all the intermediate
results, stopping when the elements no longer change -- so the length of
the returned list is the number of iterations + 1. Thus you need

{result, length} = With[{fpl = FixedPointList[yourFunction,
yourInitialCond]}, {Last[fpl], Length[fpl]-1}]

Kristjan Kannike
<http://www.physic.ut.ee/~kkannike/english/>


  • Prev by Date: Re: Magnetic Pendulum
  • Next by Date: Re: FixedPoint
  • Previous by thread: Re: FixedPoint
  • Next by thread: Re: FixedPoint