import numpy as np import matplotlib.pyplot as plt A = 1 w = 6.28 delta = 2 def onde(x,t): return(A*np.exp(-x/delta)*np.cos(w*t)) x=np.linspace(0,10,1000) for t in np.arange(0,4,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)