(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 13433, 501]*) (*NotebookOutlinePosition[ 14361, 533]*) (* CellTagsIndexPosition[ 14317, 529]*) (*WindowFrame->Normal*) Notebook[{ Cell["\<\ APPM 3010 Fall 1999 Nonlinear Dynamics and Chaos Lab#2. Iterations of Maps. Prof. Keith Julien (c) Prof. Hector E. Lomeli\ \>", "Title", Evaluatable->False, TextAlignment->Center, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Introduction.", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "In this lab, we will deal with iteration of maps. We will use the \ package ", StyleBox["Iteration", FontWeight->"Bold"], " written by ", StyleBox["Richard Moeckel ", FontWeight->"Bold"], "of the University of Minnesota. The following is a partial list of some of \ the fuctions that the package has . In this lab we will use the first five.\n\ ", StyleBox[ "Iterate\t\nOrbit \nTimeSeriesPlot \nCobwebPlot \n\ IteratePlot\nDelayPlot\nMinimalPeriod\nSeekPeriodicOrbit\nMultiplier", FontWeight->"Bold"], "\nThe first thing to do is load in the package. We need to change the \ working directory. Remember that to execute a command in Mathematica, you \ need to use the ", StyleBox["Enter ", FontWeight->"Bold"], "key or else hold the ", StyleBox["Shift ", FontWeight->"Bold"], "key down and press the", StyleBox[" Return ", FontWeight->"Bold"], "key. Use the following instruction to check the current directory and \ change it." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(Directory[]\)], "Input"], Cell[BoxData[ \(SetDirectory["\"]\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "Now we load the package ", StyleBox["Iteration", FontWeight->"Bold"] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(<< "\"\)], "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["On-line Help.", "Section", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ The package iteration has online help. Just type a quation mark and \ the name of the instruction for which you need help. For example, try the \ following.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(?Iterate\)\)], "Input"], Cell[BoxData[ \(\(?Orbit\)\)], "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Definition of the Dynamical System.", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "\nTo begin, we need to define our dynamical system. We will use logistic \ map ", StyleBox["r x(1-x)", FontWeight->"Bold"], ". This is a nice example because we can observe many bifurcations and \ chaos. Remember that it is important to use square brackets, the colon and \ the underscore character." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(f[x_] := r\ x\ \((1 - x)\)\)], "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["The orbit of a map.", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The instruction ", StyleBox[" Iterate[f,x0,n]", FontWeight->"Bold"], " finds what happens to any initial state, ", StyleBox["x0", FontWeight->"Bold"], ", after ", StyleBox["n ", FontWeight->"Bold"], "iterations. First it is a good idea to set ", StyleBox["r ", FontWeight->"Bold"], ". Note that you can type several command in the same cell using the ", StyleBox["Return", FontWeight->"Bold"], " key (without the", StyleBox[" Shift ", FontWeight->"Bold"], "key) to separate lines. When all the commands are typed you hit ", StyleBox["Enter", FontWeight->"Bold"], ". If you want ot prevent a result from being printed, use a semicolon." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[{ \(\(r = 1.5; \)\), \(Iterate[f, 0.1, 30]\)}], "Input", AspectRatioFixed->True], Cell[TextData[{ "The instruction ", StyleBox[" Orbit[f,x0,n] ", FontWeight->"Bold"], "will produce a list of the first ", StyleBox["n", FontWeight->"Bold"], " iterates of the function ", StyleBox["f", FontWeight->"Bold"], ", starting at ", StyleBox["x0", FontWeight->"Bold"], ". We will give it the name ", StyleBox["pedrito ", FontWeight->"Bold"], "so we can use it as input for other functions." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(pedrito = Orbit[f, 0.1, 30]\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "Now make a time series plot of this orbit. We use the instruction ", StyleBox["TimesSeriesPlot ", FontWeight->"Bold"], " to visualize the orbit. It is possible to manipulate the picture. Click \ on it to hightlight it and then click and drag one of the black boxes. " }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(TimeSeriesPlot[pedrito]\)], "Input", AspectRatioFixed->True], Cell[TextData[{ " To try some different values of ", StyleBox["r", FontWeight->"Bold"], ", just evaluate the next lines, changing ", StyleBox["r ", FontWeight->"Bold"], "each time. " }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[{ \(\(r = 3.2; \)\), \(TimeSeriesPlot[Orbit[f, 0.1, 50]]\)}], "Input", AspectRatioFixed->True], Cell[TextData[{ "Sometimes, we need to give the orbit time to settle down into a periodic \ pattern, if that occurs.We can use the instruction ", StyleBox["Orbit[f, 0.0, 50, 100] ", FontWeight->"Bold"], "to get the iterates ", StyleBox["101", FontWeight->"Bold"], " to ", StyleBox["150", FontWeight->"Bold"], ", i.e. the fourth argument specifies that the first ", StyleBox[" 100", FontWeight->"Bold"], " iterates should beskipped. So, in order to understand the different \ bifurcations, it is convenient to use the next few lines." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[{ \(\(r = 3.2; \)\), \(\(juanito = Orbit[f, 0.1, 50, 100]; \)\), \(TimeSeriesPlot[juanito]\)}], "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Cobweb analysis", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The instruction ", StyleBox["CobwebPlot ", FontWeight->"Bold"], "can be used to", StyleBox[" ", FontWeight->"Bold"], "plot the graph of the function and any number of orbits. The orbits \ should be computed using ", StyleBox["Orbit", FontWeight->"Bold"], ". The domain of the plot has to be specified. " }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[{ \(\(r = 3.2; \)\), \(orbit1 = Orbit[f, 0.1, 50, 100]; \nCobwebPlot[f, orbit1, {0, 1}]\)}], "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "We will add another orbit without the 100 step delay to see the \ convergence. The converging orbit will be plotted in gray and the limiting \ orbit in red using an option specification. In ", FontFamily->"Times"], StyleBox["Mathematica", FontFamily->"Times", FontSlant->"Italic"], StyleBox[ " optional parameters are often specified as a substitution rule of the \ form \n", FontFamily->"Times"], StyleBox["option -> value", FontFamily->"Times", FontWeight->"Bold"], StyleBox[ "\nYou type the arrow as a dash followed by a greater-than symbol. In this \ case we will specify a list of colors for the two lines in the plot. When a \ command gets long, it can be typed over several lines. A color in ", FontFamily->"Times"], StyleBox["Mathematica", FontFamily->"Times", FontSlant->"Italic"], StyleBox[" is a list ", FontFamily->"Times"], StyleBox["{r, g,b} ", FontFamily->"Times", FontWeight->"Bold"], StyleBox[ "of red green and blue values between 0 and 1 which are mixed to make the \ color, but there are some predefined colors to make life easier: ", FontFamily->"Times"], StyleBox[ "Black, White, Red, Green, Blue, Yellow, Purple, BlueGreen, Gray, LightGray \ and DarkGray.", FontFamily->"Times", FontWeight->"Bold"] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(orbit2 = Orbit[f, 0.1, 50]; \n\n CobwebPlot[f, {orbit2, orbit1}, {0, 1}, LineColor \[Rule] {Gray, Red}]\)], "Input", AspectRatioFixed->True], Cell[TextData[{ "\nIf the parameter ", StyleBox["r ", FontWeight->"Bold"], "gives us a chaotic map, the corresponding cobweb gets verycomplex. For \ example try the following." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[{ \(\(r = 4.0; \)\), \(\(chaos = Orbit[f, 0.1, 100]; \)\), \(CobwebPlot[f, chaos, {0, 1}]\)}], "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Higher Iterates", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "The instruction", StyleBox[" IteratePlot", FontWeight->"Bold"], " uses symbolic formulas for the iterates of", StyleBox[" f", FontWeight->"Bold"], " to draw their graphs. For example, here is the ", StyleBox["6", FontWeight->"Bold"], " th iterate of the chaotic map that corresponds to", StyleBox[" r=4.", FontWeight->"Bold"], " Notice that we are plotting on the domain ", StyleBox["{0,1}", FontWeight->"Bold"], "." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[{ \(\(r = 4.0; \)\), \(IteratePlot[f, 6, {0, 1}]\)}], "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Another example", "Section"], Cell[TextData[{ "In this example we will check that a function has an orbit of period \ three. After defining a function ", StyleBox["g", FontWeight->"Bold"], ", we plot the first and third iterates. " }], "Text"], Cell[BoxData[ \(g[x_] := \(-1\) - x\/2 + \(3\ x\^2\)\/2\)], "Input"], Cell[BoxData[{ \(IteratePlot[g, 1, {\(-2\), 2}]\), \(IteratePlot[g, 3, {\(-2\), 2}]\)}], "Input"], Cell[TextData[{ "Sarkovskii's Theorem implies that we will be able to find a periodic orbit \ of any period. For instance, lets try to find a periodic orbit of period ", StyleBox["5", FontWeight->"Bold"], ". We can use ", StyleBox["SeekPeriodicOrbit", FontWeight->"Bold"], " to find it." }], "Text"], Cell[BoxData[ \(IteratePlot[g, 5, {\(-2\), 2}]\)], "Input"], Cell[BoxData[ \(\(?SeekPeriodicOrbit\)\)], "Input"], Cell[BoxData[ \(SeekPeriodicOrbit[g, 5, \ 0.5]\)], "Input"], Cell[TextData[{ StyleBox["Note: ", FontWeight->"Bold"], " do not try to use SeekPeriodicOrbit with a large ", StyleBox["q", FontWeight->"Bold"], ". In the previous example, the degree of the ", StyleBox["n-th", FontWeight->"Bold"], " iterate of ", StyleBox["g", FontWeight->"Bold"], " is ", StyleBox["2^n", FontWeight->"Bold"], "." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox["Exercises", Background->None]], "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["You should try ", FontFamily->"times", FontSize->14, FontWeight->"Plain"], StyleBox["r =2.9, 2.95, 3.0, 3.1, 3.2, 3.5, 3.55, 3.84, 3.845, 4.0", FontFamily->"times", FontSize->14, FontWeight->"Bold"], StyleBox[".", FontFamily->"times", FontSize->14], StyleBox[ " In each case try to identify the asymptotic period, if any. Observe the \ period doubling that occurs near", FontFamily->"times", FontSize->14, FontWeight->"Plain"], StyleBox[" r=3.0.", FontFamily->"times", FontSize->14, FontWeight->"Bold"] }], "Text", AspectRatioFixed->True] }, Closed]] }, FrontEndVersion->"X 3.0", ScreenRectangle->{{0, 1280}, {0, 1024}}, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{542, 600}, WindowMargins->{{172, Automatic}, {Automatic, 77}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, 128}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, CharacterEncoding->"XAutomaticEncoding", StyleDefinitions -> "Classroom.nb" ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1709, 49, 219, 9, 216, "Title"], Cell[CellGroupData[{ Cell[1953, 62, 80, 2, 57, "Section"], Cell[2036, 66, 1084, 30, 70, "Text"], Cell[3123, 98, 44, 1, 70, "Input"], Cell[3170, 101, 88, 2, 70, "Input"], Cell[3261, 105, 153, 6, 70, "Text"], Cell[3417, 113, 77, 2, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[3531, 120, 80, 2, 37, "Section"], Cell[3614, 124, 228, 6, 70, "Text"], Cell[3845, 132, 45, 1, 70, "Input"], Cell[3893, 135, 69, 2, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[3999, 142, 102, 2, 37, "Section"], Cell[4104, 146, 388, 10, 70, "Text"], Cell[4495, 158, 85, 2, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[4617, 165, 86, 2, 37, "Section"], Cell[4706, 169, 772, 25, 70, "Text"], Cell[5481, 196, 104, 3, 70, "Input"], Cell[5588, 201, 503, 19, 70, "Text"], Cell[6094, 222, 86, 2, 70, "Input"], Cell[6183, 226, 354, 8, 70, "Text"], Cell[6540, 236, 82, 2, 70, "Input"], Cell[6625, 240, 262, 10, 70, "Text"], Cell[6890, 252, 118, 3, 70, "Input"], Cell[7011, 257, 628, 18, 70, "Text"], Cell[7642, 277, 157, 4, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[7836, 286, 82, 2, 37, "Section"], Cell[7921, 290, 408, 14, 70, "Text"], Cell[8332, 306, 152, 4, 70, "Input"], Cell[8487, 312, 1409, 40, 70, "Text"], Cell[9899, 354, 169, 4, 70, "Input"], Cell[10071, 360, 246, 8, 70, "Text"], Cell[10320, 370, 156, 4, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[10513, 379, 82, 2, 37, "Section"], Cell[10598, 383, 538, 19, 70, "Text"], Cell[11139, 404, 110, 3, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[11286, 412, 34, 0, 37, "Section"], Cell[11323, 414, 223, 6, 70, "Text"], Cell[11549, 422, 72, 1, 70, "Input"], Cell[11624, 425, 106, 2, 70, "Input"], Cell[11733, 429, 317, 9, 70, "Text"], Cell[12053, 440, 63, 1, 70, "Input"], Cell[12119, 443, 55, 1, 70, "Input"], Cell[12177, 446, 63, 1, 70, "Input"], Cell[12243, 449, 383, 16, 70, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[12663, 470, 116, 3, 37, "Section"], Cell[12782, 475, 635, 23, 70, "Text"] }, Closed]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)