Project

Drag Force Calculation Over A Bicycle (MATLAB)

Aim - To write a Matlab program for calculating drag force over a bicycle.

Introduction -

A drag force is a force experienced by the body when it flows over a fluid .It acts in the opposite direction of the body ,thus slowing it down . As we know air is also a form of fluid and thus can have a drag force .

Governing Equation –

V = velocity

Cd = drag co-efficient

rho (ρ) = Density

A = Frontal area

Fd = Drag force

Fd = 0.5×Cd ×A ×V^2 ×ρ

Objective -

  1. To Write a program to plot Velocity vs Drag force.
  2. To Write a program to plot Drag Co-efficient vs Drag force.

Code – 1

clear all
close all
clc
 
%inputs 
 
Cd = 0.8; % drag co-efficient 
V = [1:40] ; % velocity of the cycle
rho =1.2; % density 
A = 0.5; % frontal area 
 
% drag force calculation 
 
    
D_f = 0.5*A*Cd*rho*V.^2;% calculating drag force on the cycle 
 
 
 
 
 plot(V,D_f,'linewidth',1,'color','b');
 title(' velocity V/S Drag force  ');
 xlabel('velocity of cycle ');
 ylabel(' Drag force on cycle ');
 
 grid on ;

Explanation –

  1. The first three lines of the code are used to clear all the variables present in the workspace . Also the “clc” command helps to refresh .
  2. The inputs required for calculating the drag force is taken . The value of velocity is taken over a range considering the speed of the cycle .
  3. The value of the drag force is then calculated using the above equation .
  4. A graph is formed between “V” and “D_f” which “velocity V/S Drag force “ using a “plot “ command .

Output -

Conclusion –

  1. The objective of plotting graph between velocity and drag force is achieved .
  2. The graph is seen to be parabolic , which means as velocity increase , drag force increases quadratically.

Code – 2

clear all
close all
clc
 
%inputs 
 
Cd = [0.04 0.09 0.5 0.7 0.8 1.14 ]; % drag co-efficient 
V = 20 ; % velocity of the cycle
rho =1.2; % density 
A = 0.5; % frontal area 
 
% drag force calculation 
 
    
D_f = 0.5*A*Cd.*rho*V^2;% calculating drag force on the cycle 
 
 
 
 
 plot(Cd,D_f,'linewidth',1,'color','b');
 title(' Drag co-efficient V/S Drag force  ');
 xlabel('Drag co-efficient  ');
 ylabel(' Drag force on cycle ');
 
 grid on ;

Explanation –

  1. In the above code changes are made in the inputs and the plo command .
  2. The input for the velocity is kept constant . The drag co-efficient values are varied .
  3. The graph is made between Drag co-efficient and drag force .

Output –

Conclusion -

  1. The objective of plotting graph between Drag Co-efficient vs Drag force is achieved .
  2. The graph is seen to be linear , which means that as drag co-efficient changes , drag force changes linearly .
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.