MathGroup Archive 2002

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

Search the Archive

Re: Simple Recursive Map


You program it essentially the way you said it, just converting to
Mathematica notation for everything and using n on the left-hand sides
of the recurrence relations instead of n + 1:
  Clear[x, y]

  x[n_] := x[n] = y[n - 1] - a x[n - 1]^2 - 1
  y[n_] := y[n] = b x[n - 1]
  x[0] = 1.;  y[0] = -1.; a = 0.02; b = 1/3.;

  {x[49], y[49]}
{-1.57436, -0.524786}

Notice the (highly recommended) use of "caching" the values -- the
subexpressions x[n_] := x[n] = and similarly for y -- in the recurrence
relations in order to speed up the calculations.  Without that,
Mathematica doesn't "remember" the values of x and y when it calculates
them and has to re-calculate them for each subsequent evaluation.


Reuben wrote:
> 
> I have the map
> 
> x_n+1=y_n-a*(x_n)^2 - 1
> y_n+1=b*x_n
> 
> If I specify a,b, x_0 and y_0, how can I make Mathematica iterate
> through this numerically to give me x_50 and y_50?
> 
> Thanks
> Reuben

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.       
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street
Amherst, MA 01375


  • Prev by Date: Re: Exporting \[Micro] character tp EPS
  • Next by Date: Re: White border in plots
  • Previous by thread: Re: Simple Recursive Map
  • Next by thread: Re: Simple Recursive Map