Creating and Analyzing Chaotic Attractors Using Mathematica Presented at the 2013 MAA MathFest Ulrich Hoensch 1 Rocky Mountain College Billings, Montana hoenschu@rocky.edu Saturday, August 3, 2013 1 Travel funded by the Montana Space Grant Consortium and Montana NASA EPSCoR.
The Undamped Pendulum Consider a pendulum with an object of mass m attached to a rigid swing arm of length l. Θ Θ mg
The Undamped Pendulum Let θ be the angle (in radians) that the arm of the pendulum makes with the downward vertical. Then Newton s Second Law gives θ + g l sin θ = 0. (1) Letting ψ = θ, we obtain the nonlinear first order system θ = ψ (2) ψ = g l sin θ. This model excludes any frictional forces. Thus, we have conservation of mechanical energy, and can think of (2) as a Hamiltonian system. The Hamiltonian (total energy function) can be chosen to be H(θ, ψ) = ψ2 2 g cos θ. (3) l
The Damped Pendulum If we add in frictional forces that are proportional to the angular velocity dθ/dt, we get the equation d 2 θ dt 2 + r dθ dt + g sin θ = 0, (4) l Adding external sinusoidal forcing with amplitude A and circuluar frequency ω yields the differential equation d 2 θ dt 2 + r dθ dt + g sin θ = A sin(ωt), (5) l
The Damped Pendulum If g/l = 1, r = 0.2, A = 0.5 and ω = 2π, then a typical orbit looks like this: 0 5 10 Τ 15 1 01 Θ 1 0 Ψ 1 2
The Forced Damped Pendulum The figure below shows the same orbit when t = 0, 2π, 4π,..., 20π in the (θ, ψ)-plane only. It appears that the orbit approaches the fixed point S ( 1, 1.2). 1 Ψ 0 1 2 3 2 1 0 1 2 3
The Poincaré map Evaluating the orbit (θ(t), ψ(t)) at times t = 0, 2π, 4π,... defines a Poincaré map S(θ(t), ψ(t)) = (θ(t + 2π), ψ(t + 2π)). (6) The Poincaré map can be computed numerically by integrating (5). The following code defines the Poincaré map and orbit in Mathematica. g 1; l 1; r 0.2; Ω 1; Poincare Θ_, Ψ_, A_ : Flatten Evaluate Mod x t, 2 Pi, Pi, y t. NDSolve x' t y t, y' t g l Sin x t r y t A Sin Ω t, x 0 Θ, y 0 Ψ, x t, y t, t, 0, 2 Pi Ω. t 2 Pi Ω ; PList Θ_, Ψ_, A_, nmin_, nmax_ : Module M, n, M 0 : Θ, Ψ ; M n_ : M n Poincare M n 1, A ; Table M n, n, nmin, nmax ;
The Forced Damped Pendulum Now, suppose g/l = 1, r = 0.2, A = 2.2 and ω = 2π in (5). If we plot the positions at t = 2πn for 100 n 500, we obtain the following picture. 1 0 1 Ψ 2 3 4 5 3 2 1 0 1 2 3
The Forced Damped Pendulum Here is a picture using 250,000 points. The set produced is a chaotic attractor.
The Experiment of Moon and Holmes A steel beam (light blue) which is suspended equidistantly between two magnets of equal strength (red).
The Experiment of Moon and Holmes If this apparatus is shaken horizontally with fixed amplitude γ and period 2π, the horizontal strain on the beam can be modeled using the forced Duffing equation d 2 y dt 2 + ν dy dt + y 3 y = γ sin t, (7) where ν > 0 and γ 0 are parameters. If ν = 0.05 and γ = 2.8, we again obtain a chaotic attractor (shown on the next slide, using 250,000 points).
The Experiment of Moon and Holmes
Building Your Own Attractor Note that if ν = γ = 0 in (7), we obtain the Hamiltonian system with H(y, ẏ) = (ẏ)2 2 + y 4 4 y 2 2. (8) The potential energy function y y 4 /2 y 2 /2 confirms the bi-stable attractor when ν > 0 and γ = 0: 0.3 0.2 0.1 1.5 1.0 0.5 0.5 1.0 1.5 y 0.1 0.2
Building Your Own Attractor We can create a tri-stable attractor by e.g. integrating the function y y(y 2 1)(y 2 4) to obtain the potential energy function y 2y 2 5y 4 /4 + y 6 /6. 1.5 1.0 0.5 2 1 1 2 y 0.5 1.0
Building Your Own Attractor The corresponding differential equation that includes friction and external forcing is d 2 y dt 2 + ν dy dt + y(y 2 1)(y 2 4) = γ sin t. (9) If ν = 0.07 and γ = 9.9, we obtain the following chaotic attractor.
Dimension of the Chaotic Attractor of the Pendulum Let Ω be the chaotic attractor of the forced damped pendulum as above. To numerically approximate its box-counting dimension, we need to find the number of boxes needed to cover Ω at a given scale ɛ. If ɛ = 1, N(ɛ) = 22:
Dimension of the Chaotic Attractor of the Pendulum If ɛ = 1/2, N(ɛ) = 59:
Dimension of the Chaotic Attractor of the Pendulum If ɛ = 1/4, N(ɛ) = 164:
Dimension of the Chaotic Attractor of the Pendulum If ɛ = 1/8, N(ɛ) = 470:
Dimension of the Chaotic Attractor of the Pendulum Using the finer scales of ɛ = 1/10, 1/20, 1/30, 1/40, 1/50, we obtain the following data (using 250,000 points for the attractor): ɛ N(ɛ) log(1/ɛ) log(n(ɛ)) 1/10 662 2.3026 6.4953 1/20 1796 2.9957 7.4933 1/30 3269 3.4012 8.0922 1/40 4795 3.6889 8.4753 1/50 6624 3.9120 8.7985
Dimension of the Chaotic Attractor of the Pendulum The log(1/ɛ)-log(n(ɛ)) graph shows a slope of d 1.43 for the regression line (r 2 = 0.999). Thus, dim(ω) 1.43. Log N Ε 8.5 8.0 7.5 7.0 6.5 2.5 3.0 3.5 4.0 Log 1 Ε
Dimension of the Chaotic Attractor of the Pendulum The following Mathematica code allows the computation of the box-counting dimension of a list of points at the given scales. In[5]:= Count@Flatten @BinCounts @points, 8-Pi, Pi, scale <, NBoxes@points_, scale_d := 8-5, 1, scale <DD, _? Hð > 0 &LD; scales = 81 10, 1 20, 1 30, 1 40, 1 50<; Map@NBoxes@list, ð D &, scalesd; data = Map@8Log @1 ð D, Log @NBoxes@list, ð DD< &, scalesd; model = LinearModelFit @data, x, xd Out[8]= FittedModel B 3.20506+ 1.43121x F
References [1] Blanchard, P., Devaney, R., Hall, G. Differential Equations, Fourth Edition (2012), Brooks/Cole Cengage Learning. [2] Hoensch, U. Differential Equations and Applications Using Mathematica (2012), available as PDF download at www.rocky.edu/~hoenschu. [3] Lynch, S. Dynamical Systems with Applications Using Mathematica (2007), Birkhäuser Boston. [4] Ott, E. Chaos in Dynamical Systems, Second Edition (2002), Cambridge University Press.