from scipy import * import numpy as np from scipy.integrate import odeint from matplotlib import pyplot as plt g,mu,m,alpha = 10,0.1,0.1,1.3 tau=m/mu def deriv(v,t): return g-(mu/m)*v**alpha t=linspace(0,5*tau,10000) f=odeint(deriv,0,t) plt.plot(t,f) plt.show() g,mu,m,l = 10,0.1,0.1,0.5 omega0=(g/l)**0.5 def derivsec(TH,t): theta=TH[0] thetap=TH[1] return [thetap,-omega0**2*sin(theta)-(mu/m)*thetap] t=linspace(0,20*pi/omega0,10000) #On definit l'intervalle de temps g=odeint(derivsec,[pi/4,0],t) #retourne une matrice deux colonnes avec x et xp aux differents instants plt.plot(t,g[:,0]) plt.show()