RE: Cobweb Plot
- To: mathgroup at smc.vnet.net
- Subject: [mg27530] RE: [mg27494] Cobweb Plot
- From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.de>
- Date: Sat, 3 Mar 2001 03:40:11 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
See below for my answer: -----Original Message----- From: Jon Joseph [mailto:pokemon at tds.net] To: mathgroup at smc.vnet.net Subject: [mg27530] [mg27494] Cobweb Plot I have been experimenting with chaotic systems and have been trying to produce a "Cobweb Plot". A description of this type of plot, taken from "CHAOS An Introduction to Dynamical Systems" by Alligood, Sauer, Yorke, is "A cobweb plot illustrates convergence to an attracting fixed point of g(x)=2x(1-x). Let x0=0.1 be the initial condition. Then the first iterate is x1=g(x0)=0.18. Note that the point (x0,x1) lies on the function graph, and (x1,x1) lies on the diagonal line. Connect these points with a horizontal dotted line to make a path. Then find x2=g(x1)=0.2952, and continue the path with a vertical dotted line to (x1, x2) and with a horizontal dotted line to (x2, x2). An entire orbit can be mapped out this way." I can create the data in a procedural program and then plot the list that results. Can anyone think of a more elegant, Mathematica oriented, approach? Thanks in advance Dr. Jon Joseph VP of Advanced Technology Nicolet Biomedical 5225 Verona Road Madison WI 53711 jjoseph at nicoletbiomedical.com ---------------- Hello Jon, if you would like this In[39]:= g[r_] := Function[x, r x (1 - x)] In[40]:= r = 2.9; x0 = 0.5; n = 10; (* or r = 2.0; x0 = 0.1; *) In[41]:= l = Flatten[Block[{x}, NestList[ {{x = Last[Last[#1]], x}, {x, g[r][x]}} & , {{x0, 0}, {x0, x0}}, n]], 1]; In[42]:= Plot[{g[r][x], x}, {x, 0., 1.}, PlotRange -> All, AspectRatio -> Automatic, Epilog -> {Hue[0], Dashing[{0.01}], Line[l]}]; then you most certainly would like to read §7 Function Iteration and Chaos of Roman E. Maeder: "The Mathematica Programmer II" see e.g. http://www.amazon.com/exec/obidos/ASIN/0124649920 You also might like to visit the author's web side http://www.mathconsult.ch/showroom/pubs/MathProg/htmls/2-07.htm from where you may download a package and a notebook on your theme! -- Hartmut