Project

Python Program To Calculate: Flow over bicycle

Python Program To Calculate Drag Force against a Cyclist.

When a person is peddling the bicycle, he will experiance a force which is against him, This is called drag force.

The Drag force equation is given as:
`F d = 0.5 ⋅ C d ⋅ V 2 ⋅ ρ ⋅ A`

where,
Fd = Drag force (in Newton)

Cd = Coefficient of Drag

V = Velocity (in m/s)

A = Frontal Area (in m^2)

ρ = Density of air (in kg/m^3)

Assumption: As there is no specific values given for desnity of air we will assume

ρ= 1.225 kg/m^3

1. Program to Plot Velocity vs Drag Force.

#Program To calculate the Drag Force of a Bicycle for Different Velocities
#by Vivian Abishai

import matplotlib.pyplot as plt

#Inputs
#Drag Co-efficients
c_d = 0.82

#Frontal Area (m^2)
A = 2.1336 #Area Measured of a Human on a bicycle

#Density of air
rho = 1.225

#Bicycle Velocity
velocities = range(0,21)
drag_forces = []

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

plt.plot(velocities,drag_forces)
plt.xlabel('Velocity - m2s2')
plt.ylabel('Drag Force - Kgm/s2')
plt.show()

1. The inputs are defined.

2. matplotlib.pyplot Library is imported for plotting the graphs.

3. The Velocity is calculated using the range() function, by defining the start value and stop value.

4. A for loop is used to store the drag force values into an empty array.

5. The graph is plotted against Velocities and Drag Force.

Figure 1: Velocity vs Drag Force.

From the Figure 1 we can understand that the Drag Force is a Parabolic Curve with increase in velocity.

2. Python Program to Plot Drag Co-efficient vs Drag Force.

#Program To calculate the Drag Force of a Bicycle for Different Drag Co-efficients
#by Vivian Abishai

import matplotlib.pyplot as plt

#Inputs
#Drag Co-efficients
cd = range(0,2)

#Frontal Area (m^2)
A = 2.1336 #Area Measured of a Human on a bicycle

#Density of air
rho = 1.225

#Bicycle Velocity
velocity = 30
drag_forces = []

for c_d in cd:
drag_forces.append((0.5*rho*A*c_d*velocity*velocity))

plt.plot(cd,drag_forces)
plt.xlabel('Drag Coefficient')
plt.ylabel('Drag Force - Kgm/s2')
plt.show()

1. The inputs are defined.

2. matplotlib.pyplot Library is imported for plotting the graphs.

3. The drag co-efficients are calculated using the range() function, by defining the start value and stop value.

4. A for loop is used to store the drag force values into an empty array.

5. The graph is plotted against Drag Co-efficients and Drag Force.

Figure 2: Drag Co-efficients vs Drag Force.

From the Figure 2 we can understand that the Drag Force is a Linear Curve with increase in Drag Co-efficients.

Conclusion: The python program can be used to calculate the drag force over a human body, against the flow of air.

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.