RE: Simple Recursive Map
- To: mathgroup at smc.vnet.net
- Subject: [mg35436] RE: [mg35398] Simple Recursive Map
- From: "DrBob" <majort at cox-internet.com>
- Date: Fri, 12 Jul 2002 04:28:58 -0400 (EDT)
- Reply-to: <drbob at bigfoot.com>
- Sender: owner-wri-mathgroup at wolfram.com
You can use subscripts:
Subscript[x, 0] = 0
Subscript[y, 0] = 0
Subscript[x, n_] := Subscript[x, n] =
Expand[Subscript[y, n - 1] -
a*Subscript[x, n - 1]^2 - 1]
Subscript[y, n_] := Expand[b*Subscript[x, n - 1]]
Subscript[x, 5]
The function equivalent is much faster:
ClearAll[f, g]
f[0] = 0;
g[0] = 0;
f[n_] := f[n] = Expand[g[n - 1] -
a*f[n - 1]^2 - 1]
g[n_] := Expand[b f[n - 1]]
The fiftieth terms are a lost cause, until you give a and b specific
numerical values:
LeafCount@f@# & /@ Range[8]
Depth@f@# & /@ Range[8]
{1, 5, 18, 66, 271, 1091, 4376, 17500}
{1, 3, 4, 4, 4, 4, 4, 4}
Bobby
-----Original Message-----
From: Reuben [mailto:reubengann at hotmail.com]
To: mathgroup at smc.vnet.net
Subject: [mg35436] [mg35398] Simple Recursive Map
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