Study to calculate the Drag force using python
Objective:
- Write a program to plot Drag Co efficient vs Drag Force
- Write a program to plot Velcity vs drag Force
Procedure:
Program 1:Program to plot Drag Co efficient vs Drag force
#Program to calculate the co efficient
import math
import matplotlib.pyplot as plt
#inputs
#velocity(m/s)
v = 10
#Frontal Area(m^2)
A = 0.2
#Density(kg/m^3)
rho = 1.4
#Drag co efficient
c_d= [0.1,0.2,0.3,0.4,0.5]
drag_force =[]
for i in c_d:
drag_force.append(0.5*rho*v*v*A*i)
plt.plot(c_d,drag_force)
plt.xlabel('Drag coefficient')
plt.ylabel('Drag force(N)')
plt.show()
Program 1 Result:

Program 2:program to plot Velcity vs drag Force
#Program to calculate the dragforce
import math
import matplotlib.pyplot as plt
#Inputs
#Drag co efficients
c_d = 0.8
#Frontal area (m^2)
A=0.2
#Density(kg/m^2)
rho = 1.2
#velocity(m/s)
velocities = [5,6,7,8,9,10]
drag_force = []
for velocity in velocities:
drag_force.append((0.5*rho*velocity*velocity*A*c_d))
plt.plot(velocities,drag_force)
plt.xlabel('velocity(m/s)')
plt.ylabel('Drag Force(N)')
plt.show()
Program 2 Result:

Conclusion:
According to the given parameters we generated the program and plotted the graph successfully