Matlab Program To Calculate Drag Force Against Cyclist
AIM : To write a matlab program to calculate drag force against cyclist.
OBJECTIVE :
- To write a program to plot velocity vs drag force
- To write a program to plot Drag coefficient vs drag force
INTRODUCTION :
A Drag force is the resistance force caused by a motion of a body through fluid such as water or air.
A Drag force act opposite to the direction on the oncoming flow velocity this is the relative velocity between body and the fluid.
The Drag force exerted on a body travelling through a fluid is given by :
`f_d = 1/2*rho*V^2*A*c_d`
where,
C_d = Drag coefficient,which can vary along with the speed of body
rho = Density of fluid through which body is moving
v = Speed of body related to fluid
A = Projected cross sectional area of body perpendicular to flow direction
Drag force acting on a bicycle can be calculated by considering the frontal area of cyclist.
___
MATLAB PROGRAM:
% A program to calculate the drag force on a bicycle
clear all
close all
clc
% Inputs
% Drag coefficient
c_d = 0.8
% Area m^2
A = 0.1
% Density kg/m^3
rho = 1.2
% Velocity
v = [1:50]
drag_force = rho*A*v.^2*c_d*0.5
plot(v,drag_force)
xlabel('velocity')
ylabel('Drag force')
grid on
OUTPUT:
From the above graph we can clearly see that as the velocity of bicycle increases the drag force acting on cyclist also increases it means the velocity is twice the drag force because in these case other parameters are constant .
so,
`f_d prop V^2`
% When velocity is constant and Drag coefficient is varying
% A program to calculate the drag force on a bicycle by keeping velocity constant and varying drag coefficient.
clear all
close all
clc
% Inputs
% Drag coefficient
%c_d f1 car = 0.22
%c_d sports car = 0.35
%c_d sports bike = 0.45
%c_d bicycle = 0.8
c_d = [0.22 ,0.35, 0.45, 0.8]
% Area m^2
A = 0.1
% Density kg/m^3
rho = 1.2
% Velocity
v = [1]
drag_force = rho*A*v.^2*c_d*0.5
plot(c_d,drag_force)
xlabel('drag coefficient')
ylabel('Drag force')
grid on
OUTPUT:
From above graph we can clearly see that the drag force is directly proportional to drag coefficient as the velocity is kept constant.
`f_d prop c_d`
PROGRAM EXPLANATION:
- Firstly we have given program name then we cleared all workspaces , command , figures.
- We provided suitable input data as per the given drag force equations .
- We kept drag coefficient constant in first program and velocity in second.
- Then we provided accurate formula/equation to calculate drag force .
- Then we plotted the output results as mentioned.
CONCLUSION :
As you can see there are two programs mentioned above in first program the drag coefficient is kept constant and then in second program the velocity is kept is constant and we obtained the following results:
- `f_d prop V^2`
- `f_d prop c_d`