Project

drag force vs velocity and drag force vs drag coefficient with fig and code

# program to plot drag force vs velocity and drag force vs drag coefficient

import matplotlib.pyplot as plt

c_d= 0.295 #drag coefficient

drag_coefficients = [0.295, 0.45, 0.5, 0.7, 1.14, 1.28]

a = 0.2 #frontal area in m^2

d = 1.2 #density of air in kg/m^3

velocities = list(range(25)) #creating velocities as consecutive numbers from 0 to 24
drag_forces_1 = [] #creating empty list_1
drag_forces_2 = [] #creating empty list_2


for velocity in velocities:
	drag_forces_1.append(0.5*d*a*(velocity**2)*c_d)


plt.figure(1)
plt.plot(velocities, drag_forces_1)
plt.xlabel(\'velocity\')
plt.ylabel(\'drag force\')
plt.title(\'drag force vs velocity\')
plt.show()  


for drag_coefficient in drag_coefficients:
    drag_forces_2.append(0.5*d*a*(velocity**2)*drag_coefficient)

plt.figure(2)
plt.plot(drag_coefficients, drag_forces_2)
plt.xlabel(\'drag_coefficient\')
plt.ylabel(\'drag force\')
plt.title(\'drag force vs drag_coefficient\')
plt.show()  

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.