1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
import numpy as np
import matplotlib.pyplot as plt
#créer un tableau de 100 valeurs de t compris entre 0 et 10 secondes
t=np.linspace(0,10,1000)
omega=2
R=20
r=4
alpha=22
n=6 #nb de pistons
#Définir une fonction de tracé
def f_trace_courbe (x,y,color,xlim,titre,ylabel,xlabel):
plt.plot (x,y,color)
plt.title(titre)
plt.xlim(xlim)
plt.ylabel(ylabel)
plt.xlabel(xlabel)
plt.show()
##Programme
#calcul du debit
for i in range (1,n+1) :
debiti=omega*R*np.tan(alpha)*np.sin(omega*t+(i*2*np.pi/n))*np.pi*r**2
f_trace_courbe (t,np.abs(debiti),'b',(0,10),'Débit de la pompe','debiti','temps') |
Partager