Drag force calculation based on varying velocity and coefficient of drag
Introduction : A drag force is the resistance faced by a moving body when it passes through a fluid. The fluid could be air or water. The magnitude of the force usually acts in the oposite direction to that of motion of the body.
The drag force is given by a formula,
Fd = 0.5*rho*A*v^2*cd
where,
rho - density in kg/m^3
A - Frontal area in m^2
cd - drag coefficient
v - velocity
The Project shows the codes generate for the following:
1) Program to plot Velocity vs Drag force
2) Program to plot Drag Co-efficient vs Drag force
Code 1 : Program to plot Velocity vs Drag force
%program to calculate the drag force over a bicycle
clc
clear all
close all
% inputs
A = 0.7; %area m^2
rho = 1.22 %density kg/m^3
v = [1:30]; %velocity m/s
c_d = 1.2 %coefficient of drag for different areas
%formula
Fd = rho*A*v.^2*c_d*0.5;
plot(v,Fd,'linewidth',3)
xlabel('velocity')
ylabel('drag force')
grid on
Explanation:
The input parameters are rho, A, v, cd as described above. Here, velocity is taken 1 to 30 m/s. Thus we are able to calculate the drag force with the help of the formula.Here, care should be taken that as velocity is a matrix its 'dot' is required. Hence, while squaring the velocity its syntax is written as '.^'.Then plot command is used to create a plot.
Errors faced : None
Results : It generated a plot,
Code 2 : Program to plot Drag Co-efficient vs Drag force
clear all
close all
clc
%inputs
rho = 1.2 %density of air kg/m^3
A = 0.7 %frontal area m^2
v = 50 %velocity of moving body m/s
c_d = [0.47 0.42 0.50 1.05 0.80 0.82 1.15 0.04 0.09] %coefficient of drag
F_d = 0.5*(rho*A*v^2)*c_d %drag force
plot(c_d,F_d,'linewidth',2,'color','r')
xlabel('drag coefficient')
ylabel('drag force')
grid on
Explanation:
The program is similar as that of program 1. Here the coefficient of drag is varried for same other inputs and rest is same.The values of coefficient of drag according to the shape are tabulated below and hence drag force is estimated. Then plot command is used to create a plot.
Errors faces : None
Results : The following plot is generated. It shows linear relation between cd and Fd.