Project

DRAG FORCE

# program to calculate the drag force
# by P ARAVIND

"""DRAG FORCE"""

import matplotlib.pyplot as plt

#coefficient of discharge
c_d = 0.5

#frontal area (m^2)
A = 0.1

#density(kg/m^3)
rho = 1.2

#velocity(m/s^2)
velocities = [ 2,3,4,5,6,7,8,9,10,11,12,13,14,15]

#drag force
drag_force = []

def drag_forcevelocity(rho, A, velocities, c_d):

#frontal area (m^2)
A = 0.1

#density(kg/m^3)
rho = 1.2

#velocity(m/s^2)
velocities = [ 2,3,4,5,6,7,8,9,10,11,12,13,14,15]

#drag force
drag_force = []


for velocity in velocities:
drag_force.append(0.5*rho*A*c_d*velocity ** 2)

return drag_force

drag_force = drag_forcevelocity(rho, A, velocities, c_d)


#plot for drag_force vs velocity

plt.plot(velocities,drag_force)
plt.title('Velocity vs Drag Force')
plt.xlabel('Velocity')
plt.ylabel('Drag Force')
plt.show()

"""
drag coefficients for different shapes

StreamlinedBody = 0.04,
StreamlinedHalf = 0.09
Half-sphere = 0.42,
Sphere = 0.47,
Cone = 0.50,
AngledCube = 0.80,
LongCylinder = 0.82,
Cube = 1.05,
ShortCylinder = 1.15,

"""
drag_coefficients = [0.04, 0.09, 0.42, 0.47, 0.50, 0.80, 0.82, 1.05, 1.15]

velocity = 10

drag_force = []

for drag_coefficient in drag_coefficients:
drag_force.append(0.5*rho*A*drag_coefficient*velocity ** 2)

plt.plot(drag_force,drag_coefficients)
plt.title('Drag Force vs Drag coefficients')
plt.ylabel('Drag coefficiente')
plt.xlabel('Drag Force')
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.