Vous êtes sur la page 1sur 19

The Duffing Oscillator and Chaos in Non-linear

Dynamic Systems
By: Frank Kral

Abstract
This report explores the dynamics of the Duffing equation. The progression from non-chaotic to
chaotic dynamics is studied using a specific case in which a mass with a non-linear spring, a
linear damping element, and a sinusoidal driver is modeled. This report uses plots of position,
phase plots, Poincare sections and bifurcation diagrams to help characterize the behavior of the
Duffing oscillator. This report also touches on some non-linear and chaotic patterns and
properties such as strange attractors and fractals, self-similarity, multiple equilibrium points,
and multiple resonance frequencies.

June 20, 2017


Clemson University
Clemson, South Carolina
Kral 2

Introduction
The Duffing equation is an equation of motion for a double-well potential system. When this
system is forced periodically, it becomes the Duffing Oscillator. Equation 1 is the general form
of the Duffing oscillator, where δ is a damping constant [1].
𝑥̈ + 𝛿𝑥̇ + 𝛼𝑥 + 𝛽𝑥 3 = Γ cos(𝜔𝑡) (1)
Non-linear springs are commonly modeled as a 𝐹 = 𝑘1 𝑥 + 𝑘2 𝑥 3 , thus the equation of motion for
a mass with a spring in this form creates the Duffing equation. Introducing friction (damping) into
this system can create chaotic behavior.
Dynamic systems can have behavior that appears to be random, and thus difficult to be
predicted. This “randomness” is known as chaos, and is seen in many dynamic systems such as
traffic, weather, non-linear spring-mass systems, logistic maps and more. In reality, this behavior
is not random, but instead highly sensitive to initial conditions. Slightly different initial conditions
can produce a vastly different response for the same system. Uncertainty in approximating a
chaotic system increases exponentially with time, which limits the amount of time meaningful
predictions of a system can be made before the results are random [2]. As defined by Robert L.
Devaney, a dynamic system is chaotic if it is all of the following [2]:
1. Is sensitive to initial conditions
2. Is topologically mixing
3. Has dense periodic orbits.
Chaotic dynamic systems are known to have “patterns, constant feedback loops, repetition, self-
similarity, fractals, and self-organization” [2]. Many of these characteristics appear in the Duffing
oscillator and will be explored through bifurcation diagrams, phase plots, and Poincare sections.

Problem Formulation
In order to explore the characteristics of a Duffing oscillator, a non-linear spring-mass system is
modeled with a linear damper and a sinusoidal driver. The spring force 𝐹 = 𝛽𝑥 3 − 𝑥 where x is
position, the damper is given the constant, c, and the driving force is 𝐹(𝑡) = Γ cos(𝜔𝑡), where
gamma is the amplitude of the forcing function and ω is the driving frequency. Figure 1 shows
this model with the positive x direction being the position away from equilibrium points.
Kral 3

Figure 1. This figure shows a non-linear spring mass system with a linear dashpot and a
sinusoidal forcing driver.
The spring force is nonlinear, so for values of β > 0 the spring is hardening and for values of β <
0 the spring is softening. A plot of spring force vs. position is shown in figure 2 which visually
demonstrates the softening/hardening effect of the spring for some values of β. Note that close
to the origin, all of the spring forces approach the slope of the linear term of the spring force, -
1x, thus springs exhibit approximately the same behavior for all values of β when the mass is
close to equilibrium.

Figure 2. This plot of spring force vs. position demonstrates the forces of the non-linear spring
for various values of β.
In order to more closely study the Duffing oscillator a specific case should be analyzed. The case
above with mass, m, the damping constant, c, the non-linear spring and the sinusoidal driver
needs to be derived to find the equation of motion. Using Newton’s second law, 𝐹 = 𝑚𝑎, the
equation of motion for this system is:

𝐹 = 𝑚𝑥̈ = Γ cos(𝜔𝑡) − 𝑐𝑥̇ − (𝛽𝑥 3 − 𝑥) (2)


where 𝑥̈ is acceleration and 𝑥̇ is velocity. Re-arranging equation 2 and substituting with m =1, c
= 0.3, β = 1, and ω = 1.25, we get the following equation of motion:
Kral 4

𝑥̈ + 0.3𝑥̇ + 1𝑥 3 − 𝑥 = Γcos⁡(1.25 ∗ 𝑡) (3)

Figure 3. The numerical solutions of eq. 3 for various values of Γ.


Numerical solutions for multiple values of Γ have been found and plotted in figure 3 with the
initial conditions 𝑥̇ = 1, 𝑥 = 0. For each graph in this figure, the initial part of the solution has
strange behavior called the initial transient.
Another way to view the numerical solutions is through phase plots. A phase plot is the velocity,
𝑥̇ , plotted against the position, x. The phase plot is commonly used to view the behavior of
systems. Figure 4 shows the phase plots both with and without the transient solutions. These
plots show the periodic orbits and that all of the solutions, except Γ = 0.5, eventually settle
down into a repeating orbit. The case of Γ = 0.5 is a chaotic solution. Another thing to note from
the phase plots in figure 4, is which well(s) of the system each phase plot goes through. From
the phase plots you can see the wells around the minima of the solution, which occur at x =1
and x = -1. All of the phase plots start in the well around the solution for x =1, and for Γ=.2 and Γ
= .3, the phase plots never leave this well.
Kral 5

Figure 4. This figure shows the phase plots for the same numerical solutions in Figure 3. The left
side shows the phase plots with transient solutions while the right side shows the phase plots
with the transient solutions cut off.
The case of Γ = .31 will orbit in the well around the equilibrium point x =-1 after the transient
solutions have subsided. For Γ = .37 the orbit will go through both well after the transient and
the solution for Γ = .8 appears to stay above the saddle point between the two wells after the
transient solutions. The last thing that should be noticed in these phase plots is that the orbits
that don’t form a single loop in the transient solutions have undergone period doubling. The
concept of period doubling is reinforced in the Poincare diagrams, shown in figure five.
A Poincare section is a phase plot for a discrete time interval of a single point for each driving
cycle. This is a beneficial way to look at data because it allows us to see more clearly the
behavior of the system. In a Poincare diagram, a single orbit appears as a single point, such as
the case of Γ = 0.2. A plot with 2 points would imply the period has doubled, as in Γ = 0.3, and so
forth. An interesting pattern unveils itself in the Poincare section of the chaotic case, Γ = 0.5.
This pattern is known as a strange attractor and describes the tendency of the trajectory for
every period of the driving force [3]. It should be noted that the presence of a pattern in this
Poincare section is an indication that the chaos in this case is in fact not random.
Kral 6

Figure 5. This figure is the Poincare sections for the 6 cases of Γ that numerical solutions were
plotted for. These plot one point for each driving cycle, every 2π/1.25 for time t ϵ
[10000,30000].

Figure 6. This figure shows an example of a fractal in the Poincare section of the Duffing
oscillator for the case Γ =0.5 for time 𝑡⁡𝜖⁡[5𝑥106 ⁡⁡⁡15𝑥106 ].
In figure 6, the Poincare section for the case Γ = 0.5 is examined more closely to show another
property of chaotic systems. The section boxed in in the first plot is the dimensions of the
second plots’ axes, and the box in the second plot is the dimensions of the third plots’ axes, etc.
Kral 7

What these plots show is that the pattern is created until the figure is infinitesimally small. This
is a fractal, a pattern known to exist in some chaotic systems.

Figure 7. This figure is the bifurcation diagram of the Duffing oscillator for a range of forcing
amplitudes, Γ. Chaotic regions can be easily identified and some period doubling can be
observed.
Another way to analyze the behavior of this system is to create a bifurcation diagram of the
magnitude of x and 𝑥̇ versus the amplitude of the forcing function, Γ. This diagram is shown in
figure 7 for values of gamma from 0 to 1. This diagram shows that before Γ = .28, all of the
magnitudes of x have 1 value and thus have 1 orbit. After that point, the periods can be seen
doubling. Until around Γ = .32 when the system appears to be chaotic. The Duffing oscillator
sees chaos in several regions on the bifurcation diagram until ultimately around Γ = 0.8 the
solutions go back to the original driving period. Another property of chaotic system that is
present in the bifurcation diagram is self-similarity. Figure 8 shows a region where the doubling
of the period demonstrates self-similarity.
Kral 8

Figure 8. This figure shows the self-similar part of the bifurcation diagram. The period doubling
that occurs at Γ = .283 is self-similar to the period doubling that occurs again around Γ = .314.
Figure 9 highlights the behavior of the Duffing oscillator between the chaotic region ending
around Γ = .355 and the next chaotic region beginning around Γ = .4. This region shows the five
lines that the magnitudes tend towards in this region. This part of the graph can be compared
with the Poincare section at Γ = .38 in figure 5, which verify the bifurcation diagram. It should
be noted the negative values seen in the Poincare section are lost in the bifurcation diagram
because the magnitude is plotted in the bifurcation diagram.
Kral 9

Figure 9. This figure shows the intriguing behavior of the Duffing oscillator between two chaotic
regions.

Conclusions
The Duffing Oscillator is an equation of motion for a non-linearly elastic system such as a spring-mass
system. The Duffing equation, with a non-zero damping constant and a sinusoidal forcing function can
create period doubling which transitions to chaotic regions for different values of the forcing function’s
amplitude, Γ. Through phase plots, Poincare sections and bifurcation diagrams the overall behavior of
the system can be observed. Phase plots are useful to see the trajectory of the particle over time but
cutting off the transient solution is only helpful to simplify non-chaotic portions of the Duffing equation.
Phase plots can show the full orbit of a specific case and which equilibria it oscillates around.

Poincare sections describe the system at a specific point in each driving frequency. After the transient
solutions have been removed from these plots, useful information can be observed about the systems
behavior. A single point implies that the response of the system is in the same point each period. This
would show that the forcing frequency dominates the system response, as was the case for Γ = .2 and Γ
= .8. Multiple points in a Poincare section imply that period doubling has occurred, or that the system is
resonating for multiple frequencies. This response is only possible in non-linear equations due to the
fact that non-linear equations can have multiple equilibrium positions. This is illustrated by this case of
the Duffing equation with the driving function amplitudes of Γ=.3, Γ=.31, and Γ=.37. The only difference
between the phase plots for Γ = .3 and Γ = .31 is which equilibria point the mass oscillates about. The
driving amplitude of Γ = .37 resonates on two different frequencies around two equilibria, which can be
seen from the position plot in figure 3 and phase plot in figure 4.

The properties of chaotic systems can be used to help analyze and understand how systems respond to
certain things. It is important for modeling to understand that non-linear systems response is related to
the initial conditions and the constants of the equation.
Kral 10
Kral 11

References

[1] Kanamaru, T. (2008). Duffing Oscillator. Retrieved from


http://www.scholarpedia.org/article/Duffing_oscillator

[2] (2017, June). Chaos Theory. Retrieved from https://en.wikipedia.org/wiki/Chaos_theory

[3] n.d. The Duffing Equation. Retrieved from http://physics.ucsc.edu/~peter/115/duffing.pdf


Kral 12

Appendix
Matlab Code
Duffing Oscillator Function
%Frank Kral
%Duffing Oscillator
%ME 3050 Modeling of Dynamic Systems
%6/20/17

function dxdt = duff(t,x,gamma)


dxdt=[x(2);gamma*cos(1.25*t)-x(1)^3+x(1)-.3*x(2)];
end
Spring Force Function
%Frank Kral
%ME3050 Final Proj
%duffing oscillator

%Spring behavior function

function force = spring(x,beta)


force = beta*x.^3 - x;
end
Graphing of Spring Force Function
%Frank Kral
%ME 3050 Final Project
%Duffing Oscillator
%
clear
clc

%This matlab file makes a plot fo the spring force response against beta
%for the equation F = beta*x^3 -x

x = linspace(-1.25,1.25,200);
beta = [-2,-.5, 0,1, 3];

for i=1:length(beta)
springForce = spring(x,beta(i));
hold on
ph = plot(x,springForce);
% locs(i,1) = x(170);
% locs(i,2) = springForce(170);%gets an array of points to put beta
values
plotNames{i} = sprintf('Beta = %0.1f', beta(i));

end
% for n=1:length(locs)
% text(locs(n,1),locs(n,2),plotNames(n),'FontSize',8);
% end
Kral 13

legend(plotNames,'Location','South');
xlabel('Position [x]');
ylabel('Spring Response [Force]');
title('Spring Force for Varying Values of \beta');

Numerical Solutions, Phase Plot, Phase Plot Without Transient


%Frank Kral
%Duffing Oscillator
%ME 3050 Modeling of Dynamic Systems
%6/20/17
clear
clc
%define variables
m =1;%mass
c =.3;%damping constant
b = 1;%beta
IC= [1,0]; %initial conditions
gamma = [.2,.3,.31,.37,.5,.8];
omega = 1.25;
titles =
{'Gamma=0.2','Gamma=0.3','Gamma=0.31','Gamma=0.37','Gamma=0.5','Gamma=0.8'};

time = [0,400];%time for problem 3

for i=1:length(gamma)
[t,x]=ode45(@duff,time,IC,[],gamma(i));
%*************numerical Solutions
% subplot(6,1,i)
% ph = plot(t,x(:,1));%numerical solutions
% xlabel('Time [t]');
% ylabel('Position [x]')

%************ phase plots w/transient


% subplot(3,2,i)
% plot(x(:,1),x(:,2))%phase plots
% ylabel('Velocity [dx/dt]');
% xlabel('Position [x]');

%****************phase plots w/out transient


cut = floor(.5*length(t));
subplot(3,2,i)
plot(x(cut:length(t),1),x(cut:length(t),2))%phase plots
ylabel('Velocity [dx/dt]');
xlabel('Position [x]');

title(titles(i));
end
Poincare Sections
%Frank Kral
%Duffing Oscillator
%ME 3050 Modeling of Dynamic Systems
%6/20/17
Kral 14

clear
clc
%define variables
m =1;%mass
c =.3;%damping constant
b = 1;%beta
IC= [1,0]; %initial conditions
gamma = [.2,.3,.31,.37,.5,.8];
omega = 1.25;

titles =
{'\Gamma=0.2','\Gamma=0.3','\Gamma=0.31','\Gamma=0.37','\Gamma=0.5','\Gamma=0
.8'};
dims = {[.5 1 .3 .5],[0 .6 0 .7],[-2 2 -2 2],[-1 2 -1 1],[-2 2 -.75 1.25],[0
1 1.5 2]};

time = 0:2*pi()/1.25:30000;%time for number 4, Poincare section


start = round(length(time)/3);

for i=1:length(gamma)
[t,x]=ode45(@duff,time,IC,[],gamma(i));
ax(i) = subplot(2,3,i);
%ph = plot(t,x(:,1))%numerical solutions
plot(x(start:length(time),1),x(start:length(time),2),'*')%phase plots
title('Poincare Diagram');
axis(dims{i});
xlabel(strcat('Position (x) w/ ',titles(i)));
ylabel('Velocity (dx/dt)');
end

Fractal Function
%Frank Kral
%ME 3050 Modeling of Dynamic Systems
%make a sub plot showing fractals in the Poincare diagram
clear
clc
tic
tStart= 0;
tEnd = 15000000;
gamma = .5;
IC = [1 0];
time = tStart:2*pi()/1.25:tEnd;%time @ frequency
start = round(length(time)/3);

[t,x]=ode45(@duff,time,IC,[],gamma);

subplot(1,4,1)
box = [.9 .9 1.4 1.4 .9; .15 .25 .25 .15 .15];
plot(box(1,:),box(2,:),x(start:length(time),1),x(start:length(time),2),'r*','
MarkerSize',1)%phase plots
title('Poincare Diagram');
%axis(dims{i});
xlabel('Position (x) w/ \Gamma = .5');
ylabel('Velocity (dx/dt)');
Kral 15

subplot(1,4,2)
box2 = [1.12 1.12 1.22 1.22 1.12; .195 .21 .21 .195 .195];
plot(box2(1,:),box2(2,:),x(start:length(time),1),x(start:length(time),2),'r*'
,'MarkerSize',3)%phase plots
title('Poincare Diagram');
axis([.9 1.4 .15 .25]);
xlabel('Position (x) w/ \Gamma = .5');
ylabel('Velocity (dx/dt)');

subplot(1,4,3)
box3 = [ 1.155 1.155 1.19 1.19 1.155; .2005 .202 .202 .2005 .2005];
plot(x(start:length(time),1),x(start:length(time),2),'r*',box3(1,:),box3(2,:)
)%phase plots
title('Poincare Diagram');
axis([1.12 1.22 0.195 0.21]);
xlabel('Position (x) w/ \Gamma = .5');
ylabel('Velocity (dx/dt)');

subplot(1,4,4)
plot(x(start:length(time),1),x(start:length(time),2),'r*')%phase plots
title('Poincare Diagram');
axis([1.155 1.19 .2005 .202]);
xlabel('Position (x) w/ \Gamma = .5');
ylabel('Velocity (dx/dt)');

toc

Bifurcation Diagram
%Frank Kral
%Duffing Oscillator
%ME 3050 of Dynamic Systems
%6/20/17
clear
clc
tic
IC = [1,0];
gamma = linspace(0,1 ,250);
%lims = [.305 .32 1.08 1.31]; %Ends of axes for graph
tStart = 0; %start time
tEnd = 10000; %end time
cutOff = .6;%transient cutOff
time = tStart:2*pi()/1.25:tEnd;%time for number 4, Poincare section

if cutOff ==0
start =1;
else
start = round(length(time)*cutOff);
end
titleText = sprintf('Bifurcation Diagram (Time: [%0.1f,%0.1f], Transient
Cutoff %0.2f)',tStart,tEnd,cutOff);

for i=1:length(gamma)
[t,x]=ode45(@duff,time,IC,[],gamma(i));
xmag = sqrt(x(start:length(time),1).^2+x(start:length(time),2).^2);
Kral 16

if i==0.5*length(gamma)
fprintf('halfway');
end
if i ==.75*length(gamma)
fprintf('3/4 of the way');
end
adj = length(x(:,1))-length(xmag);
x25 = floor(length(x(:,1))/4)-adj;
x50 = floor(length(x(:,1))/2)-adj;
x75 = floor(length(x(:,1))*.75)-adj;
x85 = floor(length(x(:,1))*.85)-adj;
x95 = floor(length(x(:,1))*.95)-adj;
xStart = start -adj;
xEnd = length(xmag);
hold on
%axis(lims);
if cutOff >=.95
ph = plot(gamma(i),xmag(xStart:xEnd),'m.');

elseif cutOff>=.85

ph = plot(gamma(i),xmag(xStart:x95),'c.',gamma(i),xmag(x95+1:xEnd),'m.');
elseif cutOff>=.75

ph =
plot(gamma(i),xmag(xStart:x85),'r.',gamma(i),xmag(x85+1:x95),'c.',gamma(i),xm
ag(x95+1:xEnd),'m.');
elseif cutOff >=.5

ph = plot(gamma(i),xmag(xStart:x75),'y.',gamma(i),xmag(x75+1:x85),'r.');
ph = plot(gamma(i),xmag(x85+1:x95),'c.',gamma(i),xmag(x95+1:xEnd),'m.');

elseif cutOff>=.25

ph =
plot(gamma(i),xmag(xStart:x50),'g.',gamma(i),xmag(x50+1:x75),'y.',gamma(i),xm
ag(x75+1:x85),'r.');
ph = plot(gamma(i),xmag(x85+1:x95),'c.',gamma(i),xmag(x95+1:xEnd),'m.');
else

ph =
plot(gamma(i),xmag(xStart:x25),'b.',gamma(i),xmag((x25+1):x50),'g.',gamma(i),
xmag((x50+1):x75),'y.');
ph =
plot(gamma(i),xmag((x75+1):x85),'r.',gamma(i),xmag((x85+1):x95),'c.',gamma(i)
,xmag((x95+1):xEnd),'m.');
end
%legend won't work
% if i == 1
% legend('t<
.25*tspan','t<.5*tspan','t<.75*tspan','t<.85*tspan','t<.95*tspan','t>.95*tspa
n','Northwest')
% end

end
fprintf('\nShould be graphing')
Kral 17

xlabel('Amplitude of Driving Function \Gamma');


ylabel('Magnitude of x and dx/dt');
title(titleText);
toc

Functions and Graphs Not Included in The Report, Useful for


Understand the Duffing Oscillator
Unforced Duffing Equation
%Frank Kral
function dxdt = unforcedDuff(t,x,a,b,c)
dxdt=[x(2);-a*x(1)^3+b*x(1) - c*x(2)];
end
Plotting the Unforced Duffing Equation
%Frank kral
clear
clc
close all

[t,x] = ode45(@unforcedDuff,[0,100],[1,1],[],1,1,.2);
subplot(2,3,3)
plot(x(:,1),x(:,2))
subplot(2,3,1)
plot(t,x(:,1))
subplot(2,3,2)
plot(t,x(:,2))

[t2,x2] = ode45(@unforcedDuff,[0,100],[1,1],[],.8,1,.2);

subplot(2,3,6)
plot(x2(:,1),x2(:,2))
subplot(2,3,4)
plot(t2,x2(:,1))
subplot(2,3,5)
plot(t2,x2(:,2))

Figure A.1. This figure plots position, velocity, and phase plots for 2 cases of the unforced
Duffing equation.
Kral 18

Duffing Oscillator Position, Spring Force, Driving Force vs. Time


%Frank Kral
%Duffing Oscillator
%ME 3050 Modeling of Dynamic Systems
%6/20/17
clear
clc
%define variables

IC= [1,0]; %initial conditions


%gamma = [.2,.3,.31,.37,.5,.8];
gamma = .37;
%titles =
{'Gamma=0.2','Gamma=0.3','Gamma=0.31','Gamma=0.37','Gamma=0.5','Gamma=0.8'};
titles = {'Gamma = .37'};

time = [0,400];%time for problem 3

for i=1:length(gamma)
[t,x]=ode45(@duff,time,IC,[],gamma(i));
force = 1;
for n =1:length(x(:,1))
force(n) = spring(x(n,1),1);
end
drivForce = 1;
for m =1:length(x(:,1))
drivForce(m) = gamma(i)*cos(1.25*t(m));
end

%subplot(6,1,i)
ph = plot(t,x(:,1),t,force(1,:),t,drivForce(1,:),'m-');%numerical solutions

%plot(x(:,1),x(:,2))%phase plots
title(titles(i));
xlabel('Time [t]');
ylabel('Position [x]');
end
Kral 19

Figure A.2. This figure is the Position (blue), spring force (orange) and driving force (magenta)
plotted against time. This figure is no doubt blurry on paper so an example plot of a single case
will be added below.

Figure A.3 This figure shows a section of these graphs in more detail. This allows a visualization
of which force causes which response.

Vous aimerez peut-être aussi