MathGroup Archive 2005

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

Search the Archive

Re: Recursion


Hello Chris,
You are looking for a fix point of your function Wo.
The easiest way to do this is to use the function: FixedPoint (see  the 
help):
FixedPoint[Wo,startingvalue]
where Wo[x_Number] must return a number and startingvalue is a suitable 
numerical starting value.
However, this lets you not control the accuracy (only the max. number of 
steps) If you want control using the accuracy, use NestWhile.g.:

NestWhile[Wo, 0.1, (Abs[#1 - #2] > 10^-5) &, 2]
(see help)

good luck, Daniel

Christopher Grinde wrote:
> Hi. 
> I am quite new to mathematica and need help to set up a recursion loop:
>  
> 
> \!\(W\_0[T_] := \@\(\(\(12\ \[CurlyEpsilon]\_Si\)\/\(q\ a\)\) \(\(2\
> \(k\_B\) \
> T\)\/q\) Log[\(a\ W\_0[T]\)\/\(2\ n\_i[T]\)]\)\%3\)
> 
> How do I make this a recursive function which i can supply a start value for
> W0 and a limit for accuracy (W0[n]-W0[n+1]< some limit)
> 
> Any help would be highly appreciated 


  • Prev by Date: Re: Re: Why does mathematica randomly rewrite notebooks?
  • Next by Date: Generating PDF figures with correct fonts in Mac OS X
  • Previous by thread: Re: Recursion
  • Next by thread: Re: Recursion