Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import pi
- import matplotlib.pyplot as plt
- #La bibliothèque
- mp = 237*1000
- m0 = 750*1000
- Dt = 130
- R = 2.7
- p_air = 1.3
- S = pi*(R**2)
- cz = 0.4
- g = 9.81
- F0 = 12 * (10**6)
- N = 500
- dt = Dt/N
- #Les fonctions
- def masse(t):
- return m0 - (mp/Dt)*t
- def derive(ti,vi):
- return -g + (1/masse(ti))*(F0 - 0.5*p_air*S*cz*(vi**2)+(mp/Dt)*vi)
- def integre(dL,T):
- total=[0]
- a = 0
- for i in range (1,len(T)):
- a += dL[i]*(T[i]-T[i-1])
- total+=[a]
- return total
- #Le main
- T=[0]
- V=[0]
- t=0
- v=0
- for i in range (N-1):
- v= v + dt*(derive(t,v))
- V.append(v)
- t+= dt
- T.append(t)
- plt.plot(T,V)
- Z = integre(V,T)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement