# -*- coding: utf-8 -*-
"""
Éditeur de Spyder

Ceci est un script temporaire.
"""

import numpy as np
import matplotlib.pyplot as plt
g=9.81
L=0.2
T0=2*np.pi*np.sqrt(L/g)
dt = T0/100
N = 3*100000
t=np.linspace(0,(N-1)*dt,N)
theta = np.empty_like(t)
omega = np.empty_like(t)
theta[0] = 45/180*np.pi
omega[0]=0
for n in range(N-1):
    theta[n+1]=theta[n]+dt*omega[n]
    omega[n+1]=omega[n]-dt*g/L*np.sin(theta[n])
    
plt.plot(t,theta)
plt.show()