Project

Drag Force Over a bicycle (Python)

# -*- coding: utf-8 -*-
"""
Created on Mon Oct  1 01:01:30 2018

@author: mayan
"""

# Drag Force Calculation

# Inputs 
import matplotlib.pyplot as plt
import math

def d_f_vs_v(velocity,Area,c_d,rho):
	d_f_v = []
	for v in velocity:
		d_f_v.append(0.5 * c_d * Area * rho * v**2)
	#return d_f_v  
	plt.figure(1)    
	plt.plot(velocity,d_f_v, '-o')
	plt.xlabel('velocity(m/s)')
	plt.ylabel('drag force(N)')
	plt.title('Drag Force vs Velocity')
	plt.show() 

def d_f_vs_c_d(velocity,Area,c_d,rho):
	d_f_cd = []
	for cd in c_d:
		d_f_cd.append(0.5 * cd * Area * rho * velocity**2)
	#eturn d_f_cd  
	plt.figure(2)
	plt.plot(c_d,d_f_cd, '-rd')
	plt.xlabel('drag coefficient')
	plt.ylabel('drag force(N)')
	plt.title('Drag Force vs Drag Coefficient')
	plt.show() 


A = 0.1 # Frontal Area
rho = 1.2 # Density

d_f_vs_v(list(range(25)), A, 0.8, rho)


d_f_vs_c_d(2, A, [x * 0.1 for x in range(0, 25)], rho)

Drag Force vs Velocity:

Drag Force vs Drag Coefficient:

Conclusion:

1. Drag Force is proportional to the square of the velocity.

2. Drag Force is proportional to the drag coefficient.

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.