Re: newbie: can't Manipulate ListPlot of recurrence
- To: mathgroup at smc.vnet.net
- Subject: [mg96797] Re: newbie: can't Manipulate ListPlot of recurrence
- From: Pillsy <pillsbury at gmail.com>
- Date: Wed, 25 Feb 2009 04:03:23 -0500 (EST)
- References: <go0j40$n0f$1@smc.vnet.net>
On Feb 24, 5:45 am, Tom Roche <tlro... at gmail.com> wrote: [...] > Clear[a, y]; > a=3.5; > y=0.4; > ListPlot[Table[y=a y (1-y),{50}],Joined->True] [...] Clear[a, y]; Manipulate[ ListPlot[Table[y=a y (1-y),{50}],Joined->True], {{a, 3.5}, 0, 4}, {{y, 0.4}, 0, 1}] > What am I doing wrong? and how can I Manipulate this map? What you're doing wrong is changing the values of the variable y while you compute the successive values of your logistic map. Manipulate wants to reflect the current value of y in its position along the control slider, and y bounces back and forth. Now, there are quite a few ways to get around this, but instead of a workaround, I think you're better off using the kernel function that's intended to be used with iterated maps like this one: NestList. Rest@NestList[a*#*(1-#)&, y, 50] will produce the same list of values as your Table expression, but y will not have its value modified. NestList will put the initial value (with 0 function applications) as the first element in the returned list, and Rest will get rid of it. If you stick that in your Mainpulate, it should just work. Cheers, Pillsy