Project

Matlab program to calculate drag force of a cyclist

DRAG FORCE

Drag force is a force that acts opposite to the direction of motion of a body. It is caused by the resistance of fluid as the object moves through it. The formulae to calculate the drag force is.

`D=1/2(c_d rho A v^2)`

where:

  • D=Drag Force
  • c_d=Drag coefficient
  • rho=Density of fluid in which the body is moving in
  • A=Frontal Area projected parallel to the direction of motion
  • v=velocity of the object

All units are SI UNITS

COEFFICIENT OF DRAG

The coefficient of drag is the measure of aero dynamism of a body. It is dependent on the shape of the body and not its size. It is dependent on the skin Friction and Geometric Shape of the body. It is usually determined experimentally.

PROGRAM 1

Matlab Program That calculates drag force vs velocities for different velocities

%Matlab Program That calculates drag force vs velocities ie for different
%velocities
% Drag force inputs.

%Coeficient of Drag of a bicycle and cyclist ranges from 0.6 to 0.8. This
%info can be found at https://link.springer.com/article/10.1007/s12283-017-0234-1
%Taking our coefficient of drag as 0.7
c_d=0.7

%Frontal Area projected parallel to the direction of motion taken as 0.46 m^2
%the values can be found at https://www.researchgate.net/figure/The-five-cyclist-positions-with-frontal-area-A-and-definition-and-values-of-1-sagittal_fig2_331366310
 A=0.46
 
 %Rho is the density of the fluid in this case air in kg/m^3
 rho=1.2754
 
 %Velocity of a bicycle in m/s^2 range from     0 to 25 
 v=[0:25]
 
%  Drag Force calculation 
drag_force=0.5*rho*v.^2*c_d*A

rgbc=[1 0 0]
plot([v],[drag_force],'color',rgbc,'linewidth',2)
grid on
grid minor
title('Velocity vs Drag Force')
xlabel({'Velocity in m/s^2 ',('x-axis')})
ylabel({'Drag Force in N/m^2 ',('y-axis')})

Velocity and Drag Force Values

The plot of Velocity Vs Drag Force

Program 1 conclusion

The plot of the velocity of a cyclist vs the drag force is an exponential in if A and c_d were held constant then the relationship would be drag_force would be proportional to zero point five multiplied to the square of velocity. Also, sample data shows that when v=5, drag force=5.13335 and when v=10, dragforce=20. Thus when v double drag force increases with a factor greater than 4 but less than 4.5. Note this is sample data taken from two points and the curve is exponential hence this relationship might not be true for all the values.

Also when the velocity equals 0 the drag force equals 0.

PROGRAM 2

Program to calculate drag force against different drag coefficients.

The coefficient of drag value depends on the geometric shape of the object and skin friction. The skin friction is usually a small value and depends on the material. The following is the coefficient of drag of different bodies

  • Half Sphere=0.42
  • Sphere=0.47
  • Cone= 0.5
  • Cube=1.05
  • Angled Cube=0.8
  • Long Cylinder =0.82
  • short cylinder =1.15
  • Streamlined body =0.04
  • Half streamlined body =0.09

code

%Program to calculate drag force against different drag coefficients.

%coeffeicent of drag value depends on the geometric shape of the object and
%skin friction. The skin friction is usually a small value and depends on
%the material. The following is the coefficient of drag of different bodies 
%Sphere =0.47 , Half Sphere=0.42 ,Cone= 0.5, Cube=1.05 ,Angled
%Cube=0.8,Long Cylinder 0.82, short cylinder =1.15,  Streamlined body 0.04,
%Half streamlined body 0.09.

%Is the coefficient of drag
c_d=[0.47 0.42 0.5 1.05 0.8 0.82 1.15 0.04 0.09]

% Frontal Area projected parallel to the direction of motion taken as 2 m^2
A=2

 %Rho is the density of the fluid in this case air in kg/m^3
 rho=1.2754
 
 %Velocity of the object, in this case, assumed to be 10
 v=[10]
 
%  Drag Force calculation 
drag_force=0.5*rho*v^2*c_d.*A

rgbc=[1 0 1]
plot([c_d],[drag_force],'color',rgbc,'linewidth',2)
grid on
grid minor
title('Plot of Drag Coefficient vs Drag Force')
xlabel({'Drag coefficient',('x-axis')})
ylabel({'Drag Force in N/m^2 ',('y-axis')})

The coefficient of drag and drag force values

The plot of the coefficient of drag Vs Drag Force

conclusion

The plot is a straight line. This shows that the drag force and drag coefficient graph is linear and drag force is directly proportional to the drag coefficient.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.