Flow over Bicycle using PYTHON
Aim:
To Write a Python program to calculate drag force against a cyclist.
Case:1 Drag force based on varying velocity
import matplotlib.pyplot as plt
import numpy as np
a=2
vs=[5,6,7,10,12,15,18]
cd=0.8
p=78
f=[]
for v in vs:
f.append(cd*0.5*p*v*v*a)
plt.plot(vs,f)
plt.xlabel('velocity')
plt.ylabel('force')
plt.show()
OUTPUT GRAPH:
The above graph shows the relation between the velocity and drag force.Depends on the velocity value the drag force value changed. The drag force vary with squared of velocity so the plot is like a curve.The curve would not be smoother because I have taken only 5 velocity values.By increasing the number of velocity values, the curve would be more smoother
Case:2 Drag force based on varying drag coefficient
import matplotlib.pyplot as plt
a=2
cds=[0.09,0.42,0.47,0.82,1.15]
v=10
p=78
f=[]
for cd in cds:
f.append(cd*0.5*p*v*v*a)
plt.plot(cds,f)
plt.xlabel('Drag coefficient')
plt.ylabel('Drag Force')
plt.show()
OUTPUT GRAPH
The drag force vary with drag coefficient linearly so the graph should be straight line
Thank You