Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # create new arrays
- Adat = [0] #acceleration
- Vdat = [0] #velocity
- Zdat = [0] #height
- V0 = 0
- Vdat[0] = V0 #set initial conditions
- Z0 = 30000
- Zdat[0] = Z0
- T = 0
- t_step = 0.9 #set time step in seconds
- b = 0.5 #drag coefficient in kg/s
- while Zdat[-1] >= 0:
- A1 = (-m*g-b*np.abs(V0)*V0)/m
- V1 = V0+A1*t_step
- Z1 = Z0+V1*t_step
- T = T + t_step
- Adat.append(A1)
- Vdat.append(V1)
- Zdat.append(Z1)
- V0 = V1
- Z0 = Z1
Add Comment
Please, Sign In to add comment