[Date Index]
[Thread Index]
[Author Index]
Re: Simple Recursive Map
*To*: mathgroup at smc.vnet.net
*Subject*: [mg35437] Re: [mg35398] Simple Recursive Map
*From*: Tomas Garza <tgarza01 at prodigy.net.mx>
*Date*: Fri, 12 Jul 2002 04:29:00 -0400 (EDT)
*References*: <200207110924.FAA02123@smc.vnet.net>
*Sender*: owner-wri-mathgroup at wolfram.com
To start with, you must use the proper syntax, and then set up a recursion.
You have not given initial values, so I arbitrarily set x[1] = 1 and y[1] =
0. Then
In[1]:=
x[n_] := y[n - 1] - a*x[n - 1]^2 - 1;
y[n_] := b + x[n - 1];
x[1] := 1;
y[1] := 0;
recursion limit (q.v.), usually equal to 256 by default. Bear in mind that
you are getting very complicated expressions as n grows larger, if a and b
remain in symbolic form, and the execution time may also be quite large.
Take, for example, n = 10:
In[2]:=
Timing[Collect[y[10], {a, b}]; ]
Out[2]=
{118.2 Second, Null}
I used Collect to obtain a neater result. Of course, I didn't display it.
Tomas Garza
Mexico City
----- Original Message -----
From: "Reuben" <reubengann at hotmail.com>
To: mathgroup at smc.vnet.net
Subject: [mg35437] [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
>
Prev by Date:
**Re: White border in plots**
Next by Date:
**Re: arguments of the function**
Previous by thread:
**Simple Recursive Map**
Next by thread:
**Re: Simple Recursive Map**
| |