Project

Week 1 Flow over bicycle

Aim:

Write a Python program to calculate drag force against a cyclist.

1) Incorporate a function to plot Drag force vs Velocity

2) Incorporate a function to plot Drag force vs Drag

Drag force:it is force that opposite to the direction of motion of the body

Formula:

drag force=1 *ρ*A*v^2*Cd

Cd=drag coeffiffifficent (unit less)

ρ=density of air(kg/m^3)

A=frountal area(m^2)

v=velocity of cycle(m/s)

1] program to calculate drag vs velocity

import matplotlib.pyplot as plt

import numpy as np

#inputs

#Drag co-efficient

c_d = 0.8

#Frontal area

A = 0.1

#Density

rho = 1.2

#Velocity

#velocities = [2,4,6,8,10,12,14,16,18,20]

velocities=np.linspace(0,100,50) #Between 0 to 100 , 50 step values taken

 

drag_force = []

for velocity in velocities:

 drag_force.append((0.5*rho*A*c_d*velocity*velocity))

 

plt.plot(velocities,drag_force)

plt.xlabel('VELOCITY(m/s)')

plt.ylabel('DRAG FORCE(N)')

plt.title('drag force vs velocity',fontsize=15)

plt.savefig('drag force vs velocity ..')

plt.grid()

plt.show()

When velocity increases two times then the drag force increases four times as shown in above graph the drag force increases as the speed of the cyclist increases.

2] program to calculate drag force vs drag

CODE

 

import matplotlib.pyplot as plt

import numpy as np

 

A=2 #(M2)

RHO=1.125 #(KG/M3)

CD=[.04,.09,.42,.47,.5,.8,.82,1.05,1.15]

 

 

V=[1, 2 ,5, 10, 15, 20]

drag_force=[]

 

for V in V:

f=.5*A*RHO*V*V

FORCE=np.array(CD)*np.array(f)

drag_force.append(f)

 

plt.plot(CD,FORCE)

 

 

plt.xlabel('drag co-efficient')

plt.ylabel('drag force ')

plt.title('drag coefficient vs drag force',fontsize=15)

plt.grid()

plt.savefig('drag coefficient vs drag force')

plt.show()

As seen from plot as the drag coefficient increases the drag force on that particular shape also incraeses.

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.