Mathematica 9 is now available
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: How to apply a function to a function multiple times

  • To: mathgroup at smc.vnet.net
  • Subject: [mg73470] Re: [mg73457] How to apply a function to a function multiple times
  • From: luhao <luhaorice at gmail.com>
  • Date: Sun, 18 Feb 2007 06:14:34 -0500 (EST)
  • References: <200702171002.FAA26271@smc.vnet.net>

Peng Yu wrote:
> Hi,
> 
> I have the following code.
> 
> iterater[hPrev_] := Integrate[Sqrt[1 + Derivative[1, 0][hPrev][x, t]^2], t]*v[x]
> h0[x_,t_]:=0
> h1[x_,t_]:=iterater[h0]
> h2[x_,t_]:=iterater[h1]
> h3[x_,t_]:=iterater[h2]
> 
> 
> I want to code another function,
> fun[h0_,v_,n_]
> where n is the times "iterator" has been applied.
> fun[h0,v,3] should give me h3[x_,t_] defined above.
> 
> fun[h0,v,4] should give me iterator[h3].
> 
> Can you show me how to do it?
> 
> Thank,
> Peng
> 
>

I believe Nest[] is what you want.

Hao


  • Prev by Date: Left-aligned PlotLabel
  • Next by Date: To dual-core or not to dual-core
  • Previous by thread: How to apply a function to a function multiple times
  • Next by thread: Re: How to apply a function to a function multiple times