To calculate drag force against a cyclist in Python
Aim:
To calculate drag force against a cyclist.
Objective:-
- To write a program to plot Velocity vs Drag force.
- To write a program to plot Drag Co-efficient vs Drag force.
Introduction :
Drag is the force of wind or air resistance pushing in the opposite direction to the motion of the object, in this case, the cyclist.
Frontal Area:
Frontal area is the area you see if you look at a cyclist from the front. Reducing this area means that there are fewer collisions with the wind.
Drag Coefficient:
The drag coefficient is a number that aerodynamicists use to model all of the complex dependencies of shape, inclination, and flow conditions on aircraft drag.
Any object moving through a fluid experiences drag - the net force in the direction of flow due to pressure and shear stress forces on the surface of the object.
The drag force can be expressed as:
Fd = cd 1/2 ρ v2 A
where
Fd = drag force (N)
cd = drag coefficient
ρ = density (1.2 kg/m3 for air )
v = flow velocity (m/s)
A = characteristic frontal area of the body (m2)
Program:
Case-I
Program to plot Velocity vs Drag force
#program to calculate the drag force
#Inputs
import matplotlib.pyplot as plt
#drag co-efficients
c_d = 0.8
#frontal area in m^2
A = 0.1
#Density in kg/m^#
rho = 1.2
#Velocity in m/s
velocities = [5,6,7,10,11,15]
drag_force = []
for velocity in velocities:
drag_force.append((0.5*rho*velocity*velocity*A*c_d))
plt.plot(velocities,drag_force)
plt.xlabel('Velocity(m/s)')
plt.ylabel('Drag Force(N)')
plt.show()
Case-II
Program to plot Drag Co-efficient vs Drag force
#program to calculate the drag force
#Inputs
import math
import matplotlib.pyplot as plt
#velocity in m/s
velocity = 8
#frontal area in m^2
A = 0.1
#Density in kg/m^#
rho = 1.2
#drag coeeficient
C = [0.5,0.7,0.8]
drag_force = []
for c in C :
drag_force.append(0.5*rho*velocity*velocity*A*c)
plt.plot(C,drag_force)
plt.xlabel('Drag co-efficient')
plt.ylabel('Drag Force(N)')
plt.show()
Conclusion:
Case I : Drag force is increasing w.r.t. the velocity .
Case II: Plot shows the linear variation between the Drag coefficient & Drag force.