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 -
- To Write a program to plot Velocity vs Drag force.
- 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 –
- 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 .
- 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 .
- The value of the drag force is then calculated using the above equation .
- A graph is formed between “V” and “D_f” which “velocity V/S Drag force “ using a “plot “ command .
Output -
Conclusion –
- The objective of plotting graph between velocity and drag force is achieved .
- 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 –
- In the above code changes are made in the inputs and the plo command .
- The input for the velocity is kept constant . The drag co-efficient values are varied .
- The graph is made between Drag co-efficient and drag force .
Output –
Conclusion -
- The objective of plotting graph between Drag Co-efficient vs Drag force is achieved .
- The graph is seen to be linear , which means that as drag co-efficient changes , drag force changes linearly .