Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Change function' topicStudent Support Forum > General > Archives > "Change function"

Next Comment >Help | Reply To Topic
Author Comment/Response
Will
02/05/12 08:41am

Hi!

I have the following code witch I found on http://demonstrations.wolfram.com/ClassicLogisticMap/

Manipulate[
limits =
Compile[{r},
Map[{r, #} &,
Union[Drop[ NestList[#*r (1 - #) &, .234, pts], 300]]]];
bifurcation[r0_, r1_, n_] :=
Flatten[Table[limits[r], {r, r0, r1, (r1 - r0)/n}], 1] ;
(*This formulation is modified from that given in Mathematica \
Navigator, 3rd edition by Heikki Ruskeepaa, Academic Press, 2009, \
page 941ff. This book is highly recommended for users of Mathematica \
6 or 7.*)ListPlot[ bifurcation[beginr, If[endr < 4, endr, 4], pts],
PlotStyle -> AbsolutePointSize[0.1],
AxesOrigin -> {beginr, ylow},
PlotRange -> {{beginr, If[endr < 4, endr, 4]}, {ylow, yhigh}},
AxesLabel -> {Style["r", 18, Bold],
Style["\!\(\*SubscriptBox[\(x\), \(n\)]\)", 18, Bold]},
PlotLabel ->
Style[Subscript[x, Style["n", Italic] + 1] \[LongEqual]
r Subscript[x,
Style["n", Italic]] (1 - Subscript[x, Style["n", Italic]]), 18,
Bold], ImageSize -> {600, 350}, Frame -> True,
ImagePadding -> 25,
Ticks -> {Range[beginr,
If[endr < 4, (endr), 4], ((If[endr < 4, (endr), 4]) - beginr)/
5], Range[0, 1, If[yhigh - ylow < .3, (yhigh - ylow)/10, 0.1]]}],
Grid[{{Control[{{beginr, 2.9, "beginning r"}, 1, 3.9999, .01,
ImageSize -> Small, Appearance -> "Labeled"}],
Control[{{yhigh, 1, "high end of y axis"}, .01, 1, .01,
ImageSize -> Small, Appearance -> "Labeled"}]},
{Control[{{endr, 4, "ending r"}, 2.9, 4, .01, ImageSize -> Small,
Appearance -> "Labeled"}],
Control[{{ylow, 0, "low end of y axis"}, 0, .99, .01,
ImageSize -> Small, Appearance -> "Labeled"}]}},
Alignment -> Right],
{{pts, 600, "number of points"}, 600, 3000, 300,
Appearance -> "Labeled"}, TrackedSymbols -> True,
SynchronousUpdating -> False
]

I want to change this code so that instead of having the function r*x(1-x), I would like to have the function 1-rx^2 with 0<r<2 and -1<x<1. I have tried but I can't fix this, so I would be very happy if someone could help me.

Please excuse me if my english isn't correct, I come from a non-english speaking country.

URL: ,

Subject (listing for 'Change function')
Author Date Posted
Change function Will 02/05/12 08:41am
Re: Change function Bill Simpson 02/09/12 11:39pm
Next Comment >Help | Reply To Topic