\(\(\(
\)\(\(l = 9.8;\)

    \(g = 9.8;\)

    \(q = 0.5;\)

    \(Ω = 2/3;\)

    \(nt = 1000;\)

    \(F = 1.35;\)

    \(data = Table[{}];\)

    While[F < 1.5, 
t1 = 0; a1 = 0.2; 
      w1 = 0; 
period[t1, a1, w1, l, g, q, 
        F, Ω, nt, 400]; 
Do[
        period[t1, a1, w1, l, g, q, F, Ω, nt, 1]; 
        AppendTo[data, {F, a1}], {i, 1, 20}]; 
F = 
        F + 0.15/1000;]

    \)\)\)

period = 
        Compile[{a, b, c, l, g, q, 
            F, Ω, {nt, _Integer}, {k, _Integer}}, 
Module[{tt1, tt2, aa1, aa2, ww1, ww2, 
              dt}, 
dt = 3*Pi/nt; 
tt1 = 
              a; 
aa1 = b; 
ww1 = 
              c; 
Do[
tt2 = 
                tt1 + dt; 
ww2 = 
                ww1 - (g/l)*Sin[aa1]*dt - q*ww1*dt + 
                  F*Sin[Ω*tt1]*dt; 
aa2 = 
                aa1 + ww2*dt; 
aa2 = 
                If[aa2 > Pi, aa2 - 2*Pi, aa2]; 
aa2 = 
                If[aa2 < -Pi, aa2 + 2*Pi, aa2]; 
aa1 = 
                aa2; 
ww1 = ww2; 
tt1 = 
                tt2, 
{nt*k}]; 
a1 = 
              aa1; 
w1 = ww1; 
t1 = 
              tt1;
]
];

ListPlot[data, AxesLabel -> {f, θ}, 
        PlotStyle -> PointSize[0.002], 
        PlotRange -> {{1.35, 1.5}, {0, 4}}];