File Exchange

## Forced Duffing Oscillator

version 1.0.0.0 (24.9 KB) by Housam Binous

### Housam Binous (view profile)

Computes Poincaré section of the forced Duffing oscillator

Updated 16 Oct 2007

The forced Duffing oscillator exhibits behavior ranging from limit cycles to chaos due to its nonlinear dynamics. When the periodic force that drives the system is large, chaotic behavior emerges and the phase space diagram is a strange attractor. In that case the behavior of the system is sensitive to the initial condition. In order to plot a Poincaré section, take one data point from phase space per period of the driving force. The Poincaré section is a complicated fractal curve when the phase diagram is a strange attractor. The Poincaré section is a single point when the phase space diagram is a limit cycle.

Here is a link to a Mathematica 6.0 Demonstration concerning the forced Duffing oscillator:

http://demonstrations.wolfram.com/ForcedDuffingOscillator/

### Cite As

Housam Binous (2020). Forced Duffing Oscillator (https://www.mathworks.com/matlabcentral/fileexchange/16731-forced-duffing-oscillator), MATLAB Central File Exchange. Retrieved .

Matteo Broggi

### Matteo Broggi (view profile)

Global variables should be avoided. ALWAYS!
Just change the header of duffing.m to
xdot=duffing(t,x,gamma,omega,epsilon,GAM,OMEG)

and call ODE45 with an anonymous function

duf = @(t,x) duffing(t,x,gamma,omega,epsilon,GAM,OMEG);
[t x]=ode45(duf,0:2*pi/OMEG/100:400,[0 1]);

Bilel JEBALI

### Bilel JEBALI (view profile)

Merci pour les codes..
Toujours utiles...

Shima Khatiri

### Shima Khatiri (view profile)

Alberto Manzanero

### Alberto Manzanero (view profile)

How can I plot Amplitude vs Frequency with this code?

Thank you

### Adriano Atima de Morais (view profile)

Thank you, Binous. helped me a lot.

farideh mhassani

Akash kumar

### Akash kumar (view profile)

Why this code is not running ?
there is some problem which says ''Error using feval
Undefined function 'duffing' for input arguments of type 'double''.What should I do,any help will be appeciated.

Woo Sang Pyo

### Woo Sang Pyo (view profile)

I have a question
in your m-file xdot=duffing(t,x), why omega^2*x(2) term is plus sign not negative sign?

Woo Sang Pyo

sabara thinam

### sabara thinam (view profile)

i'm very happy to using this programme it's very nice

sabara thinam

### sabara thinam (view profile)

mr.housam binous done a wonderfull making of duffing forced oscillator.. i'm using this in this programme is very usfull my studies...

thank you for the source codes;

Przemyslaw Jasinski

very good, helped me a lot.

Nicholas Fantuzzi

The m-file doesn't work with epsilon < 0

R RAMLAN

very helpful and easy to understand