.M:4 Name___________________________________________ Assignment #________ Assignment completed: Yes / No Turned in on time: Yes / No Total points earned: 0 / 1 / 2 Prefer future homework to be: Easier / Same / Harder Number of hours required to complete the assignment:___________________ Total number of hours spent on the course during the week:_____________ Name(s) of anyone you worked with:_____________________________________ Computer type used:____________________________________________________ Programming language used______________________________________________ Comments: Please fill out this cover sheet and staple your homework to it.  .M:1 Assignment #1 The Logistic Equation Due 3:30 pm, September 12, 2000 This assignment is intended to get you started using the computer to model chaotic processes and to explore some of the more obvious properties of the logistic equation. The logistic equation is perhaps the simplest example of a chaotic system. It models a process that exhibits initial exponential growth with a nonlinearity that ultimately stops the growth. Most of the common features of chaos are manifest in this simple example. Note that a BASIC computer code for iterating the logistic equation is included in Appendix E (page 620) of your text. Start with an initial condition of xo = 0.1 and iterate the logistic equation xn+1 = A xn (1 - xn) many times. 1. Show that the solution approaches a fixed point for 0 < A < 3, a periodic orbit for 3 < A < 3.5699..., and a chaotic orbit for A = 4. 2. What happens to the trajectory for A < 0 and A > 4? 3. What happens in each case above if the initial condition is changed to xo = 0.101? 4. What happens if the initial condition is xo < 0 or xo > 1? Optional: 5. Can you find some initial conditions xo for which the solution is bounded (doesn't go off to infinity) but not chaotic for A = 4? (Hint: Calculate algebraically a value xo at which one of the successive iterates is also xo, giving a cycle that repeats. There are infinitely many such values of xo in the range 0 < xo < 1, but the probability that you will find one by randomly guessing is zero; they constitute a "set of measure zero.")  .M:4 Name___________________________________________ Assignment #________ Assignment completed: Yes / No Turned in on time: Yes / No Total points earned: 0 / 1 / 2 Prefer future homework to be: Easier / Same / Harder Number of hours required to complete the assignment:___________________ Total number of hours spent on the course during the week:_____________ Name(s) of anyone you worked with:_____________________________________ Computer type used:____________________________________________________ Programming language used______________________________________________ Comments: Please fill out this cover sheet and staple your homework to it.  .M:1 Assignment #2 Bifurcation Diagrams Due 3:30 pm, September 19, 2000 This assignment is a continuation of last week's in which you will further explore the properties of the logistic equation. You will observe the common period-doubling route to chaos and will display your results graphically. The ability to produce and print graphs will be essential in all future assignments. Recall the logistic equation, xn+1 = A xn (1 - xn) which is a prototypical chaotic system that exhibits many of the phenomena seen in chaotic processes in nature. 1. For this equation, produce a bifurcation diagram like Figure 1.14 on page 27 of the text. You can start with (almost) any initial condition in the range 0 < xo < 1, but be sure to discard a sufficient number of the initial iterates before plotting the remaining ones. 2. Expand this plot in the range 3.0 < A < 3.57, where successive period doublings occur, and use your plot to estimate the Feigenbaum numbers ("Feigenvalues") ë and à (see Chapter 2 of the text for a definition). 3. Expand your plot in the vicinity of the period-3 window at about A = 3.84 and show that it also exhibits a sequence of period doublings prior to the onset of chaos. 4. Stable orbits of all periods can be found somewhere in the range 3.0 ó A < 4.0. Find a value of A at which the orbit has period-5. Optional: 5. See how many of the higher odd-integer periodic orbits (7, 9, 11, ...) you can find. (Hint: The periodic windows become successively more narrow as the period increases, but there are rules that you might discover and use to locate them; see section 5.5 in the text.)  .M:4 Name___________________________________________ Assignment #________ Assignment completed: Yes / No Turned in on time: Yes / No Total points earned: 0 / 1 / 2 Prefer future homework to be: Easier / Same / Harder Number of hours required to complete the assignment:___________________ Total number of hours spent on the course during the week:_____________ Name(s) of anyone you worked with:_____________________________________ Computer type used:____________________________________________________ Programming language used______________________________________________ Comments: Please fill out this cover sheet and staple your homework to it.  .M:1 Assignment #3 Van der Pol Equation Due 3:30 pm, September 26, 2000 In this assignment, you will learn to solve a system of differential equations numerically. You will demonstrate the accuracy of your method by applying it to a simple harmonic oscillator and then to the van der Pol equation whose solution is a limit cycle (a periodic attractor). The van der Pol equation has been used to model electrical oscillators, heartbeats, and pulsating stars called Cepheids. The numerical method will be needed for several future assignments. The van der Pol oscillator is described by: dx/dt = y dy/dt = b(1-xý)y - x 1. Start with b = 0, in which case the van der Pol oscillator reduces to a simple harmonic oscillator. With an initial condition of x(0) = 1 and y(0) = 0, the trajectory should then be a circle in the xy-plane of radius 1. Use the fourth-order, Runge-Kutta or another suitable method to solve this system from t = 0 to at least t = 100, and verify the reliability of your result by showing that the trajectory doesn't spiral either inward or outward. You might do this either graphically or by calculating the value of xý + yý at each time step. 2. Set b = 1 and show that various initial values of x(0) and y(0) are attracted to a limit-cycle curve. 3. What is the effect of changing the value of b (both positive and negative values)? Optional: 4. Add a sinusoidal drive term (A sin Çt) to the right-hand side of the second equation and explore the behavior of the system for various values of A and Ç. You should be able to observe conditions under which the oscillation frequency locks onto the frequency of the drive (entrainment) and other conditions where the limiting solution is not simply periodic, but rather is either quasi-periodic (a superposition of two incommensurate oscillations) or chaotic.  Solving Differential Equations by Fourth-Order Runge-Kutta Suppose you have a system of differential equations of the form dx/dt = f(x,y) dy/dt = g(x,y) where f(x,y) and g(x,y) are arbitrary functions of x and y, and you wish to determine how x and y vary with time (t) subject to some initial condition x(0) and y(0). There are many numerical techniques for approximating the solution to such an equation. They all involve successively advancing x and y in small time steps h. You should choose h to be as small as practical, subject to the limitation that the computation time varies inversely with h. For many problems a value of h = 0.01 is a good initial choice, but you would be wise to verify that your results do not depend sensitively on h. This is usually done by making h twice as large and checking to see that the results are sufficiently close for your purposes. One method that works very well, while not being overly complicated, is the fourth-order, Runge-Kutta method. In this method, the values of x and y at the next time step (xn+1 and yn+1) are determined from their previous values (xn and yn) according to the following approximations: xn+1 ÷ xn + k1x/6 + k2x/3 + k3x/3 + k4x/6 yn+1 ÷ yn + k1y/6 + k2y/3 + k3y/3 + k4y/6 where k1x = hf(xn,yn) k1y = hg(xn,yn) k2x = hf(xn+k1x/2,yn+k1y/2) k2y = hg(xn+k1x/2,yn+k1y/2) k3x = hf(xn+k2x/2,yn+k2y/2) k3y = hg(xn+k2x/2,yn+k2y/2) k4x = hf(xn+k3x,yn+k3y) k4y = hg(xn+k3x,yn+k3y) This method can be generalized to functions of three or more variables. If your functions involve the variable t or include higher derivatives, you can always reduce the system to a system of first- order differential equations by defining additional new variables.  .M:4 Name___________________________________________ Assignment #________ Assignment completed: Yes / No Turned in on time: Yes / No Total points earned: 0 / 1 / 2 Prefer future homework to be: Easier / Same / Harder Number of hours required to complete the assignment:___________________ Total number of hours spent on the course during the week:_____________ Name(s) of anyone you worked with:_____________________________________ Computer type used:____________________________________________________ Programming language used______________________________________________ Comments: Please fill out this cover sheet and staple your homework to it.  .M:1 Assignment #4 Lorenz Attractor Due 3:30 pm, October 3, 2000 In this assignment, you will extend the method you developed last week for numerically solving a system of differential equations to three dimensions and will use it to study the Lorenz equations, the first documented example of a flow whose limiting solution is a chaotic attractor. You may use the Fourth-Order, Rung‚-Kutta method or another suitable numerical method of your choosing. You will recreate Lorenz's discovery of the sensitivity to initial conditions. The Lorenz equations are: dx/dt = p(y - x) dy/dt = -xz + rx - y dz/dt = xy - bz The values that Lorenz used for the parameters are p = 10, r = 28, and b = 8/3. 1. Start with an arbitrary initial condition at t = 0 reasonably close to the attractor (but not the fixed point x = y = z = 0!) and solve the Lorenz equations numerically using his parameters. Make a graph in the zy-plane and show that different initial conditions are drawn to the attractor. (See Fig. 1.19 on page 36 in the text.) 2. Make a graph of x versus t over the range 25 < t < 50, presuming that by t = 25 you are on the attractor. 3. Determine the exact values of x, y, and z at t = 25 and rerun the calculation using those values as initial conditions but rounded to three significant digits. Show that x(t) for the two cases initially coincide, but that the small error eventually grows to the size of the attractor. Optional: 4. Study the behavior of the system as the parameter r is varied over the range 0 < r < 200. You should be able to observe point attractors, limit cycles, and chaos. Look carefully in the range 99 < r < 101, where a periodic window occurs within which there is a period- doubling cascade with the same Feigenbaum constants as in the logistic map.  .M:4 Name___________________________________________ Assignment #________ Assignment completed: Yes / No Turned in on time: Yes / No Total points earned: 0 / 1 / 2 Prefer future homework to be: Easier / Same / Harder Number of hours required to complete the assignment:___________________ Total number of hours spent on the course during the week:_____________ Name(s) of anyone you worked with:_____________________________________ Computer type used:____________________________________________________ Programming language used______________________________________________ Comments: Please fill out this cover sheet and staple your homework to it.  .M:1 Assignment #5 H‚non Map Due 3:30 pm, October 10, 2000 In this assignment, you will examine the properties of the H‚non map, which is probably the most studied example of a two-dimensional chaotic map. You will observe the self-similar (fractal) structure of the chaotic attractor. The H‚non map is a 2-D generalization of the 1- D logistic equation, and was proposed by H‚non as a model of the Poincar‚ section that arises from a solution of the Lorenz equations. The H‚non map is given by the following equations: xn+1 = 1 - Cxný + Byn yn+1 = xn The usual choice for the parameters B and C that give chaotic solutions are B = 0.3 and C = 1.4. Be careful to advance x and y simultaneously, NOT sequentially (i.e., don't accidentally use the value of xn+1 determined from the first equation above instead of xn when you evaluate yn+1 from the second equation above). 1. Using the parameters above, choose initial conditions x0 and y0 somewhere in the basin of attraction, and make a plot of xn versus n to verify that the solution is bounded and apparently chaotic. 2. Start with two nearby initial conditions and show that their separation increases rapidly as expected for a chaotic system. 3. Make a plot of several thousand values of yn versus xn after discarding a sufficient number of initial iterates to ensure that the plotted points lie on the (strange) attractor. 4. Expand your plot above in the vicinity of the double lines that you should have seen and convince yourself that what look like individual lines are (upon magnification) really pairs of lines, each of which are pairs of lines, ad infinitum. Optional: 5. Make a plot of the basin of attraction (those initial values of x0 and y0 that don't escape to infinity) for the H‚non map with the parameters given above. Overlay the plot of the basin onto the plot of the attractor.  .M:4 Name___________________________________________ Assignment #________ Assignment completed: Yes / No Turned in on time: Yes / No Total points earned: 0 / 1 / 2 Prefer future homework to be: Easier / Same / Harder Number of hours required to complete the assignment:___________________ Total number of hours spent on the course during the week:_____________ Name(s) of anyone you worked with:_____________________________________ Computer type used:____________________________________________________ Programming language used______________________________________________ Comments: Please fill out this cover sheet and staple your homework to it.  .M:1 Assignment #6 Lyapunov Exponent Due 3:30 pm, October 17, 2000 In this assignment, you will develop a numerical test for the presence of chaos in the solution of a system of equations. This test will consist of estimating the largest Lyapunov exponent. If the solution is bounded and has a positive value of the largest Lyapunov exponent, it is generally considered to be chaotic. This test allows you to automate the detection of chaos while scanning through a range of parameters in a numerical experiment and to quantify the sensitivity to initial conditions. It is the most reliable way to distinguish between quasi-periodicity and chaos. Unfortunately the text (pages 196-198) does not explain the method in dimensions higher than 1-D, but there's an outline of the procedure on the WWW at http://sprott.physics.wisc.edu/chaos/lyapexp.htm. 1. Calculate numerically the largest Lyapunov exponent for the H‚non map, xn+1 = 1 - Cxný + Byn yn+1 = xn with the usual parameters of B = 0.3 and C = 1.4. Do this by iterating the equations a few dozen times to be sure the solution is on the attractor and then looking at the average logarithmic rate of separation of two nearby orbits separated by a distance d: N-1 È1  = lim ä log(dn+1/dn) / N NÍì n=0 Be sure d remains small compared to the size of the attractor and that it is oriented along the direction of fastest growth. You should get a value close to 0.418 per iteration (for loge) or 0.603 bits per iteration (for log2). (Note that the other Lyapunov exponent is easily obtained from È1 + È2 = log|B|.) 2. Make a plot of È1 versus N to ensure that your estimate of the exponent has settled down to a unique value. 3. Make a plot of È1 versus C over the range of 0 < C < 2. You should see a period-doubling route to chaos (È1 = 0 at each bifurcation point) and periodic windows (regions of negative È1) within the chaotic region, similar to the case for the logistic equation. Optional: 4. Use different nonlinear functions f(x,y) and g(x,y) of your choosing and try to discover some new examples of strange attractors. If you find some particularly interesting cases, I'd like to show them to the class unless you object.  .M:4 Name___________________________________________ Assignment #________ Assignment completed: Yes / No Turned in on time: Yes / No Total points earned: 0 / 1 / 2 Prefer future homework to be: Easier / Same / Harder Number of hours required to complete the assignment:___________________ Total number of hours spent on the course during the week:_____________ Name(s) of anyone you worked with:_____________________________________ Computer type used:____________________________________________________ Programming language used______________________________________________ Comments: Please fill out this cover sheet and staple your homework to it.  .M:1 Assignment #7 Poincar‚ Sections Due 3:30 pm, October 24, 2000 In this assignment, you will teach yourself how to make Poincar‚ sections using a driven, damped, nonlinear oscillator as an example. All real oscillators are nonlinear if driven to sufficiently large amplitude, and thus this example is really very general. The Poincar‚ section allows you to distinguish between quasi-periodic and chaotic behavior and to observe the fractal structure of a strange attractor whose dimension is between 2 and 3, as is the case for dissipative chaotic flows in three dimensions. The equations you will use are the Ueda equations, which are a restricted form of Duffing's equation and model a mass on a hard spring in which the restoring force is proportional to -x3 rather than the usual -x as in Hooke's law: dx/dt = y dy/dt = -by - x3 + A sin t You should use the usual trick of converting the equations into autonomous form by changing sin t to sin z and adding an equation dz/dt = 1 1. Use the fourth-order Rung‚-Kutta or another suitable technique to solve the equations above in their chaotic regime. Values of b = 0.1 and A = 12 should produce a chaotic solution. As usual, calculate for a while to be sure the trajectory has reached the attractor, and then show a plot of x(t) that suggests chaotic behavior. 2. Make a Poincar‚ section plot of y versus x at times for which sin t = 0 and cos t = 1 (i.e., at constant phase of the drive term). Try to accumulate at least a few thousand points. This may take a while if you have a slow computer or compiler, but it's worth the wait. 3. Repeat 2 above using b = 0.2 and b = 0.4. Since b is the damping (friction), try to draw a general conclusion about the effect of increasing the damping in a chaotic system. Optional: 4. With b = 0.1, vary A over the range 9 < A < 14 and see what kind of bifurcations you can observe in the Poincar‚ sections. For A = 9.8 you should see a period-3 orbit. The period-3 motion should bifurcate to chaos around A = 10 and then should become periodic again with transient chaos beyond A = 13.3. [Ref: Y. Ueda, "Randomly Transitional Phenomena in the System Governed by Duffing's Equation," J. Stat. Phys. 20, 181 (1979).]  .M:4 Name___________________________________________ Assignment #________ Assignment completed: Yes / No Turned in on time: Yes / No Total points earned: 0 / 1 / 2 Prefer future homework to be: Easier / Same / Harder Number of hours required to complete the assignment:___________________ Total number of hours spent on the course during the week:_____________ Name(s) of anyone you worked with:_____________________________________ Computer type used:____________________________________________________ Programming language used______________________________________________ Comments: Please fill out this cover sheet and staple your homework to it.  .M:1 Assignment #8 Chirikov Map Due 3:30 pm, October 31, 2000 In this assignment, you will examine the most famous area- preserving, two-dimensional map, called the standard map or Chirikov map. It exhibits most of the phenomena that are observed in chaotic Hamiltonian systems such as the driven, frictionless pendulum, the ball bouncing elastically on an oscillating floor, and the toroidal magnetic field in the presence of small perturbations. The Chirikov map is given by rn+1 = [rn - (K/2ã)sin(2ãén)] mod 1 én+1 = [én + rn+1] mod 1 Note that this time (unlike the H‚non map in Assignment #5 and #6), the r in the second equation is really rn+1, not rn, and so the equations can be iterated sequentially. Note also that the mod function doesn't work properly for non-integers in many programming languages, but that you can implement it with statements such as the following: IF x >= 1 THEN x = x - INT(x) IF x < 0 THEN x = INT(x) - x 1. With K = 1, start with 25 different initial conditions r0 = é0 = i/25 for i = 1 to 25 and plot a few thousand iterates for each case on the same plot. (There are some figures on pages 354 and 355 of the text with which you may want to compare.) You should see that some initial conditions produce periodic orbits, while others seem ergodic. 2. Repeat the above with K = 0.5 and with K = 2. 3. Find a region of one of your plots that contains interesting structure and zoom in on it (using appropriate and more closely spaced initial conditions) to show that the structure appears to persist on all size scales. You may need to increase the number of iterations as you did with the H‚non map in Assignment #5. Optional: 4. Select a thousand or more initial points within a small circle in the chaotic region (the "stochastic sea") and follow them forward for a few iterations, showing that they stretch but that the area occupied by the points remains constant in accordance with Liouville's theorem. Estimate the largest Lyapunov exponent from the rate of stretching. You may also want to apply the method you developed in Assignment #6 to the calculation of the largest Lyapunov exponent.  .M:4 Name___________________________________________ Assignment #________ Assignment completed: Yes / No Turned in on time: Yes / No Total points earned: 0 / 1 / 2 Prefer future homework to be: Easier / Same / Harder Number of hours required to complete the assignment:___________________ Total number of hours spent on the course during the week:_____________ Name(s) of anyone you worked with:_____________________________________ Computer type used:____________________________________________________ Programming language used______________________________________________ Comments: Please fill out this cover sheet and staple your homework to it.  .M:1 Assignment #9 Autocorrelation Function Due 3:30 pm, November 7, 2000 In this assignment, you will begin to develop a set of tools for the analysis of time-series data. One of the first tests to perform on an experimental time-series record is to calculate the autocorrelation function, from which an autocorrelation time can be estimated (see page 436ff. in the text). Knowledge of the correlation function is often sufficient to distinguish quasi-periodicity from chaos, and the correlation time is an important variable in the application of more advanced techniques. The correlation function is the Fourier transform of the power spectrum. 1. Numerically solve the Lorenz equations (page 31 in the text) with the usual parameters of p = 10, r = 28, and b = 8/3. Allow enough time to elapse for the trajectory to reach the attractor and then generate and plot a series of 1000 data points representing x(t) at equally spaced time intervals of Æt = 0.05. Call these values Xi for i = 1 to N. Hereafter you will assume that this time series is from some experiment sampled 20 times per second and you will pretend that you don't know anything else about the dynamics of the system that produced the time series. 2. Calculate and plot the autocorrelation function g(n) versus n for your time series, where g(n) is given approximately by N-n N-n g(n) = ä (Xi-Xav)(Xi+n-Xav) / ä (Xi-Xav)ý i=1 i=1 and Xav is the average value of Xi: N Xav = ä Xi / N i=1 3. Estimate the value of n at which g(n) falls to 1/e of its value at n = 0, and from this value find the autocorrelation time in units of seconds. Optional: 4. Plot the autocorrelation function for a time series from each of the cases below: a) a sine wave with many cycles b) a random-number generator c) successive iterates of the logistic map d) the superposition of two incommensurate sine waves e) the integral of a collection of random numbers with zero mean  .M:4 Name___________________________________________ Assignment #________ Assignment completed: Yes / No Turned in on time: Yes / No Total points earned: 0 / 1 / 2 Prefer future homework to be: Easier / Same / Harder Number of hours required to complete the assignment:___________________ Total number of hours spent on the course during the week:_____________ Name(s) of anyone you worked with:_____________________________________ Computer type used:____________________________________________________ Programming language used______________________________________________ Comments: Please fill out this cover sheet and staple your homework to it.  .M:1 Assignment #10 Time-Delay Reconstruction Due 3:30 pm, November 14, 2000 This assignment is intended to convince you that you can take a single variable of a chaotic system (in this case the Lorenz attractor) sampled at discrete times and reconstruct an attractor in arbitrary dimension that has the same topological properties as the original attractor. This procedure is a necessary step in the analysis of chaotic experimental data. Examination of such plots will often reveal periodicities that are not apparent in a graph of the original time series. This assignment is an extension of assignment #9 from last week. In fact, you may use the same data set you generated last week. 1. Using a time-series of 1000 points from the x-coordinate of the Lorenz attractor with the usual parameters of p = 10, r = 28, and b = 8/3, sampled at equally spaced time intervals of Æt = 0.05, after discarding the initial transient, make a plot of Xi versus Xi-n for n = 1, 2, 4, and 8. Convince yourself that the resulting plot resembles the plot of the original Lorenz attractor. Is there an optimal value for n, and how does it relate to the correlation time you calculated last week for the same data? 2. Make a phase-space plot of your time series (i.e., plot dx/dt versus x). For this purpose, it will suffice to approximate dx/dt by (Xi+1 - Xi-1)/2Æt. Convince yourself that this plot also resembles the original Lorenz attractor. This method tends to be inferior to the method of time delays above whenever the data record contains significant noise. 3. Make a return-map plot of your data, for example by plotting the local maximum of x versus the previous local maximum, and show that the plot appears to be one-dimensional. (It is actually a fractal with small scale structure that would appear under high magnification if you had a sufficient number of data points.) To find the local maximum, it will suffice to plot those points whose two nearest neighbors are smaller, although to see the fractal structure, you would need to do slightly better by fitting these three points to a parabola whose maximum you calculate analytically and/or by using a smaller value of Æt in the original time series. Optional: 4. Repeat parts 1 and 2 above, except using three-dimensional plots, in the first case with axes of Xi, Xi-n and Xi-2n, and in the second case with axes of x, dx/dt, and dýx/dtý. You may approximate dýx/dtý by (Xi+1 + Xi-1 - 2Xi)/Æt. Use your ingenuity and some of the ideas we discussed several weeks ago to display trajectories in spaces with dimension higher than 2.  .M:4 Name___________________________________________ Assignment #________ Assignment completed: Yes / No Turned in on time: Yes / No Total points earned: 0 / 1 / 2 Prefer future homework to be: Easier / Same / Harder Number of hours required to complete the assignment:___________________ Total number of hours spent on the course during the week:_____________ Name(s) of anyone you worked with:_____________________________________ Computer type used:____________________________________________________ Programming language used______________________________________________ Comments: Please fill out this cover sheet and staple your homework to it.  .M:1 Assignment #11 Nonlinear Prediction Due 3:30 pm, November 21, 2000 This assignment is a continuation of the development of tools for the analysis of a chaotic time series. This week you will develop a nonlinear predictor. Prediction of the future of a time series can be an end in itself, but it can also be a noise-reduction method, a way of estimating the sensitivity to initial conditions, and a way to generate model equations whose solution can provide an infinite amount of data and whose form might provide physical insight into the nature of the underlying dynamical system. 1. The first step is to generate a time series for analysis. For this purpose you will use the H‚non map (see page 240 in the text) with parameters (B = 0.3, C = 1.4) chosen to give chaotic behavior. Perform a few iterations to ensure that the orbit is on the attractor, and then generate a time series Xi for i = 1 to 1000 from the variable X. Also generate the next 10 points (i = 1001 to 1010) to use as a test of the quality of your prediction. Make a plot of Xi versus Xi-1 for i = 2 to 1000, and convince yourself that this plot replicates the topology of the original H‚non map in the X-Y plane. 2. Now using your 1000 points as input data, search through the data record for the M points in a D-dimensional embedding that are closest to the last point in the time series (i = 1000). Choose M = 8 and D = 2, but write your code generally so that you can adjust these parameters. Now make a list of how much these 8 points change (ÆX, a scalar) on the next iteration. Take the average of these eight changes and add it to X1000 to form your prediction of X1001 and compare it with the actual value X1001 that you saved from part 1 above. 3. Continue this process for another 9 time steps, using the M nearest neighbors to your predicted value of X1001 in a D-dimensional embedding to get a prediction of X1002, and so forth up to X1010. Make a table or graph of your predictions for i = 1001 to 1010 along with the actual values of Xi that you saved from part 1 above. Is the growth in the error of your prediction consistent with the largest Lyapunov exponent of the H‚non map (È1 = 0.418 /iteration)? Optional: 4. Make a new time series that is the same as your time series above but that has a small amount of noise added (say 10%). See how the quality of your prediction is degraded by this noise, and see if there is an optimal value of M and D that gives you the best prediction.  .M:4 Name___________________________________________ Assignment #________ Assignment completed: Yes / No Turned in on time: Yes / No Total points earned: 0 / 1 / 2 Prefer future homework to be: Easier / Same / Harder Number of hours required to complete the assignment:___________________ Total number of hours spent on the course during the week:_____________ Name(s) of anyone you worked with:_____________________________________ Computer type used:____________________________________________________ Programming language used______________________________________________ Comments: Please fill out this cover sheet and staple your homework to it.  .M:1 Assignment #12 Correlation Dimension Due 3:30 pm, November 28, 2000 This assignment concludes the development of tools for the analysis of a chaotic time series with an implementation of the Grassberger-Procaccia algorithm [Phys. Rev. Lett. 50, 346 (1983)] for determining the correlation dimension. This is the algorithm that opened the floodgates for the search for chaos in experimental data. It is still the best method for distinguishing chaos from colored noise. When chaos is found, it provides a measure of the dimension of the attractor (actually a close lower bound on the dimension), which gives an indication of the minimum number of dynamical variables required to model the system. The method is described in the text (in 1-D on pages 407-412, and in higher dimension on pages 427-443) and in the original reference, which is attached. This is perhaps the most useful program you will develop in the course, and so you are advised to give it special effort. It is also one of the harder assignments. 1. The first step is to generate a time series for analysis. For this purpose you will use the H‚non map (see page 240 in the text) with parameters (B = 0.3, C = 1.4) chosen to give chaotic behavior. Perform a few iterations to ensure that the orbit is on the attractor, and then generate a time series Xi for i = 1 to 1000 from the variable X. You may use the data you generated last week. 2. Develop a program to calculate the correlation sum C(R) (see Eq. 10.2-1 on page 431 of the text) for your data in a D-dimensional time-delayed embedding. Note that for D > 1, the data points are vectors whose components are Xi-k and Xj-k, and thus you need to replace |Xi - Xj| with the square root of D-1 ä (Xi-k - Xj-k)2 k=0 Make a plot of log(C(R)) versus log(R) for the H‚non map analogous to Fig 9.9 in the text for D = 2. Write your code generally so that you can apply it to any data set with arbitrary embedding. 3. Plot the slope d[log(C(R))] / d[log(R)] versus log(R) and show that there is a plateau whose value is close to the expected correlation dimension of 1.21 for the H‚non map (see the G-P reference). Optional: 4. Plot a family of curves log(C(R)) versus log(R) for values of D from 1 to 8. How does the slope of these curves vary with D? With experimental data, it is necessary to make such a plot to ensure that your chosen embedding is sufficiently (but not unnecessarily) large.  .M:4 Name___________________________________________ Assignment #________ Assignment completed: Yes / No Turned in on time: Yes / No Total points earned: 0 / 1 / 2 Prefer future homework to be: Easier / Same / Harder Number of hours required to complete the assignment:___________________ Total number of hours spent on the course during the week:_____________ Name(s) of anyone you worked with:_____________________________________ Computer type used:____________________________________________________ Programming language used______________________________________________ Comments: Please fill out this cover sheet and staple your homework to it.  .M:1 Assignment #13 Iterated Function Systems Due 3:30 pm, December 5, 2000 The remaining three assignments will deal with fractals and related topics. One of the simplest and most powerful techniques for producing fractal patterns (aside from the strange attractors that result from chaotic dynamical systems) is the iterated function system (IFS). Unfortunately, our text does not discuss such systems, but they are described in most books on fractals, especially the one by Barnsley (Fractals Everywhere, Academic Press, San Diego, 1988) who pioneered IFS techniques. The procedure is extremely simple. Start with an arbitrary point in the X-Y plane. Flip an N-sided coin to generate an integer between 1 and N (on the computer using its random-number generator). Then apply the corresponding affine transformation Fi: Xnew = aX + bY + e Ynew = cX + dY + f Repeat the process many thousand times. Discard the first few points and plot the remaining ones. 1. Use the procedure described above to produce a Sierpinski triangle for which the IFS code is: a b c d e f F1: 1/2 0 0 1/2 0 0 F2: 1/2 0 0 1/2 1/2 0 F3: 1/2 0 0 1/2 1/4 1/2 2. Use the procedure described above to produce Barnsley's fern for which the IFS code is: a b c d e f F1: 0 0 0 0.16 0 0 F2: 0.85 0.04 -0.04 0.85 0 1.6 F3: 0.2 -0.23 0.23 0.2 0 1.6 F4: -0.15 0.28 0.26 0.24 0 0.4 3. Produce some interesting patterns of your own, either as variations of the above or by letting the computer choose the IFS code randomly. If you produce a particularly interesting case, I'd like to show it to the class unless you object. Optional: 4. Develop a computer code to calculate the capacity (box- counting) dimension of an arbitrary fractal pattern displayed on the computer screen. Test your code using the Sierpinski triangle above, for which this dimension should be log(3)/log(2) ÷ 1.585  .M:4 Name___________________________________________ Assignment #________ Assignment completed: Yes / No Turned in on time: Yes / No Total points earned: 0 / 1 / 2 Prefer future homework to be: Easier / Same / Harder Number of hours required to complete the assignment:___________________ Total number of hours spent on the course during the week:_____________ Name(s) of anyone you worked with:_____________________________________ Computer type used:____________________________________________________ Programming language used______________________________________________ Comments: Please fill out this cover sheet and staple your homework to it.  .M:1 Assignment #14 Mandelbrot and Julia Sets Due 3:30 pm, December 12, 2000 In this assignment you will explore the Mandelbrot set and its associated Julia sets. The Mandelbrot set is perhaps the most celebrated of all fractal sets, and it provides endless fascination and artistic patterns of unriveled beauty. It is the simplest example of a 2-D escape-time fractal. So far as I know, it has no practical use other than artistic. It is discussed briefly on pages 405-406 of our text, but you may want to refer to almost any book on fractals for more detail and additional sample pictures. The Mandelbrot set is the set of values of the complex variable C for which the mapping Zn+1 = Zný + C with an initial condition of Z0 = 0 remains bounded as n approaches infinity. If you are rusty on the use of complex variables, the above description is equivalent to the following 2-D map: Xn+1 = Xný - Yný + Cr Yn+1 = 2XnYn + Ci 1. Make a plot of the Mandelbrot set in the region of the C-plane bounded by -2 < Cr < 1 and -1.5 < Ci < 1.5. To do this, you will need to program the computer to laboriously step through each combination of Cr and Ci. For each such value of C, start with X0 = Y0 = 0 and iterate the above equations until Xý + Yý exceeds 4 in which case that value of C is not in the set or until you have iterated 100 times in which case that value of C is presumably in the set. Plot in the C- plane those points that are in the set. You should get a solid region of points with a fractal basin boundary. 2. To make your plot more visually interesting, also plot the points that lie outside the set if the number of iterations required to escape is odd. If you have access to colors, you might color the points that lie outside the set according to some scheme that converts the escape time to a color. 3. Find a region near the boundary of the set that exhibits interesting structure, and zoom in on it by at least a factor of ten. You may want to increase your escape-time limit from 100 to some larger number such as 500, but beware that this will slow down your calculation correspondingly. Optional: 4. Each point in the Mandelbrot set (each C value) has associated with it a Julia set, which is the set of initial conditions (Z0) for which the solution is bounded. These sets can be displayed by exactly the same technique you used above. One such set is shown on page 406 of the text. The interesting cases (choices of C) are those that lie near the boundary of the Mandelbrot set. Make plots of a few such cases.  .M:4 Name___________________________________________ Assignment #________ Assignment completed: Yes / No Turned in on time: Yes / No Total points earned: 0 / 1 / 2 Prefer future homework to be: Easier / Same / Harder Number of hours required to complete the assignment:___________________ Total number of hours spent on the course during the week:_____________ Name(s) of anyone you worked with:_____________________________________ Computer type used:____________________________________________________ Programming language used______________________________________________ Comments: Please fill out this cover sheet and staple your homework to it.  .M:1 Assignment #15 Spatio-temporal Chaos Due 3:30 pm, December 19, 2000 In this last assignment you will produce examples of spatio- temporal chaos in complex systems that exhibit self-organization. You will get one point for completing any one of the four suggested exercises and two points for completing more than one. I intend to submit the course grades on December 19th, and so noon on that day will be the deadline for turning in late assignments. You may bring your papers to my office (3285 Chamberlin) or leave them in my mailbox on the second floor of Chamberlin near the University Avenue entrance. The results will be more interesting if you write your program so that you can watch the patterns as they develop on your computer screen. 1. Explore the behavior of a one-dimensional coupled-map lattice (CML) using logistic maps as described on page 499ff. in the text. Use random initial conditions in the interval 0 to 1 and periodic boundary conditions. Make a plot of X(t) versus t for one of the lattice points with parameters adjusted to produce chaotic behavior. [Optional: Run the X(t) data through your correlation dimension program and get an estimate of the dimension of the attractor.] 2. Implement the classic "Game of Life" (a two-dimensional cellular automaton) described on page 503 of the text. Use periodic boundary conditions. Start with a random initial condition (about half the sites occupied) and iterate until a steady state is reached. This may take several hundred iterations, depending on the size of your lattice. Produce a pattern like Fig. 11.7 in the text. [Optional: Start with a slightly different initial condition (one site different) and see whether the final pattern is sensitively dependent on the initial condition, i.e., whether it is chaotic.] 3. Simulate two-dimensional diffusion-limited aggregation (DLA) as described on page 534 of the text. Produce a pattern like Fig. 11.16 in the text. This is an example of a random fractal. [Optional: Use the box-counting method to estimate the capacity dimension of the pattern you produce.] 4. Plot the trajectory of one of Langton's Ants, which are governed by the following rules: Begin with a grid of squares (at least 100 x 100) that are all white. The ant starts on the central square of the grid. It moves one square to the east and looks at the color of the square on which it lands. If it lands on a white square, it paints it black and turns 90ø to the right. If it lands on a black square, it paints it white and turns 90ø to the left. If the ant runs off the edge of the screen, it re-enters at the opposite edge (i.e., the boundary conditions are periodic). The ant follows these same simple rules forever. Make a plot of the pattern that is produced after 10,000, 100,000, and 1 million steps. [Optional: Sprinkle a few rocks (black squares) around the screen randomly or in some pattern for the ant to bump into, and see how the resulting behavior of the ant is altered.]