Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*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 2006

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

Search the Archive

Re: calculate Recurrence Equations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68755] Re: calculate Recurrence Equations
  • From: "Mark Westwood" <markc.westwood at gmail.com>
  • Date: Fri, 18 Aug 2006 03:11:59 -0400 (EDT)
  • References: <ec1a1u$omo$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Frank

Check the section 2.5.9 in The Mathematica Book for an explanation of
this solution.  Modify your second definition to read:

anteil[n_] := anteil[n]=anteil[n - 1] + (anteil[n - 1]*5 - 1)/100

The effect of this is that the values of anteil[n] are stored when
first calculated, and not recalculated next time they are required.
You can see the effect by executing ?anteil after executing the
function.

On my PC anteil[30] runs in a second or so.

Regards
Mark Westwood

Frank Hechtner wrote:
> hi,
>
> i?m in trouble with my Recurrence Equations:
>
> i?ve defined the following function
>
> anteil[0] = 1
> anteil[n_] := anteil[n - 1] + (anteil[n - 1]*5 - 1)/100
>
> i want mathematica to calculate the values for anteil[30] and so on.
>
> Unfortunately mathematica needs for this calculation over 2 hours (and
> is still running, athlon x2 4600, 2 gb ram).
>
> I don?t see where are the difficulties for mathematica...
> 
> Thanx for your help
> 
> frank


  • Prev by Date: Preventing NIntegrate from reevaluating after DumpSave and Get
  • Next by Date: Re: calculate Recurrence Equations
  • Previous by thread: Re: calculate Recurrence Equations
  • Next by thread: Re: calculate Recurrence Equations