Project

Challenge 1- Variation of Drag Coefficient and Velocity versus Drag Force

#Program to calculate Drag force in Newtons
# Note: This program provides information of both Velocity and C_d variation with drag
import matplotlib.pyplot as plt
#Inputs in SI units
c_d = [0.2,0.5,0.9] #(rows)
A = 0.2 ; rho = 1.0 # Constants
velocity = [2,10,25] # Columns
row = len(velocity); col= len(c_d); 
drag = [] # Declare a null matrix
# Enter the Formulae for computation here. 
drag = [[0.5*c_d[i]*A*velocity[j]*velocity[j]*rho for j in range(row)] for i in range(col)]
print(drag) # in results, col varies with velocity and row varies with c_d
# Plot the results
for j in range(row):
		plt.plot(velocity,drag[:][j]) 
plt.xlabel(\'velocities in SI\'); plt.ylabel(\'drag in SI\'); plt.title(\'Variation of velocity vs Drag\')
plt.legend(c_d, title = \"Variation for Various draf coeff\") 
plt.show()# This always comes in the end
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.