MATLAB program to calculate drag force against a cyclist
AIM OF THE PROJECT:
To write a MATLAB program to determine the drag force against a Cyclist during cycling, including the graph between the velocity and the drag force, and also include a plot of a graph between the Drag Coefficient and the drag force.
INTRODUCTION:
Drag Force- In simple words, the drag force is a kind of resistive force that is caused due to the motion of an object when it moves through a fluid (like, air, water, etc) is known as a drag force. This force is always acting in the opposite direction of the moving velocity of the object. Generally, this force depends on the frontal area of the object, and the moving velocity of the object.
GOVERNING EQUATION:
The mathematical formula needed to calculate the drag force is shown below,

Where,
(F_D) is the drag Force
(rho) is the density of the fluid- A is the frontal area
- V is the velocity of the moving object
(C_D) is the coefficient of drag
OBJECTIVE OF THE PROJECT:
- MATLAB code corresponding to the formula to calculate the drag force against a Cyclist during cycling, and a graph between the velocity and the drag force
- MATLAB code corresponding to the formula to calculate the drag force against a Cyclist during cycling, and a graph between the drag Co-efficient and the drag force
MATLAB CODE:
Part First:
MATLAB code corresponding to the formula to calculate the drag force against a Cyclist during cycling, and a graph between the velocity and the drag force
% a program to calculate drag force
close all
clear all
clc
Input Data
% frontal area in m^2
A = 2;
% density in kg/m^3
rho = 1;
% velocity in m/s
V = [ 1 : 10 ] ;
%Drag Coefficient
C_D = [1 1.5 2 2.5 3];
for i = 1:5
%drag force in N
F_D = 0.5*rho*A*V.^2*C_D(i);
% plotting
plot (V, F_D)
xlabel ('V-Velocity')
ylabel ('F_D-Drag-Force')
axis ( [ -1 10 -1 10] )
grid on
hold on
end
OUTPUT:

Part Second:
MATLAB code corresponding to the formula to calculate the drag force against a Cyclist during cycling, and a graph between the drag Co-efficient and the drag force
close all
clear all
clc
Input Data
% frontal area in m^2
A = 2;
% density in kg/m^3
rho = 1;
% velocity in m/s
V = [ 1 : 10 ] ;
%Drag Coefficient
C_D = [1 1.5 2 2.5 3];
for i=1:10
%drag force in N
F_D = rho*A*V(i)^2*C_D.*0.5;
% plotting
hold on
plot ( C_D ,F_D )
xlabel ('C_D-drag co-efficient')
ylabel ('F_D-drag force')
grid on
end
OUTPUT:
