Flow over a BIcycle using MATLAB
Aim: To write a MATLAB program to calculate drag force against a cycle and to plot the graphs b/w velocity and Drag force and Drag co-efficient vs Drag force.
Governing Equation:
The Drag force over an object can be calculated by using the formula D = 0.5*rho*A*v^2*C_d.
Where rho = density of air (Kg/m^3)
A = frontal area(m^2)
V = Velocity (m/s^2)
C_d = Coefficient of drag
Flow of the project
- Code to calculate Drag force against a cyclist and plot velocity vs Drag force.
- Code to plot Drag co-efficient vs Drag force
- Results
1.Code to calculate Drag force against a cyclist:
%flow over a bicycle
close all
clear all
clc
%inputs
c_d = 0.9 %drag cofficient
v = linspace(25,50,15) %velocity (m/s^2)
rho = 1.225 %density(kg/m^3)
A = 0.5 %area(m^2)
drag_force = 0.5*rho*A.*v.^2*c_d
%plot velocity vs Drag force
plot(v,drag_force,’linewidth’,3)
xlabel('velocity')
ylabel('drag_force')
*The required parameters given in the equation to calculate the drag force are considered.
*Velocity is considered as an array with a set of 15 values.
*since velocity is an array element-wise operator(.) is used in the drag relation.
*using the plot command, a graph is plotted b/w velocity and Drag force.
2.Code to plot Drag coefficient vs Drag force:
close all
clear all
clc
%program to caluclate DRAG FORCE over a cyclist
%factors involved
v = 25 %velocity(m/s)
c_d = linspace(0.3,2,50) %coefficient of drag
A = 5 %frontal area(m^2)
rho = 1.225 %density of air(kg/m^3)
drag_force = 0.5*rho*A.*v.^2*c_d
%plot of drag coefficient vs drag
plot(c_d,drag_force,’linewidth’,3,'color','blue')
xlabel('cofficient of drag')
ylabel('Drag force(newtons)')
*for the same frontal area, to overcome the drag force the cyclist varies different postures which give different drag coefficients for the same frontal area.
*Therefore c_d is considered as an array with a different set of values.
*Using the plot command create a Plot b/w coefficient of drag and Drag force.
Results
1. Velocity vs Drag force


*The above values represent the Drag force for the given parameters.
2. Coefficient of drag vs Drag force


*The above values represent drag forces for the given parameters