MathGroup Archive 2002

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

Search the Archive

Re: Difference /recurrence equations


On Tuesday, June 25, 2002, at 02:42 AM, Andrew Biggs wrote:

> I'm new to Mathematica and am having trouble with inputting the
> equations I'm looking to solve. I know the basic input of RSolve, but
> can't quite get it. Here's a sample problem, if anyone could show me
> how to input into RSolve I can probably run with the ball after that.
>
> y(t+2) - 2Y(t+1) + 3Y(1) = 4
>
> With the part in brackets being a subscript denoting time. I know it
> sounds dumb, but I just don't know the input notatin well enough to
> get a problem typed in correctly, and the Mathematica book is a little
> overwhelming.
>
> Any help greatly appreciated!
>
> Andrew

First, load the AddOn  RSolve package:

<<DiscreteMath`RSolve

Then apply to your problem. For example, for the given difference 
equation and initial conditions {y[0]==0, y[1]==1},

sol=RSolve[ {y[k+2] - 2*y[k+1] + 3*y[k] == 4, y[0]==0, y[1]==1}, y[k], k]

============
   Hugh Walker
    Gnarly Oaks



  • Prev by Date: Mathematica: Modular arithmetic with nonnumber
  • Next by Date: Re: Finding a formula for a sum
  • Previous by thread: Re: Difference /recurrence equations
  • Next by thread: RE: Difference /recurrence equations