The periodically forced damped Duffing oscillator

The Poincaré section’s dynamics

ClearAll;
frames=30;
maxt=100000;

eq=x''[t]+δ x'[t]-x[t]+x[t]^3==γ Cos[t];
evs=Mod[t,2 π]==#&/@(Range[0,2 Pi-#,#]&@(2 Pi/frames));
Print[Style["Total points plotted",Blue,17]]
Floor[maxt/(10 2 π)]
data=Block[{δ=0.15,γ=0.3},Reap[NDSolve[{eq,x[0]==0,x'[0]==0,WhenEvent[Evaluate@evs,Sow[{x[t],x'[t]},Round[10 Mod[t,2 π]]]]},{},{t,0,maxt},MaxSteps->∞]]];
Animate[
ListPlot[data[[2]][[k]],PlotStyle->PointSize[0],PlotRange->{1.8 {-1,1},1.3 {-1,1}},AspectRatio->0.71,Frame->True,ImageSize->550,FrameLabel->{"x(t)","y(t)"},LabelStyle->19],{k,1,frames,1},DisplayAllSteps->True,AnimationRunning->False,SaveDefinitions->True]

Creation of this notebook was supported by IT Academy program of Information Technology Foundation for Education (HITSA).