Clear[Tt, n, l, g, dt, q, p, ω, θ, w, 
        a];
Tt = {};
n = 4000;
l = 9.8;
g = 9.8;
dt = 0.02;
q = 0.5;
p = 0.5;
t = 0;
 ω = 0;
θ = 0.2;   
 
    w = 0;
 a = 0.3;   
u = 
      0.1;
F = 1.2;
Ω = 0.5;
For[i = 1, 
      i ≤ 
        n, i++, 
ω = ω - (g/l)*
            Sin[θ]*dt - q*ω*dt + 
          F*Sin[Ω*t]*
            dt; 
θ = θ + ω*
            dt; 
w = 
        w - (g/l)*Sin[a]*dt - p*w*dt + 
          F*Sin[Ω*t]*dt; 
a = 
        a + w*dt; 
u = 
        Abs[θ - a]; 
t = 
        t + dt; 
AppendTo[
        Tt, {t, Log[u]}];
]
ListPlot[Tt, 
        AxesLabel -> {T, 
            Log[Δθ]}];

Clear[Tt, n, l, g, dt, q, p, ω, θ, w, 
        a];
Tt = {};
n = 4000;
l = 9.8;
g = 9.8;
dt = 0.02;
q = 0.5;
p = 0.5;
t = 0;
 ω = 0;
θ = 0.2;   
 
    w = 0;
 a = 0.3;   
u = 
      0.1;
F = 0.5;
Ω = 0.5;
For[i = 1, 
      i ≤ 
        n, i++, 
ω = ω - (g/l)*
            Sin[θ]*dt - q*ω*dt + 
          F*Sin[Ω*t]*
            dt; 
θ = θ + ω*
            dt; 
w = 
        w - (g/l)*Sin[a]*dt - p*w*dt + 
          F*Sin[Ω*t]*dt; 
a = 
        a + w*dt; 
u = 
        Abs[θ - a]; 
t = 
        t + dt; 
AppendTo[
        Tt, {t, Log[u]}];
]
ListPlot[Tt, 
        AxesLabel -> {T, 
            Log[Δθ]}];