# Non-Linear Dynamics and Chaos

## Non-Linear Dynamics and Chaos Description (NLD)

1. Note that there is NO eating or drinking in the 111-Lab anywhere, except in rooms 282 & 286 LeConte on the bench with the BLUE stripe around it. Thank You, the Staff.

This experiment is an introduction to Non-Linear Dynamics, Data Acquisition, Chaos theory and Fractals. Limited as we are by our senses and relatively short powers of recall, much of the physical world seems aperiodic and defies quantitative description. While we have yet to discover closed form solutions to the simplest of systems (e.g. the one-dimensional gravitational three-body problem), the field of chaos reveals structure in their dynamics. The results of chaos theory have found practical applications in almost every branch of science.

In this experiment you will study the response of at least two different dynamical systems: A non-linear, damped harmonic oscillator and a system of op amps that reproduces the Lorentz attractor. You will measure their linear and non-linear behavior and write software to measure their information dimension.

You will learn the basics of digital sampling, Fourier transforms, geometric analysis of autonomous differential equations, information entropy, correlation dimension and the basics of programming in LabView (a data-acquisition and control language).

There are no pre-requisites. But a strong background in differential equations and classical mechanics, coupled with a willingness to do a lot of reading will serve you well in this lab.

1. Pre-requisites: None
2. Days Alloted for the Experiment: 6
3. Consecutive days: No

This lab will be graded 40% on theory, 20% on technique, and 40% on analysis. For more information, see the Advanced Lab Syllabus.

Reprints and reading materials can be found at the Physics 111 Library Site.

# Before the Lab

Complete the following before your experiment's scheduled start date:

1. View the Non-Linear Dynamics and Chaos Video.
2. Complete all of the mandatory prerequisite reading.
3. Complete the NLD Pre Lab and Evaluation sheets. Print and fill it out. The Pre-Lab must be printed separately. Discuss the experiment and pre-lab questions with any faculty member or GSI and get it signed off by that faculty member or GSI. Turn in the signed pre-lab sheet with your lab report.

You should keep a laboratory notebook. The notebook should contain a detailed record of everything that was done and how/why it was done, as well as all of the data and analysis, also with plenty of how/why entries. This will aid you when you write your report.

Suggested Initial Reading: Ref. 1; Skim §1, §2.0-§2.2, §3.0-§3.4, §3.6, and then read §9.0, §9.2-9.4, §10.1-§10.5 (§10.6, §10.7 optional), §11, §12.0-§12.3

1. S. H. Strogatz, Nonlinear Dynamics and Chaos, (Addison-Wesley, New York, 1994). \#Q172.5.C45 S767
This is an introductory book presuming no prior familiarity with the subject.
2. E. Ott, Chaos in Dynamical Systems, (Cambridge University Press, 1993). \#Q172.5.C45O87
3. H. G. Schuster, Deterministic Chaos, an Introduction 2nd ed. (VCH New York, 1988). \#QC174.84.S381
An introductory book appropriate for those with an advanced mathematical background.
4. W. H. Press et al., Numerical Recipes in C (Oxford University Press, New York, 1988). \#QA76.73C15 N865
A compendium of numerical algorithms for all branches of science. It is included here for its discussion of the Fourier transform algorithm.
5. R. L. Zimmerman et al., "The electronic bouncing ball," Am. J. Phys. 60, 370 (1992). Searchable Page
6. Leo P. Kadanoff, "Chaos: A View of Complexity in the Physical Sciences", Encyclopedia Britannica(1986), pp. 63-92.
Excellent brief introduction.
7. Bai-Lin Hao. "Chaos", World Scientific Publishers, Singapore, 1985.
General introduction with reprints of papers in this field.
8. P. Cvitanovic, "Universality in Chaos", Acta Physica Dolonica A65, 203-239 (1984).
9. R. Van Buskirk and C. D. Jeffries, "Observation of chaotic dynamics of coupled nonlinear oscillators", Phys. Rev. A 31, 3332 (1985). A description of a driven on junction resonator, similar to that of the laboratory experiment. Searchable Page
10. M. Henon, "A Two-Dimensional Mapping with a Strange Attractor",Comm. Math. Phys. 50, 69-77 (1976).
Introduction of the Hènon map; fractal strucure. Searchable Page
11. M. Feigenbaum, "Universal Behavior in Nonlinear Systems", Physica 7D, 16-39 (1983).
Introduction to universality; the quadratic map.
12. R. N. Bracewell, "The Discrete Fourier Transform", ch.18-The Fourier Transform and its Applications, 2nd edition, McGraw Hill (1978).
Brief Introduction to the fast Fourier Transform.
13. J. Testa, J. Perez, C. Jeffries, "Evidence for Universal Chaotic Behavior of a Driven Nonlinear Oscillator", Phys. Rev. Lett. 48, 714-717 (1982).
Experimental results on the driven pn junction; essentially the experimental system used in the Physics 111-Lab Experiment. Searchable Page
14. J. Theiler, "Estimating fractal dimension," J. Opt. Soc. Am. A 7, 1055 (1990).
Another review article with an excellent bibliography. This one focuses on fractals. Searchable Page
15. Abarbanel, "Making Physics From Chaos," videotape, \#QA845 A77, on reserve in the physics library.
An application of NLD to turbulence around torpedoes. The talk is clear but the speaker runs out of time.
16. B. K. Clark et al., "Fractal dimension of the strange attractor of the bouncing ball circuit," Am. J. Phys. 63, 157 (1995).Searchable Page
17. C. E. Shannon, The mathematical theory of communication, (University of Illinois Press, Urbana, 1964). \#TK5101 .S45
18. R. May, "Simple Mathematical Models with very Complicated Dynamics" Nature 261, 459-467 (1975).
Important early review of nonlinear maps.Searchable Page
19. J. Perez, and C. Jeffries, "Effects of additive noise on a nonlinear oscillator exhibiting period doubling and chaotic behavior", Phys. Rev. B 26, 3460-3462 (1982).
Experiment results on adding noise to the driven on junction. Searchable Page
20. R. W. Hamming, "Maximum Entropy", The Art of Probability for Scientists and Engineers: Chp.7, pp. 253-265 + 7 pages of diagrams
21. J. P. Eckmann, and D. Ruelle. "Ergodic Theory of Chaos and Strange Attractors", Rev. Mod. Phys. 57, 617-656 (1985). Searchable Page
22. L. Wells and J. Travis LabVIEW for Everyone, Prentice Hall PTR (Available from Don Orlando).

Reprints and reference materials can be found on the Physics 111 Library Site

# Introduction

This experiment is an introduction to Non-Linear Dynamics, Data Acquisition, Chaos theory and Fractals. Limited as we are by our senses and relatively short powers of recall, much of the physical world seems aperiodic and defies quantitative description. While we have yet to discover closed form solutions to the simplest of systems (e.g. the one-dimensional gravitational three-body problem), the field of chaos reveals structure in their dynamics. The results of chaos theory have found practical applications in almost every branch of science.

The term Chaotic has come to mean something very specific in this field. It does not mean random or unorganized as the ordinary English word does. It refers instead to a particular type of dynamical behavior. One which at first sight appears random, but underlying it are ordered deterministic laws. Chaotic systems exhibit these key features: They are aperiodic, they exhibit sensitive dependence on initial conditions, and they are in some sense bounded.

# Equipment used in this experiment

1. Function Signal Generator SR 345
2. Computer interface Box
3. DAQ card in computer
4. Main Control Chassis NLD-86-35Rev2002
5. Bouncing Ball and Lorenz Attactor inside control chassis
6. Scope
7. Power Supply providing +15/-15/+5 V
8. Rack for equipment

# Theory

## The PN Junction: an introductory Dynamical System

A dynamical system is essentially anything that varies with time. The pertinent variables necessary to describe its motion are called the dynamical variables and the evolution of the system describes a path, or trajectory in the state-space (also called phase space) of the dynamical variables. Dynamical systems may be either conservative: a volume element in state space remains invariant (recall Liouville's theorem; see Marion, J. B. Classical dynamics of particles & systems); or the system may be dissipative: for which regions of state space become compressed as the systems evolves.

One of the dynamical systems we study is a driven damped oscillator with a non-linear response. Because it is damped this is a dissipative system. It consists of a pn-junction (a diode) connected in series with an inductor L, a resistor R, and a driving sine wave oscillator of voltage $V_0(t)=V_{os}cos\left ({\omega }_0t \right )$ , see the left side of Figure 1.

Figure 1
Figure 2: Capacitance of a typical diode as a function of diode voltage. From Ref. 7.

The diode is the non-linear circuit element: not only does it have an exponential I-V characteristic,

$I_d~(V_d)=I_0[exp(eV_d / kT)-1]$

but due to the properties of the junction [see Ref. 8], it has a non-linear capacitance as well. The capacitance may be written as a function of the voltage across the diode, Vd:

$C(V_d) = \begin{cases} C_0 exp(eV_d/kT):V_d >0 \\ \frac{C_0}{\sqrt {(1-eV_d/dT)}}:V_d\le 0 \end{cases}$ ,see Figure 2.

Thus the diode may be modeled as a voltage-dependent capacitor connected in parallel with an ideal diode (a voltage-dependent current-source), giving the equivalent circuit on the right of Figure 1.

We use a computer to measure the voltage across the resistor R and the observed signal, Vs(t), is proportional to the current I(t).

For small values of driving voltage, the diode doesn't conduct, its capacitance is nearly constant, and the circuit behaves like a passive LRC resonator: A standard treatment of which yields a resonant frequency ${\omega }_{res}\approx\frac{1}{\sqrt{LC( V_d=0)}}=\frac{1}{\sqrt{LC_0}}$. But as the driving amplitude increases, the increasing diode capacitance drops the resonant frequency significantly.

The effect of increasing driving-amplitude is seen in the following figures. They are plots of I(t) (measured as Vs(t) in Volts) vs. time (measured in sample number of a 50 kHz clock). In all three plots the driving oscillator is operating at the same frequency, ωres ≈ 3.5 kHz (a period of ≈ 15 samples).

 Figure 3: I(t). Vos ≈ 0.3 V, response period ≈ 15 samples. Figure 4: I(t). Vos ≈ 0.5 V, response period ≈ 30 samples. Figure 5: I(t). Vos ≈ 1.5 V, response period ≈ 60 samples

In Figure 3, Vos is set to a small value and the response signal Vs(t) is a sine wave; this is the linear response. As Vos(t) is increased, Vs(t) begins to produce harmonic content at 2ω0, 3ω0 etc (not shown). But as you keep increasing the voltage, it will abruptly exhibit a change in behavior that, for reasons that will become clearer later, is called a bifurcation. This new state has subharmonic content ω0/2 (Figure 4) and consequently is also called a period-doubling bifurcation. As Vos is further increased, this period doubling bifurcation occurs again and again at increasingly closely spaced values of Vos. As the period approaches infinity, the system becomes chaotic , i.e. it is aperiodic, with a small but visible noise-like component that looks like "jitter."

Figure 6: I(t). Vos ≈ 3.5 V. The diode response current is now aperiodic.

As Vos is further increased, this "noise" dominates the trace; however, one finds narrow ranges of Vos ("windows") for which this noise completely disappears, leaving a periodic signal. This noise is not random noise due to fluctuation phenomena (e.g., Johnson noise, shot noise, flicker noise), but is a natural consequence of the non-linear equations of motion of the system. As such, it is determined by the solution of the equations. We call this noise chaos. When the system becomes chaotic, Fourier spectral analysis shows a transition from a discrete to a continuous distribution.

The above behavior, a period-doubling cascade to chaos, is observed in many physical, chemical, and biological systems. To better understand it we shift our attention from the time domain to state-space.

The equations (of motion) for the PN-junction (Ref. 8, Sec. II) are:

$\dot I = \frac{V_0-RI-V_d}{L}$ (Equation 1)
$\dot V_d = \frac{I-I_d(V_d)}{C(V_d)}$ (Equation 2)
$\dot \theta =\omega$ (the time derivative of the driving signal's phase) (Equation 3)

Notice that these equations do not depend explicitly on time (and so are called autonomous). Instead they relate the rate of change of the current state to the current state itself. That is, given a state-space M of the variables (I, Vd, θ), we may write equations 1-3 as one vector equation

$\dot{\vec p}=\vec F (\vec p)~where~p \in M$ (Equation 4)

Thus $\vec p$ denotes the current state of the system, and $\vec p(t)$ the path of the system through the three-dimensional state-space of the dynamical variables.

## Phase-Path Reconstruction

If one could measure all the dynamical variables of a system simultaneously, the path $\vec p(t)$ could be plotted easily. However, in many cases this is not possible and, moreover, it is not necessary in most cases. Look ahead to the reconstructed phase plots of Figures 7 to 10. These plots were made by sampling the diode current only. Rather than measuring the complete set of variables $(I,~V_d,~\theta)$, the trajectory is available in each variable (i.e. we could have sampled the diode voltage and come up with similar plots).

Sampling only one dynamical variable and reconstructing the trajectory in a higher-dimensional space is a process called embedding: Given a discrete time series $\left \{I_n \right\}$ of regularly sampled values of $I_d~(t_0+n\tau)$, where t0 is an arbitrary initial time and τ is the sample period, we embed the current in a higher dimension (appropriately called the embedding-dimension, in this example, dimension 3) by forming the points $(I_n,~I_{n+1},~I_{n+2})$ for all data.

This set of points then reveals an object topologically equivalent to the actual path in state-space. That this works is rather surprising. Ott presents a precise explanation (Ref. 2, section 3.8), but the basic idea is that if you know the current at a given moment, In that information gives you a little bit of information about where you are in state-space, that is, any point where the plane I=In intersects all possible trajectories. You then refine your knowledge by stipulating that you're at the point where not only is the current In, but the current was In-1 at a time τ in the past. This pins down the location further, and subsequent restrictions on what the current was in the past refines your knowledge about what state it's in now.

This is by no means obvious, and it's complicated by the fact that there do exist situations where it doesn't work. But that the geometric properties of the system's trajectory can be found by sampling only one of the state-variables is remarkable and useful: It means that the structure of large-scale, multi-dimensional dynamical systems is available to a simple, single-detector apparatus.

## PN-Junction phase plots & The Bifurcation Route to Chaos

Figure 7- Figure 10 show reconstructed phase-space trajectories, $\vec p(t)$, that correspond to the circuit's operation in Figure 3- Figure 6. The plots were made using the embedding technique described in the previous section, so the plot axes are $(I_n,~I_{n+1},~I_{n+2})$. We speculate that θ revolves around the line z = y = x, and that the other two state variables, V and I, correspond loosely to the distance along that line and the distance from that line. The graphs are all stereo-optic. Try holding them at arm's length (or set them on a desk as you stand over them) and letting your eyes focus at infinity. Let two of the double images overlap so that you can see three images. The middle one, if you get it to match up just right, will look like it's 3D.

Figure 7: Left and Right stereo-optic images of the linear response of the PN-Junction. The path is almost an ellipse, which is the path of a simple harmonic oscillator.

For small values of the parameter Vos, the trajectory is a stable orbit. For larger value (after bifurcation to period 2) the orbit is still stable, but requires two cycles of the driving oscillator to return to its initial point (Figure 8). These trajectories are a subclass of a more general object called an attractor: The subset of state space toward which a dynamical system evolves. Because they are periodic (the paths are closed cycles), the simple attractors of Figure 7-Figure 9 are known as limit-cycles.

Figure 8: L & R images of the diode response after undergoing a period-doubling bifurcation
Figure 9: same as above after another bifurcation.

Increasing Vos to the point where the system is chaotic reveals a more complicated attractor: it is a fractal object and hence called a strange attractor.

Figure 10: The system is now chaotic. The path in phase space never closes. And the evolution traces out the system's attractor. To improve the visibility of the plot the lines connecting the points have been omitted.

## Fractals

As you learned in calculus, most geometrical objects become smoother as one gets closer and closer to them. Fractals, however, remain twisty and crumpled no matter how close one scrutinizes them. As such, they defy conventional definitions of length and volume. Efforts to quantify fractals first led to several different definitions of dimension and finally to generalized dimension (Ref. 3, Section 5.3, Ref. 4 p1060, Ref. 2, p78), the most intuitive of which is:

bulksizedimension, so that $dimension = \lim_{size \to 0}\frac{\mbox{ln} bulk}{\mbox{ln} size}$for appropriate definitions of bulk and size. Note that taking the limit as size $\to$ 0 means that this definition of dimension is a local property of the object and may vary over its extent.

For instance, in two dimensions a disk has an Area ∝ radius2, and $\lim_{r \to 0}\frac{\mbox{ln}\pi r^2}{\mbox{ln}r}=2$. With this definition, objects of non-integral dimension are called fractals.

## Flow and Liapunov Exponents

Chaotic systems are noted for several universal features: The bifurcation route to chaos; Stable windows of periodicity, the borders of which exhibit short bursts of chaotic signal ("intermittency"); And sensitivity to initial conditions. To help explain some of these features, we define a flow φt that maps a state $\vec p$ to its new state ${\phi}_t(\vec p)$ at a time t units later. This operation also satisfies the relationship:

$\phi_t(\phi_s(\vec p))=\phi_{t+s}(\vec p)$

Now consider two neighboring initial conditions $\vec P_0~\mbox{and}~\vec P_0+\vec h$. Expanding $\phi_t(\vec P_0+\vec h)$ about $\vec P_0$ gives $\phi_t(\vec P_0+\vec h)= \phi_t(\vec P_0)+\bar{\bar J}(t)\vec h+O(\| h\|^2)+\ldots$ where $\bar{\bar J}(t)$ is the Jacobian matrix of partial derivatives of phit with respect to $\vec P_0$ and $O(\| h\|^2)+\ldots$ are higher order terms. (In one dimension, $\bar{\bar J}(t)$ would just be $\frac{\partial\phi}{\partial x}(t)$). Thus we see that a small displacement in initial conditions $\vec h$ is magnified to $\bar{\bar J}(t)\vec h$. The evolution of the distance between neighboring initial-conditions is then given by the eigenvalues of $\bar{\bar J}(t)$. Liapunov (alternately spelled Lyapunov or Ljapunov) exponents are convenient measures of the eigenvalues and are defined as

$\lambda_n\equiv \lim_{t \to \infty}\frac{\mbox{ln}| n^{th}~eigenvalue~of~\bar {\bar J}| }{t}$ (Equation 5)

If the Liapunov exponents are all positive then the system diverges. If they are all negative then the system condenses to a point. If the largest one is positive and the sum of them all is negative, then it amounts to a stretch in one or more dimensions and a contraction in the others and chaotic behavior is guaranteed.

## Recurrence relations

The equations of state (Eq's 1,2,3) are functions of a continuous time variable. Using the Runge-Kutta method of integrating ordinary differential equations, it is possible to form a set of discrete-time dynamical equations and these are seen to exhibit universal features common to other similar systems. For this reason, we study iterative maps: discrete versions of φt that relate the next state of a system to its previous state. You might wonder why, if chaotic systems are so sensitive to initial conditions, should we expect to see any useful results computed by an approximating method such as Runge-Kutta. The reason is explained in [Ref. 1, §10.1], where the authors present the 'shadowing' lemma: Although a finitely computed chaotic time-series, beginning with an initial value, will rapidly diverge from the true orbit, there exists some other orbit that coincides closely to the computed series.

# Experiment and Procedure

The procedure is below.

# The Experiment Apparatus

This experiment uses an Intel CPU based computer, running the Windows operating system. The main tools are a data-acquisition computer-interface card and the LabView software package. The data-acquisition card has 8 input-channels, 2 output channels, and miscellaneous timing and TTL features. The inputs sample voltages in the ±5 Volt range with 12-bit resolution at speeds to 100khz.

LabView is a graphical programming environment designed to facilitate lab-instrument control, data-acquisition, and rudimentary numerical analysis. There is a suite of LabView programs (called VI's; for Virtual Instruments) specifically written for this lab that constitutes the bulk of this experiment. You'll also be writing a few of your own to get a better feel for LabView.

Most of the non-linear circuits you will examine in this lab are driven, so the computer is set up to modify a driving voltage, by using its DAC to attenuate a function-generator, and measure the circuit's response (see Figure 11). Because you won't be starting with the real systems, the details of the equipment and connections are deferred to section 4.5, where they should make more sense.

Figure 11: Simplified block diagram.

# Procedures

## Getting started with LabView and Sampling

Before starting LabView, create a directory for yourself inside My Documents folder. This is where you will save ALL your work. Read chapters 1-3 in LabView for Everyone and be sure to do the exercises. If you know LabView from BSC then proceed. Otherwise this will help immensely, especially if you have no previous programming experience. Here is a list of helpful things you might want to know:

• Control-H displays "pop-up" help, which will automatically explain things you point to with your cursor. Usually, this is sufficient, but if you need more detailed information, use the LabView manuals provided with the experiment.
• Control-E switches between the front-panel and the diagram windows.
• There are 3 palettes you will be using; functions, controls, and tools. Right clicking the mouse brings the appropriate palette for the window you're working in. Functions are used in the diagram window, controls are used in the front-panel window, and tools are used in both. Use the spacebar to switch between different tools in the tools palette.
• The LabView modules/elements (the things that look like icons) are unique in that there aren't two of them that look the same but do different things. Thus if your diagram looks just like the one in the lab manual, it will probably do the same thing.
• If you can't find an element/module, you may have to pick a similar one and then modify it.
• Wire from the input devices towards the output. Sometimes, the type of input to a module affects the output.
• Placing objects in the front-panel window places corresponding objects in the diagram window. It's a good idea to make the front-panel first, as then all of the corresponding objects are in place and you can plan what to do with them.
• Objects in the front-panel which represent numbers (i.e. slide bars, dials, etc.) or an array of numbers (i.e. charts, graphs) show up in the diagram window as [SGL] or [DBL] or [INT] (single or double precision, or integer).
• Modules in the diagram window have inputs and outputs, and it is important to wire them up correctly. The icon that looks like a spool of wire in the tools palette is used for wiring. Placing the mouse cursor over the different areas of the modules will tell you the specific functions of the inputs and outputs. These can sometimes be modified by right-clicking on them with the mouse.

Once you're ready to begin, copy all files to your my documents folder chaos. ( Note: go to c:\support\NLD2013 for the NLD.llb file and copy all into into your folder manually. Now start LabView from the Windows Start menu. Your first assignment is to make a simple VI. Investigate sampling by putting a waveform graph and a waveform chart on the front panel. These are located under Functions-F which can be accessed by right clicking in an exmpty space in "Block Diagram".(in the same way the Controls can be accessed by right clicking in an empty space in "Front Panel".

Figure 12: Pop-up help while inserting VI components.

Find out what the difference is so that you will know which one to use. Then put: a data-acquisition module; a power-spectrum module; an index array module; and a numerical constant on the diagram. You'll find the data-acquisition module, which is called AI Waveform Scan.vi, located as in Figure 12. Here's where to find these modules:

• Controls-->Graph Indicators-->Waveform Chart/Waveform Graph (you will need 2)
• Functions-->All Functions-->Array-->Index Array
• Functions-->All Functions-->Numeric-->Numeric Constant
• Functions-->All Functions-->Analyze-->Signal Processing-->Frequency Domain-->Power Spectrum

Notice that the index array module you found has one input which is black and does not match the one in Figure 13. To modify it, switch to the tool that looks like an arrow, then drag the lower corner down so that the module now has two inputs. Then right click on the "AI Waveform scan" and click "select type" and change it to "Scaled Array". Then get the wire tool and wire up the Array input to the output of the AI Wave. The first input will change from black to outline after you add a constant to the second input of the Array. These changes are necessary because the "AI Wave" module spits out a 2-dimensional array of numbers including a column of voltage values and a column of indices, while we only want a 1-dimensional array of voltage values. Wire up the modules as shown in Figure 13. What module is missing? where should it be wired to? One of the [DBL]'s will turn into a [SGL] after you make some connections. Make sure you know which inputs and outputs to connect on the modules.

Figure 13: Connections for the simple sampling VI that you will make.

The module labeled "AI WAVE" samples the voltage signal connected to the computer at a fixed rate (default 1kHz), and returns an array of numbers that represent the voltage levels at successive intervals. That is, if the sample rate is fs, then the sample period τ = 1 / fs, and the AI WAVE VI returns an array that is $\{V(0),V(\tau),V(2\tau),\ldots,V((n-1)\tau)\}$, where n is the number of points.

Once you have wired up the VI, you're ready to use it to sample signals. Using a function generator (Stanford Research Systems Model DS345), adjust its output to produce an approximately 200 Hz sine wave, 5 Volts in amplitude (10V peak-to-peak). Use a scope to check the output. Then connect the function generator to the Computer Interface(Fig. 22) box, into the connection labeled Analog-input channel 0. Run your VI by pressing the "run" button.

Your two graphs should display the time-series of the signal (it should look like a sine-wave) and the discrete Fourier transform (DFT). We stress that it's the discrete transform because, while it is closely related to the continuous Fourier transform, there are some important differences that we hope you'll discover. The units of the time-series graph are Volts vs. Sample number. What are the units of the DFT window?

The Fourier transform of a sine wave is a delta-function (loosely speaking, a peak). To better see the harmonic content, set the Y axis of the DFT graph to a logarithmic scale, accomplished by right-clicking on the graph in edit mode and selecting y-axis formatting. Why do you see two peaks in the DFT and not one? Now change the frequency. Vary it between 100 and 10,000 Hz. See if you can explain what's happening.

Figure 14: The graph-axes tool-palette

# Graphing

As you experiment with the parameters of the exercise, you may want to change the range of the graphed data. For this purpose, each graph window has its own palette of display controls (Figure 14). These control auto-ranging of the axes, format and precision of the axes, zooming, scrolling and the use of graph markers. See Ch 16 of the LabVIEW User Manual; 2nd Ed.; Jeffrey Travis, for more information. You may also highlight (with the mouse) and type directly onto the axes scales.

Next, change the waveform from a sine to a triangle at 100 Hz. . Calculate, or look-up in a reference, the Fourier series of a triangle wave. Does the displayed spectrum match what you expect?1 To help you determine the frequencies of different peaks, you should use graph cursors. You can enable them by right-clicking on the DFT window and selecting "show?cursor display." This displays a palette of controls that permits the marking and measuring of values on the graph. See the LabView manual for details.

The harmonics of the triangle wave that occur above the Nyquist frequency, will be aliased. Adjust the frequency of the function generator between 100 and 800 Hz, and familiarize yourself with the operational details of aliasing.

## One-dimensional maps: Introductory chaotic systems.

Multi-dimensional differential equations are hard to study. If they are insoluble, only numerical integration is possible. As simple examples of chaotic systems, one-dimensional maps offer an easy way to explore the defining features of chaos.

To familiarize yourself with 1-d maps, you will write a "cob-web" analyzer VI that shows the progress of iterations of the quadratic map (See Figure 15). Be sure to at least glance at §10.2 Ref. 1, to get an idea of what's going on.

Figure 15: Cob web analyzer shows the effect of repeatedly applying the quadratic map to the initial value x=0.94. It settles into a fixed point at about x=0.65

The graph displays three plots. The downward parabola is the quadratic map f(x) = rx(1 - x). The straight line is g(x) = x, and the stair-step or "cobweb" is the effect of successively applying the quadratic map to the initial point, x =0.94 . The recipe for producing the cobweb is as follows: Begin with the initial point x0, follow a vertical line up to f(x0), follow a horizontal line over to the line y =x, you are now at the x-coordinate f(x0), proceed vertically to the graph of the quadratic map. You are now at the y-coordinate f(f(x0)) Each time you move vertically to f, you have performed a further iteration of the map. Continuing in this way you can explore the long-term behavior of the map as you vary the initial condition and the chaotic parameter.

Making this VI yourself will teach you about arrays, or lists of numbers, in LabView. If you haven't programmed in a computer language before, you should know that each number in an array is indexed starting from 0 to N-1. Here's the part of the cobweb VI that produces the graphs of f and g (Figure 16).

Figure 16: Section of the cob web VI

The big square is a for-loop that gets executed 100 times (the constant 100 wired to N). Each time through the loop the variable i increases by 1 (i starts at zero and goes through (N-1)). The quotient $\frac{i}{N}$ is calculated and assembled into an array, which we shall call xi, at the right border of the loop. The function f(xi) is computed and also accumulated. The array is accumulated by means of the "indexing" feature at the border of the loop. Whenever you connect a wire from the inside to the outside of a loop a border node is formed to control how the data flows. Pop-up on the node to enable "indexing" and the result of each iteration will be assembled into an array. Leave indexing off and only the single number that was calculated last will be passed on.

Outside the loop, the arrays are "bundled" into a form that the XY-graph module will accept: an array of x-values bundled with an array of corresponding y-values. A "bundle" is a LabView data-structure that is a convenient way of collecting several things into one. It basically creates a list of ordered pairs, {xi,yi} which the program then builds into an array with three such lists. The graph reads these three lists of ordered pairs and plays connect the dots, making three graphs. One graph is made by taking the xi array and bundling it with itself, producing the graph of y =x. The downward parabola, y = rx(1 - x), is made by bundling xi with f(xi).

That was the easy part, the graph of the cobweb part is a little harder and requires some discussion beforehand. We've already written a VI, named quad.vi, that calculates successive iterates of the quad map. The VI is located in c:\NLD-chaos\LABVIEW\CHAOS. So let's assume we have a series of map-iterates

$m_i= \{m_0,m_1,m_2,\cdots ,m_n\}= \{x_i,f(x_i),f(f(x_i)),\cdots f^n(x_i)\}$

We arrange these values in a way that will let LabView draw the cobweb by connecting the points:

$\{x_i,y_i\}=\{(m_0,0),(m_0,m_1),(m_1,m_1),(m_1,m_2),(m_2,m_2),(m_2,m_3),\cdots (m_{n-1},m_{n-1}),(m_{n-1},m_n)\}$

The x-values form a series $\{m_0,m_0,m_1,m_1km_2,m_2,\cdots,m_{n-1},m_{n-1}\}$

which we may form by "interleaving" the xi array with itself and removing the last two elements. Fortunately, LabView has a function that interleaves arrays and a function that takes an array's subset.

The y-values of the cobweb form a series $\{0,m_1,m_1,m_2,m_2,\ldots ,m_{n-1},m_n\}$

which can also be made by interleaving the xi array and taking subsets (and replacing one element with a zero). Once you have the two arrays of x's and y's, you must bundle them together and then build an array out of this bundle and the other bundled plots of f and g (see the right side of Figure 16).

Try making the cobweb analyzer yourself. First, understand and make the section in Figure 16. Make the "Build array" icon have only two inputs, and then run the program. It should give you a graph of y =x and y =rx(1-x). Next, expand the "Build array" icon to three inputs and start the cobweb part. Be sure to look at quad.vi to see how it works. You can add a VI into your diagram by going to the functions palette and clicking "Selecting a VI...". You can then treat it as any other module with inputs and outputs. Consequently, all of the inputs in quad.vi will need to show up on your front-panel except for the pre-iterate input which you should just wire with a zero in your diagram. There are lots of different ways to program the cobweb, but you'll probably find the array functions "Build Array," "Interleave 1-D Arrays," "Replace Array Elements," "Array Size," and "Array Subset" helpful. Read what these modules do, and then make a block diagram on paper illustrating how you would use these functions to make the necessary x and y arrays for the cobweb. Then wire it up in LabView, bundle them together as before, and input it into the "Build Array" next to the other two bundles. Be sure to pay attention to whether your inputs/outputs are single elements or arrays of many elements. Some of the module inputs need to be told whether to accept elements or arrays.

Again, try to do this on your own. If you get really stuck, you can look in appendix A of this write-up for hints. Once you have the working VI, you can use it for a variety of things. Observe how the derivative of f(xi) affects the stability of fixed points (Ref. 1 §10.1). Look for limit cycles, period windows, etc. Change the function f(xi) to f(f(xi)) or some other 1-d map and observe the same qualitative behavior. To do this, you will have to modify both your program and quad.vi. Save quad.vi as quad2.vi in your directory rather than messing with the original. Try any non-invertible function that takes the unit interval to itself. There are numerous ones in the references: the tent map, the shift map, the sine map, etc. Try to come up with one of your own. Pretty much any function with a range of the unit interval that starts at (0,0) and goes to (1,0) will work. The maps must be non-invertible because there must be some dissipation in the equations [Ott p8]. Try at least one other map and analyze it.

## Numerical calculation of Liapunov Exponents

Sensitive dependence on initial conditions is one of the defining features of chaotic behavior. Consider two close initial-conditions, ξ and ξ + δ evolving in time. If their distance of separation increases exponentially, i.e. | f(t,ξ) - f(t,ξ + δ) | = δeλt, we say the function f exhibits sensitive dependence on initial conditions. The coefficient is necessarily positive and it is called the Liapunov exponent (see ref. 1, section 9.3 especially the qualifications after fig 9.3.5). As such, if you can calculate or measure , you have a test to determine whether or not a particular system is chaotic. If is not positive, the system is not chaotic.

As previously mentioned, the Liapunov exponents of multi-dimensional systems are the average eigenvalues of the Jacobian matrix of the system (see also Theiler eq's 4-7). So rather than solving an eigenvalue problem on a multi-dimensional system, it's easier to start with a one-dimensional map. The Liapunov exponent for a 1-d map is given by (Ref. 1, p367). Following example 10.5.3 in Ref. 1, write a VI to calculate the Liapunov exponent of the quadratic map as a function of its chaotic parameter . You will probably find it useful to know that the inputs to LabView's arithmetic operators are polymorphic. For example you can wire an array and a constant to the "add" function and the result is a new array whose elements are the old array with the constant added to each of them. Most of the math functions work this way for instance the log function can take an array of numbers and produce an array of logarithms of the numbers (see Figure 17). You will make use of quad.vi again.

Figure 17: LabView functions can take arrays as inputs, producing arrays of results.

Figure 18: Liapunov exponent VI.

The front panel of your finished VI should look something like Figure 18. After you look at the algorithm in Ref. 1, make another block diagram of what you'll want to do and then try it in LabView. You'll probably find a FOR loop helpful. If you find yourself spending more than an hour or so on it, you should look at the solution in the appendix. When you have your working VI, explore the area around r=3.57 especially. What happens when λ--->0 Use your observations to approximate Feigenbaum's ratio δ. Ref.1 suggests 10,000 iterations, but this is a bit excessive, not to mention time consuming. Make sure to have lots of different values for r, the chaotic parameter. Experiment to see what gives you good graphs.

## NLSIM.VI: the simulation VI

Before proceeding to real-time NLD systems, you will take some time to run the simulation VI, NLSIM.VI. Open NLSIM.VI. This VI (Figure19) allows you to display the time-series, return-map and power spectrum of a variety of signals. As in all the VI's, press control-H and move the mouse pointer over the elements of the screen to get specific information on how to use the program.

Figure 19: The simulation VI.

Start the VI, select the cosine function, and focus your attention to the return map. Many dynamical systems are described by a cosine function, for example the simple harmonic oscillator of a mass on a spring: $x(t)=A\cos {(\sqrt{\frac{\kappa}{m}}t)}$. What are the axes of the phase space of this system? What is the shape of the paths in phase space for this system? Is it similar to what you see in the return map? What effect does changing the sample rate have on the shape of the trajectory? When you increase the sample rate, why does the return map narrow around the line y=x? What happens if the sample rate is a multiple of the frequency of the cosine? Now try the function cos(ω1t) + cos(ω2t) + acos(ω1t)cos(ω2t). The return map for this function is more complicated: When a is zero, it's a two-dimensional uncoupled harmonic oscillator and its trajectories are confined to a torus in phase space (c.f. Ref. 1, §8.6). What conditions are necessary for the return-map to show a projection of a torus and not a cycloid? Be sure to explain what you're seeing in the Time Domain and Frequency Domain. Is it chaotic?

Now select the Quadratic Map function and set the parameter r=2.8 . The return map should show a single point. Increase r to about 3, the map will bifurcate, and you should see two points on the return map. Continuing to increase r will produce successive bifurcations and finally chaos at r=3.5. One dimensional maps like this one are good analogs to Poincaré sections and when you sample the real NLD systems synchronous to their driving forces, you will see the same behavior. So it pays to spend some time here to really figure out what's going on. Be sure to compare this map with your cobweb VI at the same value of r. Also look at the quadratic map's bifurcation program.

Take a look at the Henon Map. Play with the non-linear parameter between 0 and about 1.4. What is that funky thing in the Return Map? Look at the Henon map's bifurcation program as well.

## Continuous-time systems- PN Junction

Now we're ready to proceed to real-time continuous systems. At present there are two driven NLD systems at the experiment station: The bouncing ball circuit and the PN-junction. For both these driven systems, the basic set-up is the same: The computer controls the driving amplitude and measures the system's response. Both circuits, as well as most of the supporting electronics are located behind the large panel marked "Nonlinear Dynamics Laboratory."(see fig. 20) Note: the Sine Input switch should be off for the PN-junction part.

Figure 20: The Physics 111-Lab Nonlinear Dynamics Laboratory Panel.

The drive oscillator is an Stanford Research System Model DS345. It is fed into the external reference pin Vref of the DAC on the computer. Recall from your basic electronics experience that when you set a DAC to a specific level, e.g. j out of a maximum of N, the DAC outputs a voltage equal to $V_{DAC}=V_{ref}\frac {j}{N}$. Thus if Vref is a sine-wave varying in time, the DAC outputs a sine wave of attenuated amplitude. The computer modified sine-wave is then fed to the NLD system under study. The NLD system's response is sent to the ADC input of the computer where it can be sampled either synchronously or asynchronously with respect to the driving frequency. When sampling is performed asynchronously, an internal timebase (not shown) is used. Synchronous sampling is achieved by a "strober," which sends TTL pulses to the EXTERNAL TRIGGER pin of the ADC whenever the drive signal achieves a certain phase (adjustable as "Pulse delay" on the NLD box) in its cycle. The sine-wave is also connected (via the square-wave converter on the NLD box) to the computer's timer pin (labeled GATE0) for computer measurement of the drive frequency.

Figure 21: Connecting the scope to see the phase portrait of the PN-junction.

The PN junction circuit requires power, so turn on the system with the switch on the power supply located at the top of the rack. Note: You should hook up the TTL bar output to the Z-axis input on the back of the scope. You will also need to have the Sine Input Switch Off.

Let's begin with the PN Junction: Make the following connections referring, in addition to Figure 21:

• $\bar {T}\bar {T}\bar {L}$ to the back of the Tektronix Dual Trace 2215A scope
• Set the SRS DS345 to f= 3500 Hz and 10 volts, VPP output, Terminate with 50Ω, .
• Set the STROBE PHASE CONTROLLER "DELAY RANGE" to 30 μs and "ADJ" to 0.0 (fully CCW)2
• Set the STROBE PHASE CONTROLLER "WIDTH RANGE" to 3 μs and "ADJ" to 0.0 (fully CCW)
• Set PN JUNCTION DRIVER "GAIN" to 0.0 (fully CCW).

You should now see a horizontal line on the scope. Increase the PN JUNCTION DRIVER GAIN and the scope should display an ellipse. Having connected Vo(t) and Vs(t) (recall the notation of the introduction) to the x, y axes of the oscilloscope(remember to put the time dial on x.y). The displayed graph is a plot of I vs. Voscos(θ), a two-dimensional projection of the system's path in phase space.

At such a low driving amplitude, the diode is responding linearly: The diode current is periodic at the same frequency as the drive oscillator with a small phase offset. Observe the behavior as you increase the DRIVER GAIN- it should follow the discussion of the pn-junction earlier in this write-up and the video.

The scope highlights sections of the plot according to the STROBE PHASE CONTROLLER adjustments. Hook up the TTL bar output to the Z-axis input on the back of the scope. Make sure the scope intensity is not too bright and you should be able to see the dots corresponding to points of constant phase of the drive. Recall that the state-space for this system is (I,Vd,θ) so a set of points sampled at a constant θ constitute a Poincaré section, a subset of state space that slices the attractor non-tangential to the trajectories. The Poincaré section will contain as many dots as there are loops. Changing the DELAY potentiometer moves the slice along the attractor. When you sample asynchronously, the computer will sample coincident with the dots.

Now let's include the computer. All of the connections to the computer are made through a single box, called the Computer Interface Box (fig. 22).

Figure 22: The connections on the computer interface box

Disconnect the SRS DS345 from Vin and make the following connections, in addition to looking at figure 23. Voscos(θ),

• SRS DS345 "50Ω; Sine output --------------------------to "EXT REF"
• COMPUTER "AO 0"------------------------------------------to PN JUNCTION "Vin"
• PN JUNCTION "Differential Idiode out"-------------to "AI 0"
• STROBE PULSE GENERATOR "TTL OUT"------------------------to "GATE"
• STROBE PULSE GENERATOR "TTL OUT"----------------------to "EXT TRIG"
• Sine Iput switch set to --------------------------------Off

Figure 23: Connections for computer sampling of the PN-junction.

Start LabView and load NLDGEN. You should see a display similar to Figure 24.

Figure 24: NLDGEN.VI (similar to pnjunc1.vi)- For sampling real-time driven NLD systems

This VI controls the drive amplitude, collects a sample of data points, and presents three different views of the response: a time-series, Fourier power spectrum, and return-map. We suggest you use ~30kHz for the sampling rate. The more points you take in your sample, the better your DFT resolution will be, but the longer the computer will take to calculate and display. So to start, select 256 points. You should make sure that the product of "Number of points per value of V" and "#" of points" does not exceed 231 - 1. Vary the drive amplitude and estimate Feigenbaum's ratio based on the system's bifurcation points. Compare the return map to the picture you see on the scope. There are two other features of this VI: You can save the data to a file, and send the data to a subroutine that calculates information dimension. We'll discuss these options later.

Before moving on, open up nldbifur.vi, which will allow you to view the bifurcation diagram for the PN-junction. Leave the computer and hardware in the same configuration as for nldgen.vi, except turn the knob for PN-JUNCTION DRIVER GAIN all the way up (CW). You should also look at the real-time output on the scope, so also hook the output on the SRS DS345 to the X-channel on the scope, and the IDH output on the PN-JUNCTION DRIVER into the Y-channel, just as before. Run nldbifur.vi and look at several different ranges of V.

# Bouncing Ball

Let's now turn our attention to the bouncing ball circuit (BB).

Figure 25: Connections for Bouncing Ball Circuit.
• Connect the SRS DS345 Sine out to the DRIVE input on the panel.
• Connect BB OUT1 to the Tek 2215 scope CH 1.
• Connect BB OUT2 to the Tek 2215 scope CH 2.

Set the DS345 to ~50Hz and ~10V peak-to-peak (just turn the knob to about half-way in its range). Look at each channel in time. They should both be sinusoids. Put the scope in X-Y mode and you will see the system's phase portrait. The circuit is fully described in the reprints so we will only summarize it here: The circuit simulates the dynamics of a ball bouncing on a vertically sinusoidally driven table. One output is ball velocity, one is ball position (height from a fixed reference). When the table frequency and amplitude are small, the ball basically stays on the table and the phase portrait is that of an harmonic oscillator. Increase the drive frequency and you should see the phase-portrait begin to change. The phase-portrait becomes jittery and then it should jump to behavior that is periodic at twice the drive frequency. Take some time to understand the simple behaviors of the phase portrait: Which axis is velocity? Which is position? Why is the initial plot an ellipse? What's happening just as you increase the drive frequency but before the plot becomes jittery? Try varying the drive voltage.

Now we're ready to hook up the computer. Make/check the following connections, referring to fig. 26:

Figure 26: Connections for Bouncing Ball Circuit to the computer.

• Disconnect the PN-JUNCTION setup

Connect . . .

• DS345 "Sine output"-------------- to "EXT REF"
• DS345 "Sync out"--------------- to STROBE PULSE GENERATOR "SINE INPUT"
• "AO 0"--------------- to Bouncing ball "DRIVE"
• Bouncing ball OUT 1-------------- to scope CH1
• Bouncing ball OUT 2----------------- to scope CH2 and "AI 0"
• STROBE PULSE GENERATOR "VC2"--------- to "GATE"
• STROBE PULSE GENERATOR "TTL OUT"--------- to "EXT TRIG"
• Set the Sine Iput Swtich to-------------------------------Off
• Set the DS345 to f =90Hz and full amplitude output.
• Run the NLDGEN VI and start by sampling 256 points at 500 Hz
What is fundamentally different about the chaotic behavior of the bouncing ball circuit when compared to the PN-Junction? (Hint: What would the bifurcation diagram for this circuit look like? Does it even have one?)

## Information dimension

Figure 27: Data from the Quadratic map, analyzed by the information-dimension VI.

Chaotic systems have fractal attractors and a commonly measured quantity is the attractor's information (or correlation) dimension (Ref. 1, §11.5, Ref. 4, pp1062-1063, pp1066-1070). The correlation dimension measures how the state-space "mass" of the attractor scales with length. CALCCORR.VI computes C(N,ε) , the number of points within a distance ε of each other, for increasing embedding dimensions and then displays log2C(N,ε) vs. 2log2ε (Figure 27). The slope of the linear region of the plot is then 1/2 times the information dimension. See the article by Theiler for full details and Ref. 9 for a simple application of these concepts.

As an introductory exercise, do the following: Run NLSIM.VI and CALCCORR.VI. Select "Random number generator." Choose 2048 points and press the "Send data to the info-dimension VI" button. Press "Calculate" in CALCORR. When the calculation is done, use the graph cursors to estimate the slope of each line. How does each slope compare to the line's embedding-dimension?

The data calculated by CALCCORR.VI can be saved to a data file for more accurate linear fitting. Simply press the "send data to a file" button, name the file, and open it from within Excel (or copy it to a disk and take it to your favorite software). You should measure the information dimension of the PN-junction and the Bouncing Ball circuit for varying driving amplitudes and frequencies. Are the values what you expect?

# What your report should contain

Your report should be an introduction to NLD and Chaos and a presentation of experimental results. Most of this material about chaos is unfamiliar to the majority of undergraduates. Thus your goal should be to illustrate the concepts set forth in the reading by relating them to what you did in lab.

The results you should present are at least the following: Experimental confirmation of the bifurcation route to chaos. The value of Feigenbaum's scaling constant α and δ measured from a variety of sources. What does Feigenbaum's ratio mean? The information (Lyapunov) dimension of the attractors of the PN-junction and the Bouncing Ball circuit as compared to that of conservative (Hamiltonian) systems. How do the Fourier Transform, the frequency spectrum, and the power spectrum differ?

Be sure to answer the questions posed in the write-up and include your answers to the pre-lab.

# The Custom VI's for this experiment

Henonbifr.VI Illustrates bifurcation in one of the variables of the Henon map.

Henon.VI Iterates the Henon map

NLSim.VI Displays time-series, return maps, and Fourier spectrum of many simulated signals and an arbitrarily acquired signal

PNJunc1.VI Acquires and analyzes time-series data acquired from the PN junction

NLDBifur.VI.

This VI permits you to explore the Bifurcation diagram of the quadratic map. You can change the parameters to reveal the fine detail at the onset of chaos.

# Appendix A: Cobweb analyzer for the quadratic map. (Cobweb2.vi)

Note: The elements in the current LabView program VI do not look quite like the elements in these diagrams.