To calculate drag force against a cyclist using a Matlab code.
Aim:
To calculate drag force against a cyclist using Matlab code.
Governing equations:


Project Objectives:
- Write a program to calculate drag force.
- Write a program to plot velocity vs drag force.
- Write a program to plot drag coefficient vs drag force.
Background:
Whenever a body moves with a certain velocity, it experiences a force in opposite direction (sometimes termed as ‘air resistance’). This opposite force acting on body is known as ‘drag force’. Drag force tends to push the body in opposite direction of its motion and hence reduces the speed. So, more force or power is required acquire certain velocity. Higher drag force may also damage the body. Not only this, but drag force also goes on increasing as velocity increases. Hence, it is very important to analyse the effects of drag force and minimize it.
Code:
1) Calculation of drag force for various velocity range and plotting velocity vs drag force graph.
clear all
close all
clc
%calculate_drag_force_on_cyclist_1
%drag_force = 1/2*rho*A*v^2*cd
%drag_force(N = kg*m/sec^2)
%cd = drag_coefficient
%rho = density(kg/m^3)
%A = frontal_area(m^2)
%v = velocity(m/sec)
% question: A cycle travels with speed of 80-120km/hr with drag
% coefficient 0.25. If front area is 6m^2, find drag force.
vv = [80:5:120]
v = [[vv.*1000]/[60*60]];
cd = 0.25;
A = 6;
rho = 1.2;
drag_force = [[1/2]*A*rho*[v.^2]*cd]
plot(vv, drag_force, 'color', 'r', 'marker', '*')
xlabel('velocity');
ylabel('drag force');
grid on

2) Calculation of drag force for various shapes having different drag coefficient, for same velocity and plotting drag coefficient vs drag force graph.
Drag coefficient for various shapes:
airfoil = (0.045)
sphere = (0.07)
bullet = (0.295)
prism = (1.14)
flat plate = (1.28)
clear all
close all
clc
%calculate_drag_force_on_cyclist_2
%drag_force = 1/2*rho*A*v^2*cd
%drag_force(N = kg*m/sec^2)
%cd = drag_coefficient
%rho = density(kg/m^3)
%A = frontal_area(m^2)
%v = velocity(m/sec)
% question: Determine drag force for various shapes having drag
% coeffiecients as follows:
%airfoil(0.045); sphere(0.07);bullet(0.295); prism(1.14); flat plate(1.28);
%Let velocity be 80km/hr and common frontal area 6m^2.
cd = [0.045, 0.07, 0.295, 1.14, 1.28]
rho = [1.225];
A = [6];
v = [[80*1000]/[60*60]];
drag_force = [0.5*rho*6*v^2.*cd]
plot(cd, drag_force, 'color', 'r','marker', '*')
xlabel('drag coefficient')
ylabel('drag force')
grid on

Conclusion:
From first graph, we can conclude that drag force on a body increases with increase in velocity.
From second graph, we can conclude that drag force on a body increases linearly with increase in drag coefficient.
For different geometric structures or shapes having same frontal area, drag coefficient is different for each shape. So, different shapes are subjected to different drag force even if they are having same velocity. Drag force results in opposite force which reduces speed and hence decreases efficiency. That’s why, it is very important to select proper aerodynamic shape while designing, so that body is subjected to minimum drag force in high velocity applications.
Applications: In designing cars, airplanes, fighter jets, etc.