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

MathGroup Archive 2007

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

Search the Archive

Re: Iteratively determing successive values from previous values....

  • To: mathgroup at smc.vnet.net
  • Subject: [mg80388] Re: [mg80369] Iteratively determing successive values from previous values....
  • From: DrMajorBob <drmajorbob at bigfoot.com>
  • Date: Tue, 21 Aug 2007 04:59:33 -0400 (EDT)
  • References: <28579907.1187597940895.JavaMail.root@m35>
  • Reply-to: drmajorbob at bigfoot.com

Clear[x]
x[i_] /; i > 1 := x[i - 1] + 1

x /@ Range[10]

{x[1], 1 + x[1], 2 + x[1], 3 + x[1], 4 + x[1], 5 + x[1], 6 + x[1],
  7 + x[1], 8 + x[1], 9 + x[1]}

Clear[x, y]
x[i_] /; i > 1 := Simplify[x[i - 1] + s[i - 1] y[i - 1]/2^(i - 1)]
y[i_] /; i > 1 := Simplify[y[i - 1] + s[i - 1] x[i - 1]/2^(i - 1)]

x[5]

(1/1024)((8 (128 + s[3] s[4] + 2 s[2] (2 s[3] + s[4])) +
      s[1] (32 (2 s[3] + s[4]) + s[2] (128 + s[3] s[4]))) x[1] +
   2 (32 (2 s[3] + s[4]) + s[2] (128 + s[3] s[4]) +
      2 s[1] (128 + s[3] s[4] + 2 s[2] (2 s[3] + s[4]))) y[1])

You should also look at Help for RSolve.

Bobby

On Mon, 20 Aug 2007 02:37:48 -0500, ashesh <ashesh.cb at gmail.com> wrote:

> Hi,
>
> Need one help in determining the next value of a function from the
> previous values.
>
> Example:
>
> x(i+1) = x(i) + 1;
>
> If one iterates to find x(5), we should get it as (x(1) + 4), as the
> initial value is x(1), which is obtained
>
> x2 = x1+1;
> x3 = x2 + 1 = (x1+1) + 2 = x1 + 2
> x4 = x3 + 1 = (x2+1) + 1 = x2 + 2 = (x1+1) + 2 = x1 + 3
> x5 = x4 + 1 = (x3+1) + 1 = x3 + 2 = (x2+1) + 2 = x2 + 3 = x1 + 4
>
> Similary, I would like to know how to deal if there are two variable
> expressions, say
>
> x(i+1) = x(i) - (s_i) * (2^-i) * y(i)
> y(i+1) = y(i) + (s_i) *(2^-i) * x(i)
>
> for i =1, we have
>
> x_2 = x1 - s_1 (2^-1) y_1
> y_2 = y1 + s_1 (2^-1) x_1
>
> and for i = 2 it becomes
> x_3 = x1* (1 - (s_1) * (s_2) * (2^-3)) - y1* ((s_1) *  (2^-1) + (s_2)
> * (2^-2))
> y_3 = y1* (1 - (s_1) * (s_2) * (2^-3))  + x1* ((s_1) * (2^-1) + (s_2)
> * (2^-2))
>
> and so on .....
>
> I have tried to use Table, Nest, and few other functional iteration
> procedures. But, they seem to be giving the product of the terms
> rather than substituting to give the SUM of the terms in iterative
> manner.
>
> Hope some one can help me on this.
>
>
>



-- 

DrMajorBob at bigfoot.com


  • Prev by Date: Re: Iteratively determing successive values from previous
  • Next by Date: Re: Interpolation of data to form a parametric curve
  • Previous by thread: Re: Iteratively determing successive values from previous values....
  • Next by thread: Re: Iteratively determing successive values from previous values....