<math>
Objective:
- To calculate the drag force experienced by the rider
- To plot the velocity vs drag force
- To plot the drag coefficient vs drag force
Explanation:
A cyclist traversing on a bicycle with a certain velocity experiences a drag force which depends on the following factors:
- Density of fluid
- Frontal area: It is the normal area exposed to the flow
- Velocity: The relative velocity experienced by the rider
- Coefficient of drag (Cd): It is a dimensionless quantity used to determine the drag force
Data required for calculation:
As mentioned above, the drag force is dictated by a few parameters. The values of these have been chosen from reference [1] as follows:
- Density of air: 1.225 <math>
</math>kg/m3<math>k g / m 3 kg/m^3 </math>k g / m 3 kg/m^3 - Frontal area: 0.511 <math>
</math>m2 <math>m 2 m^2 </math>m 2 m^2 - Velocity: 0-40 <math>
</math>m/sm / s m/s - Coefficient of drag: 1.1 (upright position)
- Table 1: Values for frontal area and drag coefficient [1]
Formula used:
<math>
Where:
<math>
<math>
A: Frontal area
V: Velocity of flow
<math>
<math>
Code:
import matplotlib.pyplot as plt
cd= 1.1
cd_array= [0.5]*51 # a list containing cd values for plotting the second figure
a= 0.511 # frontal area of rider in m^2
rho= 1.225 # density of air in kg/m^3
velocity = [i for i in range(51)] # array containing velocities form 0 to 50 with interval of 1
drag=[] # defining drag as a list
for v in velocity:
drag.append((0.5*rho*a*v*v*cd))
#plotting figure 1
plt.figure(1)
plt.plot(drag,velocity)
plt.xlabel('Drag force (N)')
plt.ylabel('Velocity (m/s)')
#plotting figure 2
plt.figure(2)
plt.plot(drag,cd_array)
plt.xlabel('Drag(N)')
plt.ylabel('Coefficient of drag (Cd)')Explanation of code:
- import matplotlib.pyplot as plt imports the module "matplotlib.pyplot" and binds that to the name "plt". This is used for plotting the results
- All input parameters like cd, density, frontal area and velocity vector have been assigned and initialized
- A vector for
- A list named drag has been initialized
- A for loop has been initialized and it iterates as many times as the number of elements present in the velocity list. The value of drag is calculated and is appended to the end of the list named drag.
- Figure(1) and figure(2) have been created and the plot() has been used to plot the required curves.
- labelx() and labely() from the matplotlib.pyplot has been used for creating figures and naming the axes
Results and Discussion:
- Plot 1
Fig. 1 Velocity vs Drag force - Plot 2
Fig. 2 Coefficient of drag vs Drag force
From the fig. 1, Velocity vs Drag force; It can be found that there is a parabolic relation existing between the velocity and drag force, this is in coherence with the formula used to determine drag force and velocity.
From the fig. 2, Coefficient of drag vs Drag force; It is found that the relation between Cd and drag is constant throughout (for this case).
It would be more meaningful to plot the first graph as Drag force vs Velocity and not Velocity vs drag force since drag force is the dependent variable and velocity is the independent variable here. however, the plot that's asked for has been printed.
Errors:
No errors were thrown in the command window.
References: