Clear[wd, g, q, w0, th0, ndrive, tlim, sol, th, w, t]

Driven Damped Pendulum

Using dimensionless form of equations of motion from Gollub and Baker, (2nd Ed.), Eq.  3.1.

wd  =  
        2/3;                              
g  =  
        100.0;                                    (* Drive force amplitude   *) 
q = 
        2;                                          (* Damping factor          *) 
w0  = 
        0;                                      (* Initial velocity        *) 
th0  = 
        0;                                   (* Initial angle           *) 
ndrive  =  
        200;                           
\(tlim\  = \ ndrive*2\ Pi/wd\ \ \ \ \ \  (*\ 
      Total\ time\ \ \ \ \ \ \ \ \ \ \ \ \ \ *) 
\)
\(sol\  = \ 
      NDSolve[{\(th'\)[t]\  == \ 
            w[t], 
		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(w'\)[t]\ \  == \ \(-w[t]\)/q\  - Sin[th[t]]\  + \ 
              g\ Cos[wd\ t], 
		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ w[0]\ \  == \ 
            w0, 
		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ th[0]\  == \ 
            th0}, 
	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {w, th}, {t, tlim}, \ MaxSteps\  -> 610000]\)

Plot[th[t] /. sol, {t, 1100, 1200}];

Plot[w[t] /. sol, {t, 800, 900}];

ParametricPlot[{th[t],  w[t]} /. sol,  {t, 800, 
          900}];

ParametricPlot[{Mod[th[t] + Pi, 2  Pi] - Pi,  w[t]} /. sol,  {t, 
          400, 700}];

\(\(\( (*\ Poincare\ Section\ *) \)\(
\)\(
\)\(\(phase\  = \ 0;\)

    \(pw\  = \ Table[0, {i, 20, ndrive}];\)

    \(Do[{pw[\([i]\)]\  = \ 
            w[\((\((i + 20)\) + \ \ phase\ )\)*2\ Pi/wd\ ] /. 
              sol[\([1]\)]}, {i, ndrive - 21}];\)\)\)\)

pw;

pth  =  Table[0, {i, 20, ndrive}];
Do[{pth[[i]]  =  
          Mod[th[((i + 20)  +  phase )*2 Pi/wd ] +  Pi, 
                2 Pi]  -  Pi /. sol[[1]]}, {i, 1, 
        ndrive - 21}]

pth;

ListPlot[Transpose[{pth, pw}], PlotRange -> All, 
        PlotStyle -> PointSize[ .02]];

x

th[1884.96] /. sol

w[1884.96] /. sol