- To: mathgroup at yoda.physics.unc.edu
- Subject: Iterations..
- From: spagiola at leland.stanford.edu
- Date: Thu, 23 Apr 92 10:24:37 PDT
I'm looking for a way to achieve the following result a little more elegantly: a[s] g[%] a[%] g[%] a[%] g[%] ... You get the idea. I have a function a that takes an initial value of s as its argument. A second function g takes the result of a and modifies the value of s, which then passes back to a, etc. (If you're curious, this is for a natural resource model in which current actions affect the resource stock, which in turn affects future actions.) I'm sure this is quite simple and that I'm just missing something obvious, but after spending several hours playing with Do, NestList, FoldList etc, I cannot seem to get what I want. I also need to recover every value, so that i can plot a and s (separately). I'd also like to be able to either specify the number of iterations or let it converge to a point where it no longer changes. Any suggestions? Email to spagiola at leland.stanford.edu and I'll summarize. Thanks in advance, stefano pagiola