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:
Housam Binous (2020). Forced Duffing Oscillator (https://www.mathworks.com/matlabcentral/fileexchange/16731-forced-duffing-oscillator), MATLAB Central File Exchange. Retrieved .
Global variables should be avoided. ALWAYS!
Just change the header of duffing.m to
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]);
Merci pour les codes..
How can I plot Amplitude vs Frequency with this code?
Thank you, Binous. helped me a lot.
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.
thank you for your efforts
I have a question
in your m-file xdot=duffing(t,x), why omega^2*x(2) term is plus sign not negative sign?
i'm very happy to using this programme it's very nice
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;
they are really helpful;
very good, helped me a lot.
The m-file doesn't work with epsilon < 0
very helpful and easy to understand
added link to Mathematica 6.0 Demonstration.