Project

Drag Force Python

This program results in two graph outputs.

1.Drag force vs Velocity ( Co-efficient is constant, velocity varies)

2.Drag Force vs Drag Coefficient (Velocity is constant, Drag Coefficient varies)

The Drag force vs Velocity Graph shows that for increasing velocity the force increases exponentially since velocity^2 is used. On the other hand The Drag Force vs Drag Coefficient graph increases linearly.

import matplotlib.pyplot as plt
import numpy as np

#inputs
rho = 1.3
c_const = 0.8
v_const = 6
c_d = np.linspace(0.5,1.5,10)
a = 0.2
velocity = np.linspace(5,15,10)
drag_f1=[]
drag_f2=[]

for vel in velocity:
	drag_f1.append(0.5*rho*a*vel*vel*c_const)

for coeff in c_d:
	drag_f2.append(0.5*rho*a*v_const*v_const*coeff)

# Graph of drag force vs. velocity
plt.figure(1)
plt.title(\'drag force vs. velocity\')
plt.xlabel(\'velocity\')
plt.ylabel(\'drag force\')
plt.plot(velocity,drag_f1,\'r\')

# Graph of drag force vs. drag coefficient
plt.figure(2)
plt.title(\'drag  force vs. drag coefficient\')
plt.xlabel(\'drag coefficient\')
plt.ylabel(\'drag force\')
plt.plot(c_d,drag_f2)

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.