• To: mathgroup at christensen.cybernetics.net
• Subject: [mg1952] Re: question about nest
• From: jfs at he3.neep.wisc.edu (John F. Santarius)
• Date: Sat, 26 Aug 1995 00:09:57 -0400
• Organization: University of Wisconsin

```In article <DDsGrD.Gy6 at wri.com> ORLANDO LUIS GOULART PERES <orlando at axp.ift.unesp.br> writes:

I have a function with two variables
f[x_,a_]:=a*x*(1-x)
And I need the n-compose function
Nest[f,x,n]
But Mathematica look for a function f[x] and not f[x,a]
Is this possible to use Nest with this two variable function?
For example, I need
f[x,a], f[f[x,a],a], f[f[f[x,a],a],a] .
Later I will put many values for "a" .

Try Nest[ f[#,a]&, x, n ].  For example,

In[1]:= f[x_,a_] := a x (1-x)

In[2]:= Nest[ f[#,a]&, x, 2 ]

2
Out[2]= a  (1 - x) x (1 - a (1 - x) x)

==============================================================================
John F. Santarius, Fusion Technology Institute, University of Wisconsin,
1500 Engineering Dr., Madison, WI 53706, USA
E-mail: santarius at engr.wisc.edu       Ph: 608/263-1694       Fax: 608/263-4499
==============================================================================
--
==============================================================================
John F. Santarius, Fusion Technology Institute, University of Wisconsin,
1500 Engineering Dr., Madison, WI 53706, USA
E-mail: santarius at engr.wisc.edu       Ph: 608/263-1694       Fax: 608/263-4499
==============================================================================

```

• Prev by Date: Re: Q: ArcTan[ Tan[ x ] ] = x
• Next by Date: Re: Plotting Piecewise Functions with Discontinuites