import numpy as np
import matplotlib.pyplot as plt

A= 1
w=6.28
c=1

def onde(x,t):
    return(A*np.cos(w*(t-x/c)))
    
x=np.linspace(0,10,1000)

for t in np.arange(0,2,0.05):

    plt.clf()
    plt.axis([0,10,-1.5,1.5])
    plt.xlabel('abscisse x')
    plt.ylabel("fonction d'onde s")   
    plt.plot(x,onde(x,t))
    plt.grid()
    plt.pause(0.01)
    

