Flow Over Bicycle Using Python
Objective
- To plot Drag force vs Velocity
- To plot Drag force vs Drag Coefficient
Description
In this Program I have created two codes one is to calculate the Drag Force by keeping the Drag Coefficient constant and other is to calculate the Drag Force by keeping the Velocity constant.
# Program to Calculate the Drag Force keeping Drag Coefficient constant by Venkat
import matplotlib.pyplot as plt
# Inputs
c_d = 0.8
A = 1
rho = 1.2
velocity = [5,6,7,8,9,10,11,12,13,14,15]
drag_force = []
# Loop
for v in velocity:
drag_force.append((0.5*c_d*A*rho*v*v))
print(drag_force)
plt.plot(velocity,drag_force)
plt.xlabel(\'Velocity\')
plt.ylabel(\'Drag Force\')
plt.show()
Velocity vs Drag Force
# Program to Calculate the Drag Force keeping Velocity Constant by Venkat
import matplotlib.pyplot as plt
# Input
c_d = [0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5]
A = 1
rho = 1.2
velocity = 10
drag_force = []
#Loop
for c in c_d:
drag_force.append((0.5*c*velocity*velocity*A*rho))
print(drag_force)
plt.plot(c_d,drag_force)
plt.xlabel(\'Drag Coefficient\')
plt.ylabel(\'Drag Force\')
plt.show()
Drag Coefficient vs Drag Force