Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

Re: Simple Recursive Map

  • To: mathgroup at smc.vnet.net
  • Subject: [mg35434] Re: [mg35398] Simple Recursive Map
  • From: Murray Eisenberg <murraye at attbi.com>
  • Date: Fri, 12 Jul 2002 04:28:53 -0400 (EDT)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200207110924.FAA02123@smc.vnet.net>
  • Reply-to: murray at math.umass.edu
  • Sender: owner-wri-mathgroup at wolfram.com

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