Project

Python program to calculate drag force against a cyclist

This is the Python program to calculate drag force against a cyclist.

The factors involved are Velocity,Drag coefficient,Frontal Area,Density of air.

import matplotlib.pyplot as plt
A=1.75
d=1.12
v=[2,3,4,5,6,7,8,9]
cd=0.75

drag_forces=[]

for velocity in v:
	drag_forces.append((0.5*A*d*cd*velocity*velocity))

plt.plot(drag_forces,v)
plt.ylabel('velocity')	
plt.xlabel('drag force')
plt.title('Drag Force vs Velocity')
plt.show()

V=4
c_d=[0.25,0.75,1.25,1.5,2.25,3,3.25,4]

drag_forces=[]

for drag in c_d:
	drag_forces.append((0.5*A*d*drag*V*V))

plt.plot(drag_forces,c_d)
plt.ylabel('Drag Coeffcient')	
plt.xlabel('drag force')
plt.title('Drag Force vs Drag Coefficient')
plt.show()

The Plots are as below :

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.