Aerdodynamic Study of a cyclist using Python
AIM:
To write a Python program to calculate drag force against a cyclist
OBJECTIVES:
- To write a program to generate a Velocity vs Drag force plot
- To write a program to generate a Drag Co-efficient vs Drag force plot for varying shapes
INTRODUCTION
A cyclist riding his/her bicycle at full speed, experiences opposition to motion from the air surrounding them, as a result of the wind resistance/ drag force. The magnitude of the drag force is dependent on factors such as frontal area of the cyclist, density of the medium(in this case air),velocity of the cyclist and drag coeffiecient, which in turn is dependent on the the shape of the frontal area.The formula given below also proves the same.
Hence, cyclists always crouch and reduce their frontal area, so as to reduce drag force and increase their velocity.
FORMULA USED
`F_d = (1/2)* rho * A* V^2*C_d`
where
- `F_d` = drag force
- `rho` = density of the medium
- `A` = frontal area
- `V` = velocity
- `C_d`= drag coeffiecient
PROGRAM CODE(with stepwise explanation)
1)Velocity vs Drag Force
"""
Program to calulate the drag force against a cyclist
"""
import math #math module
import matplotlib.pyplot as plt #module for plotting graphs
#INPUTS
c_d=0.8 #drag coefficient
a=0.1 #frontal area(m^2)
rho=1.2 #density of air(kg/m^3)
v=[] #list of velocities
df=[] #list of drag forces for each case
v_max=10 #max no of velocities to be taken
#CALCULATION
for i in range(0,v_max+1):
v.append(i) #adding velocities to the list
for i in range(0,len(v)):
d_f=0.5*rho*a*(v[i]**2)*c_d #calculating drag force for each value of velocity
df.append(d_f) #adding the calculated value to the list
plt.plot(v,df) #plotting the graph with velocity as X-axis and drag force as Y-axis
plt.plot(v,df,"*") #just for marking each point
plt.xlabel('Velocity (m/s)')#labelling X axis
plt.ylabel('Drag Force(kg/m^2)')#labelling Y axis
plt.show()#displaying the plot
2)Drag Co-efficient vs Drag force
"""
Program to plot a drag force vs drag coeff graph
"""
import math #math module
import matplotlib.pyplot as plt #module for plotting graphs
#INPUTS
cd=[1.28,1.14,0.5,0.45,0.295,0.3,0.1,0.09,0.07,0.03] #list of drag coefficients
a=0.1 #frontal area(m^2)
rho=1.2 #density of air(kg/m^3)
v=10 #velocity
df=[] #list of drag forces for each case
#CALCULATION
for i in range(0,len(cd)):
d_f=0.5*rho*a*(v**2)*cd[i] #calculating drag force for each value of drag coeff
df.append(d_f) #adding the calculated value to the list
plt.plot(df,cd) #plotting the graph with drag force as X-axis and drag coeff as Y-axis
plt.plot(df,cd,"*") #just for marking each point
plt.xlabel('Drag Force(kg/m^2)')#labelling X axis
plt.ylabel('Drag Coefficient')#labelling Y axis
plt.show()#displaying the plot
RESULTS
1)Velocity vs Drag Force
2)Drag Co-efficient vs Drag force
DISCUSSION
- In the first case,the graph obtained is parabolic. Hence, this plot satisfies the equation, as drag force is directly proportional to the square of the velocity
- In the second case,the graph obtained is linear and satisfies the equation, as drag force is directly proportional to the drag coefficient.
CONCLUSION
Hence, we can prove that :
- drag force is directly proportional to the drag coefficient
- drag force is directly proportional to the square of the velocity
with the help of this project.