Project

Flow over bicycle - Python

\"\"\"
Program to claculate the drag force 
and plot velocity vs dragforce
\"\"\"

import matplotlib.pyplot as plt
#Inputs
c_d = 0.8
A = 0.1
rho = 1.2
velocities = [5,6,7,8,9,10,11,12]
dragforces = []
for velocity in velocities:
	dragforces.append((0.5*c_d*A*rho*velocity*velocity))

print(dragforces)

plt.plot(velocities,dragforces)

plt.xlabel(\'Velocity\')
plt.ylabel(\'Dragforce\')
plt.title(\'Velocity vs Dragforce\')
plt.show()
\"\"\"
Program to claculate the drag force 
and plot Dragforce vs drag coefficient
\"\"\"

import matplotlib.pyplot as plt
import numpy as np
#Inputs
v = 5
A = 0.1
rho = 1.2
c_ds = np.linspace(0.5,1.5,10)
dragforces = []
for c_d in c_ds:
	dragforces.append((0.5*c_d*A*rho*v*v))

print(dragforces)

plt.plot(c_ds,dragforces)

plt.xlabel(\'Coeff of dragforce\')
plt.ylabel(\'Dragforce\')
plt.title(\'Coeff of dragforce vs Dragforce\')
plt.show()

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.