duffing.nb 1

Undamped Duffing Equation

In[299]:= sysid

Mathematica 4., DynPac 10.58, 4 17 2000

In[300]:= intreset; ê ê In[301]:= plotreset;

Hard Model

ü Introduction

In this notebook, we look at the periodic solutions of two forms of the the undamped Duffing equation, which is a with a cubic nonlinearity in the spring force. In the hard-spring model, the cubic term adds to the linear term, and the spring force has the property that the force per unit extension increases with increasing x. The equation describing this is

d2 x ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + x + x3 = 0. dt2

In system form, which we obtain by letting v = dx/dt, this is

x° = v, v° =-x - x3 .

This is a and all of the orbits are described by an energy integral:

1 1 1 ÅÅÅÅÅ v2 + ÅÅÅÅÅ x2 + ÅÅÅÅÅ x4 = E, 2 2 4 where the energy E is constant on each . Each such orbit is a closed oval, symmetric about the x-axis, the v-axis, and the origin. The amplitudes of the maximum displacement, xm , and the maximum , vm , are easily related to the enery:

1 2 1 2 1 4 E = ÅÅÅÅ2 (vm = ÅÅÅÅ2 (xm + ÅÅÅÅ4 (xm .

4 We see that for large E, vm goes like E whereas xm goes like E , so that the orbits become increasingly elongated along the v-axis as E increases. Our detailed work below will confirmL this.L L è!!!! è!!!! ü Defining the System for Mathematica

In[302]:= setstate x, v ;

@8

In[303]:= setparm ;

In[304]:= slopevec = v, -x - x^3 ; @8

ü Example 8<

We start by constructing a single orbit which as we already know will be periodic.

In[306]:= sol1 = integrate 1, 0 , 0, 0.02, 400 ;

In[307]:= labon = "Duffing Equation"; @8 < D In[308]:= graph1 = phaser sol1 ;

Duffingv Equation @ D

1

0.5

x -1 -0.5 0.5 1

-0.5

-1 duffing.nb 3

ü Period

We find the period of this orbit it two ways. First we use the energy integral, which gives for the period the formula

In[309]:= tau xmax_ := 4 * Integrate 1 Sqrt 1 + xmax^2 2 * 1 + Sin q ^2 , q,0,p 2

In[310]:= tau 1 @ D @ ê @ H ê L H H @ DL LD 8 ê

Thus Mathematica$%%%%%% recognizes theA integralE as an elliptic integral. To get the numerical value, we use the function N:

In[311]:= numtau xmax_ := N tau xmax

In[312]:= numtau 1.0 @ D @ @ DD Out[312]= 4.76802 @ D Alternatively, we can use NIntegrate in the original expression:

In[313]:= numtau2 xmax_ := 4 * NIntegrate 1 Sqrt 1 + xmax^2 2 * 1 + Sin q ^2 , q,0,p 2

In[314]:= numtau2 1 @ D @ ê @ H ê L H H @ DL LD 8 ê

In[315]:= period sol1

Out[315]= 4.76 @ D In general, the function period is accurate to within one step, which in this case is 0.02, so the results are consistent. Because of the cubic restoring force, we expect the period to become shorter as xmax increases. In the opposite direction of xmax decreasing, we expect eventually to reach a regime in which the cubic term is negligible, for which the period will approach 2p. We illustrate this by plotting period versus amplitude. duffing.nb 4

In[316]:= pergraph = Plot numtau2 xmax , xmax, 0, 10 , PlotRange -> 0, 2 Pi , AxesLabel -> "xmax", "period" , PlotLabel -> "Duffing Equation" ;

period @Duffing@ EquationD 8 < 8 < 6 8 < D

5

4

3

2

1

xmax 2 4 6 8 10

The graph illustrates what we expected about the period. Note that the dependence on amplitude is strong -- at xmax = 10 , the period is less than 1/6th the value for small xmax.

ü Orbit Shape and Amplitude

We construct a family of orbits, with amplitudes ranging from 0.25 to 4 by factors of 2.

In[317]:= initlist = 0.25, 0 , 0.5, 0 , 1.0, 0 , 2.0, 0 , 4.0, 0 ;

In[318]:= setcolor BurntSienna, CadmiumYellow, LawnGreen, Maroon, Salmon ; 88 < 8 < 8 < 8 < 8 << In[319]:= plrange = -12, 12 , -12, 12 ; @8

88 < 8 << duffing.nb 5

In[320]:= portrait initlist, 0, 0.01, 600, 1, 2 ;

Duffingv Equation @ D

10

5

x -10 -5 5 10

-5

-10

Clear confirmation of our prediction of elongation with increasing amplitude.

Soft Spring Model

ü Introduction

In the soft-spring model, the spring force has the property that the force per unit extension becomes less as x increases. This is modeled by the equation

d2 x ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + x - x3 = 0. dt2

We see that for x > 1, the spring force actually changes sign and is therefore no longer a restoring force. We would predict that at least some of the solutions of this equation are not periodic. There is still an energy integral and now it takes the form

1 1 1 ÅÅÅÅÅ v2 + ÅÅÅÅÅ x2 - ÅÅÅÅÅ x4 = E. 2 2 4 duffing.nb 6

For very small x, the x4 term can be ignored and the behavior of the resulting linear system is the same as the small x behavior for the hard-spring model -- periodic solutions with (nearly) circular orbits. For large x the situation is very different for the soft spring. The energy is no longer positive definite and therefore no longer precludes unbounded motions. In fact it is clear that when the spring force starts going the wrong way, the solution will shoot off to infinity. Let's demonstrate some of these points with Mathematica.

ü Defining the System for Mathematica

In[321]:= setstate x, v ;

In[322]:= setparm ; @8

ü Equilibrium States8<

One interesting new feature is the presence of three equilibrium states. We find them and classify them.

In[325]:= eqstates = findpolyeq

Out[325]= -1, 0 , 0, 0 , 1, 0

In[326]:= eqleft = eqstates 1 ; 88 < 8 < 8 << In[327]:= eqorg = eqstates 2 ; @@ DD In[328]:= eqright = eqstates 3 ; @@ DD In[329]:= classify2D eqleft @@ DD Abbreviations used in classify2D. @ D L = linear, NL = nonlinear, R2 = repeated root.

Z1 = one zero root, Z2 = two zero roots.

This message printed once.

unstable - saddle

In[330]:= classify2D eqorg

stable L , indeterminate NL - center @ D In[331]:= classify2D eqleft H L H L unstable - saddle @ D duffing.nb 7

ü Saddle Point Orbits

We see that the center at the origin is flanked by saddle points. Should make for an interesting . Let's start by constructing the orbits to and from the saddles. We need the eigenvectors at each saddle.

In[332]:= eigleft = Eigenvectors dermatval eqleft

1 1 Out[332]= - ÅÅÅÅÅÅÅÅÅ ,1 , ÅÅÅÅÅÅÅÅÅ ,1 2 2 @ @ DD

In[333]:= eigright = Eigenvectors dermatval eqright 99 è!!! = 9 è!!! == 1 1 Out[333]= - ÅÅÅÅÅÅÅÅÅ ,1 , ÅÅÅÅÅÅÅÅÅ ,1 2 2 @ @ DD

We construct an appropriate set of initial conditions, obtained by small displacements from the equilibria along the 99 è!!! = 9 è!!! == eigenvectors.

In[334]:= eps = 0.01;

In[335]:= initlist = eqleft + eps * eigleft 1 , eqleft + eps * eigleft 2 , eqleft - eps * eigleft 1 , eqleft - eps * eigleft 2 , eqright + eps * eigright 1 , eqright + eps * eigright 2 , eqright - eps * eigright 1 , eqright - eps * eigright 2 ; 8 @@ DD @@ DD @@ DD We integrate in both directions, and we set @@range-checkingDD on to prevent overflows.@@ DDWe use a plotting window of @@ DD {{-3,3},{-3,3}}, and a slightly large range window.@@ DD @@ DD<

In[336]:= sysname = "Soft Duffing";

In[337]:= labshift = 10;

In[338]:= labon = True;

In[339]:= setcolor Red ;

In[340]:= arrowflag = True; @8

In[342]:= bothdirflag = True; 8 ê < In[343]:= rangeflag = True;

In[344]:= plrange = -3, 3 , -3, 3 ;

In[345]:= ranger = -4, 4 , -4, 4 ; 88 < 8 << In[346]:= h = 0.01; 88 < 8 << In[347]:= nsteps = 400;

In[348]:= t0 = 0.0; duffing.nb 8

In[349]:= saddlegraph = portrait initlist, t0, h, nsteps, 1, 2 ;

Soft Duffingv @ 3 D

2

1

x -3 -2 -1 1 2 3

-1

-2

-3

Notice the interesting heteroclinic orbits connecting the two saddle points. Everything else has to fit into this picture, without orbits crossing and without orbits ending, with exceptions to both rules only at equilibrium points.

ü Periodic Orbits

It is pretty clear that the periodic orbits will have to be inside the lens-shaped region bounded by the heteroclinic orbits. Let's construct some of those.

In[350]:= initlist = 0.25, 0 , 0.5, 0 , 0.75, 0 ;

In[351]:= bothdirflag = False; 88 < 8 < 8 << In[352]:= nsteps = 1000;

In[353]:= setcolor Blue ;

@8

In[354]:= pergraph = portrait initlist, t0, h, nsteps, 1, 2 ;

Soft Duffingv @ 3 D

2

1

x -3 -2 -1 1 2 3

-1

-2

-3

ü Outtahere Orbits

Orbits outside the region of periodic orbits are going to run off to infinity. We construct a few of those now.

In[355]:= initlist = 2, 0 , 0, 2 , -2, 0 , 0, -2 ;

In[356]:= bothdirflag = True; 88 < 8 < 8 < 8 << In[357]:= nsteps = 400;

In[358]:= setcolor Magenta ;

@8

In[359]:= outgraph = portrait initlist, t0, h, nsteps, 1, 2 ;

Soft Duffingv @ 3 D

2

1

x -3 -2 -1 1 2 3

-1

-2

-3 duffing.nb 11

ü Grand Finale Phase Portrait

In[360]:= show saddlegraph, pergraph, outgraph ;

Soft Duffingv @ 3 D

2

1

x -3 -2 -1 1 2 3

-1

-2

-3