Calculation of Drag Force on a Cyclist using Python
AIM:
Write a Python program to calculate drag force against a cyclist.
GOVERNING EQUATIONS:
`F_d=1/2*ρ*A*C_d*v^2`
Where,
`F_d` = Drag Force
`rho` = Density of the air (or the medium in which object is travelling)
A = Frontal Area of the object
`C_d` = Coefficient of Drag (Drag coefficient), its dimensionless
v = Velocity of the object relative to the medium
OBJECTIVES:
- To calculate the drag force on a cyclist.
- To understand the relation between Drag force and Velocity also write a program to plot Velocity vs Drag force.
- To understand the relation between Drag Co-efficient and Drag force also write a program to plot Drag Co-efficient vs Drag force.
THEORY:
- DRAG FORCE
A drag force is the resistance force caused by the motion of a body through a fluid, such as water or air. A drag force acts opposite to the direction of the oncoming flow velocity. This is the relative velocity between the body and the fluid.
- FRONTAL AREA
Ap represents the projected frontal area of the moving body. Imagine that you are exactly in front of a cyclist on his bicycle in front of a white wall, the projected frontal area represents the whole visible area of this cyclist on his bicycle (Fig. 1 and Fig. 2). There are different techniques to directly estimate Ap. The advantage of quantifying it is that this value provides direct information on the aerodynamics of a position.
3. DRAG COEFFICIENT
The drag coefficient is a number which aerodynamicists use to model all of the complex dependencies of drag on shape, inclination, and same flow conditions We can study the effect of shape on drag by comparing the values of drag coefficient for any two objects as long as the same reference area is used and the Mach number and Reynolds numbers are matched.
- Shape has a very large effect on the amount of drag produced.
- Objects having same frontal area but different shapes can have different drag coefficient. For example, take these shapes with same frontal area.
|
Shape |
Drag Coefficient |
|
Air foil |
0.045 |
|
Bullet |
0.295 |
|
Sphere |
0.47 |
|
Prism |
1.14 |
|
Flat Plate |
1.28 |
PROGRAM 1:
Programming language used: Python
Program to plot a graph on Velocity vs Drag force.
# Program to calculate drag force over a cyclist and to plot variation between Drag force and velocity
import matplotlib.pyplot as plt
# Taking Inputs
# Drag coefficient of air
c_d = 0.8
# Frontal area(m^2)
A = 0.553
# Density of air (kg/m^3)
rho = 1.225
# Velocity (m/s)
velocity_1 = [0,10,20,30,40,50,60,70,80,90,100]
drag_forces = []
for velocity in velocity_1:
drag_forces.append((0.5*rho*A*velocity*velocity*c_d))
# Printing the drag forces calculated
print(drag_forces)
# Plotting
plt.plot(velocity_1,drag_forces)
plt.xlabel('Velocity (m/s)')
plt.ylabel('Drag forces (N)')
plt.title('Drag Force vs Velocity')
plt.show()
RESULT:
1. Plot of Drag Force vs Velocity
2. Output Window (displaying the drag forces for the respective velocities)
PROGRAM 2:
Programming language used: Python
Program to plot a graph on Drag Co-efficient vs Drag force.
# Program to calculate drag force over a cyclist and to plot variation between Drag force and Drag coefficient
import matplotlib.pyplot as plt
# Taking Inputs
'''
Drag coefficient for different shapes having same frontal area
Sphere = 0.50
Solid Hemisphere = 0.42
Cube = 0.8
Thin disk = 1.12
Squared flat plate = 1.17
'''
c_d_1 = [0.42,0.5,0.8,1.12,1.17]
# Frontal area(m^2)
A = 0.1
# Density (kg/m^3)
rho = 1.225
# Velocity (m/s)
velocity = 10
drag_forces = []
for C_d in c_d_1:
drag_forces.append((0.5*rho*A*velocity*velocity*C_d))
print(drag_forces)
plt.plot(c_d_1,drag_forces)
plt.xlabel('C_d ')
plt.ylabel('Drag force (N)')
plt.title('Variation of Drag forces with Drag coefficient')
plt.show()
RESULT:
1. Plot of Drag Force vs Drag Coefficients.
2. Output Window (displaying the drag forces for the different drag coefficients for same frontal area).
CONCLUSION:
- By looking at graph-1 from program 1, we can see that the graph is parabolic, this means Drag Force(`F_d`) is proportional to square of the velocity (`v^2`).
- By looking at graph-2 from program 2, we can see that the graph is a straight line, this means Drag Force (`F_d`) is directly proportional to Drag coefficient (`C_d`). Drag force increases linearly with increase in Drag coefficient.
- Also we can see Drag Force (`F_d`) is directly proportional to the Frontal area (A) from the equation of Darg Force. That is why we see cyclist changing their position during racing so that they can reduce their frontal area to face the minimum drag force.